From 75aada8482cc24f53f0d472d8ae5eb49a653fef8 Mon Sep 17 00:00:00 2001 From: Tudor Marcu Date: Thu, 2 Mar 2017 14:27:40 -0800 Subject: [PATCH] Remove dependency on deprecated helpers script Signed-off-by: Tudor Marcu --- pack-maker.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pack-maker.sh b/pack-maker.sh index 11aea77..7a70370 100755 --- a/pack-maker.sh +++ b/pack-maker.sh @@ -27,12 +27,6 @@ # mixer-pack-maker.sh --to 7000 --from 6900 --zero # -if [ ! -f /usr/share/mixer-tools/helpers ]; then - echo "Cannot find /usr/share/mixer-tools/helpers, please install first, exiting..." - exit -fi -source /usr/share/mixer-tools/helpers - FROM_VERS="" REPO_DIR="" STATE_DIR=/var/lib/update @@ -52,6 +46,16 @@ usage() { echo -e "\t-z, --zero-packs\tCreate zero packs. If only --to is specified, this is the default.\n" } +check_dep() { + set +e + type $1 &> /dev/null + if [ $? -ne 0 ]; then + echo "$1 program not found... Unable to continue" + exit 1 + fi + set -e +} + error() { echo -e "ERROR: $1\n" }