]> xenbits.xensource.com Git - people/sstabellini/raisin.git/commitdiff
raisin: Use PKGTYPE rather than DISTRO to determine how to build a package
authorGeorge Dunlap <george.dunlap@eu.citrix.com>
Mon, 20 Apr 2015 15:04:58 +0000 (15:04 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Mon, 20 Apr 2015 15:04:58 +0000 (15:04 +0000)
From: George Dunlap <george.dunlap@eu.citrix.com>

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
README
lib/common-functions.sh

diff --git a/README b/README
index e9a24133ce0947afdcdfc8bea2c1cbdd8151b02f..847128e01bb22cdc4aa2cb5996aa0079d9db53e8 100644 (file)
--- a/README
+++ b/README
@@ -80,6 +80,7 @@ GIT: git command to run, but prefer the git-checkout.sh script
 RAISIN_MAKE: make command to run
 SUDO: sudo command to run
 DISTRO: which Linux distribution we are running on, Debian, Fedora, etc
+PKGTYPE: which package format is used by the distro, rpm, deb, etc
 ARCH: which architecture we are running on, x86_64, arm32, etc.
 BASEDIR: absolute path of the raisin directory
 PREFIX: installation PREFIX
index 05e8fa830f1074246e3bf214c5804a10d6c7faf0..5aecdb97d67ab6b51a2cbb057bd0b12753ed7366 100644 (file)
@@ -245,16 +245,16 @@ function for_each_component () {
     done
 }
 
+function _build_package_deb() {
+    fakeroot bash ./scripts/mkdeb "$1"
+}
+
+function _build_package_rpm() {
+    ./scripts/mkrpm "$1"
+}
+
 function build_package() {
-    if [[ $DISTRO = "Debian" ]]
-    then
-        fakeroot bash ./scripts/mkdeb "$1"
-    elif [[  $DISTRO = "Fedora" ]]
-    then
-        ./scripts/mkrpm "$1"
-    else
-        echo "Don't know how to create packages for $DISTRO"
-    fi
+    _build_package_"$PKGTYPE" "$1"
 }
 
 function install_package() {