]> xenbits.xensource.com Git - raisin.git/commitdiff
Gracefully handle an unsupported distro.
authorDoug Goldstein <cardoe@cardoe.com>
Tue, 18 Aug 2015 23:12:54 +0000 (18:12 -0500)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Mon, 7 Sep 2015 14:49:05 +0000 (14:49 +0000)
When your distro is not supported, handle the case gracefully and let
the user know instead of spitting out bash errors.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
lib/common-functions.sh

index efde84c1233c7f7280c0dcd255b07b7fd1793d2f..c52174a5b2473754492c8f8ed465f430b5835638 100644 (file)
@@ -176,6 +176,7 @@ function get_distro() {
             ;;
         *)
             DISTRO=$os_VENDOR
+            PKGTYPE="unknown"
             ;;
     esac
 
@@ -220,6 +221,16 @@ function _install-package-rpm() {
     $SUDO yum install -y $* > /dev/null
 }
 
+function _check-package-unknown() {
+    error_echo "I don't know distro $DISTRO. It might be missing packages."
+    return 1
+}
+
+function _install-package-unknown() {
+    error_echo "I don't know distro $DISTRO. Cannot install packages."
+    return 1
+}
+
 # Modifies inherited variable "missing"
 function check-package() {
     for p in $*