]> git-server-git.apps.pok.os.sepia.ceph.com Git - s3-tests.git/commitdiff
bootstrap: apt/yum install the list of dependencies 55/head
authorKen Dreyer <kdreyer@redhat.com>
Fri, 15 May 2015 17:15:33 +0000 (11:15 -0600)
committerKen Dreyer <kdreyer@redhat.com>
Fri, 15 May 2015 17:18:55 +0000 (11:18 -0600)
If RPM or DEB packages are missing, don't print to STDERR and bail.
Instead, assume that the user has sudo rights, and attempt to install
the missing packages for the user automatically.

bootstrap

index 8571f6c2d81ed297c79c27c54b4a0c457f6575eb..15ef48cd89d1211d1c60193145909e88838b2287 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -9,9 +9,8 @@ if [ -f /etc/debian_version ]; then
         fi
     done
     if [ -n "$missing" ]; then
-        echo "$0: missing required packages, please install them:" 1>&2
-        echo "  sudo apt-get install $missing"
-        exit 1
+        echo "$0: missing required DEB packages. Installing via sudo." 1>&2
+        sudo apt-get -y install $missing
     fi
 fi
 if [ -f /etc/redhat-release ]; then
@@ -21,9 +20,8 @@ if [ -f /etc/redhat-release ]; then
         fi
     done
     if [ -n "$missing" ]; then
-        echo "$0: missing required packages, please install them:" 1>&2
-        echo "  sudo yum install $missing"
-        exit 1
+        echo "$0: missing required RPM packages. Installing via sudo." 1>&2
+        sudo yum -y install $missing
     fi
 fi