From e556952bc8b786ab381400bd3b95a2f288d694ba Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 10 Mar 2016 22:01:46 -0500 Subject: [PATCH] Add checks for required packages before running the build --- build-ubunturepo | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/build-ubunturepo b/build-ubunturepo index 1a32468cd..dc0d34d65 100755 --- a/build-ubunturepo +++ b/build-ubunturepo @@ -45,11 +45,16 @@ if [[ ! -f /etc/lsb-release ]]; then fi . /etc/lsb-release -REPREPRO=`which reprepro >> /dev/null 2>&1; echo $?` -if [[ ${REPREPRO} != 0 ]]; then - echo "ERROR: Could not find reprepro, verify that reprepro is installed on this machine. Cannot continue!" - exit 1 -fi +# Check the necessary packages before starting the build +declare -a packages=( "reprepro" "devscripts" "debhelper" "libsoap-lite-perl" "libdbi-perl" "quilt" ) + +for package in ${packages[@]}; do + RC=`dpkg -l | grep $package >> /dev/null 2>&1; echo $?` + if [[ ${RC} != 0 ]]; then + echo "ERROR: Could not find $package, install using 'apt-get install $package' to continue" + exit 1 + fi +done # Process cmd line variable assignments, assigning each attr=val pair to a variable of same name for i in $*; do