Ensure the fuser related package exists for building 32/1532/1
authorcarey.xu <carey.xuhan@huawei.com>
Sat, 12 Sep 2015 06:14:20 +0000 (14:14 +0800)
committercarey.xu <carey.xuhan@huawei.com>
Sat, 12 Sep 2015 06:14:20 +0000 (14:14 +0800)
Change-Id: I7b2cb14d0ea02e504f9cc83213b5e29d3cc9695b
JIRA: COMPASS-47

build.sh

index f9e2387..8830819 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -4,19 +4,19 @@ set -ex
 SCRIPT_DIR=`cd ${BASH_SOURCE[0]%/*};pwd`
 COMPASS_DIR=${SCRIPT_DIR}
 WORK_DIR=$SCRIPT_DIR/work/building
+PACKAGES="fuse fuseiso createrepo genisoimage curl"
 
 source $SCRIPT_DIR/build/build.conf
 
 mkdir -p $WORK_DIR
 
 cd $WORK_DIR
-
 function prepare_env()
 {
     set +e
-    for i in createrepo genisoimage curl; do
-        $i --version >/dev/null 2>&1
-        if [[ $? -ne 0 ]]; then
+    for i in $PACKAGES; do
+        if ! apt --installed list 2>/dev/null |grep "\<$i\>"
+        then
             sudo apt-get install  -y --force-yes  $i
         fi
     done