]> xenbits.xensource.com Git - people/sstabellini/raisin.git/commitdiff
Introduce --no option to reply no to all questions
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Tue, 14 Apr 2015 11:13:47 +0000 (11:13 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Tue, 14 Apr 2015 11:13:47 +0000 (11:13 +0000)
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
lib/commands.sh
raise

index bf5493bc9b1e6b0535379a03e05abefbde6ca49f..b330209985dd018b2c7090601a4f2a48f0552d9b 100755 (executable)
@@ -15,7 +15,10 @@ function check-builddep() {
     if [[ -n "${missing[@]}" ]]
     then
         echo "Missing packages: ${missing[@]}"
-        if [[ $YES != "y" ]]
+        if [[ "$YES" = "n" ]]
+        then
+            return
+        elif [[ "$YES" != "y" ]]
         then
             echo "Do you want Raisin to automatically install them for you? (y/n)"
             while read answer
@@ -74,7 +77,10 @@ function install() {
 }
 
 function configure() {
-    if [[ $YES != "y" ]]
+    if [[ "$YES" = "n" ]]
+    then
+        return
+    elif [[ "$YES" != "y" ]]
     then
         echo "Proceeding we'll make changes to the running system,"
         echo "are you sure that you want to continue? (y/n)"
diff --git a/raise b/raise
index b254904d624ffff17db08ca344454b22387feabe..94507d25d6c1013b3a519398f78c834f1c7414bd 100755 (executable)
--- a/raise
+++ b/raise
@@ -7,6 +7,7 @@ _help() {
     echo "where options are:"
     echo "    -v | --verbose       Verbose"
     echo "    -y | --yes           Do not ask questions and continue"
+    echo "    -n | --no            No to all questions"
     echo "where commands are:"
     echo "    install-builddep     Install build time dependencies (requires sudo)"
     echo "    build                Build the components enabled in config"
@@ -41,7 +42,7 @@ common_init
 
 # parameters check
 export VERBOSE=0
-export YES="n"
+export YES=""
 while [[ $# -gt 1 ]]
 do
   if [[ "$1" = "-v" || "$1" = "--verbose" ]]
@@ -52,6 +53,10 @@ do
   then
     YES="y"
     shift 1
+  elif [[ "$1" = "-n" || "$1" = "--no" ]]
+  then
+    YES="n"
+    shift 1
   else
     _help
     exit 1