]> xenbits.xensource.com Git - people/gdunlap/raisin.git/.git/commitdiff
Add cmd line option to avoid installing any dependencies
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Wed, 18 Mar 2015 16:05:07 +0000 (16:05 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Wed, 18 Mar 2015 16:07:20 +0000 (16:07 +0000)
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
build.sh
common-functions.sh

index 753a0a72e5ef2610acbcb39d7a0f134a358c9e3f..e0a4cdd3ed023eba8e6a725046d52485ea9b21b3 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -17,6 +17,12 @@ source xen.sh
 source grub.sh
 source libvirt.sh
 
+help() {
+    echo "Usage: ./build.sh <options>"
+    echo "where options are:"
+    echo "    -n | --no-deps       Do no install build-time dependencies"
+    echo "    -v | --verbose       Verbose"
+}
 
 # execution
 if test $EUID -eq 0
@@ -29,6 +35,26 @@ then
     exit 1
 fi
 
+# parameters check
+export NO_DEPS=0
+export VERBOSE=0
+while test $# -ge 1
+do
+  if test "$1" = "-n" || test "$1" = "--no-deps"
+  then
+    NO_DEPS=1
+    shift 1
+  elif test "$1" = "-v" || test "$1" = "--verbose"
+  then
+    VERBOSE=1
+    shift 1
+  else
+    help
+    exit 1
+  fi
+done
+
+
 get_distro
 get_arch
 
index b8d76b240629c915fc36d395c5c6d780b9154ef6..f68d36edb3eecf8fdc9008737b1d9e6e7ad86bba 100644 (file)
@@ -85,6 +85,12 @@ function get_arch() {
 }
 
 function install_dependencies() {
+    if test "$NO_DEPS" && test "$NO_DEPS" -eq 1
+    then
+        echo "Not installing any dependencies, as requested."
+        echo "Depency list: $*"
+        return 0
+    fi
     case $DISTRO in
         "Debian" | "Ubuntu" )
         $SUDO apt-get install -y $*