]> xenbits.xensource.com Git - raisin.git/commitdiff
Use local variables to store the list dependencies
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Wed, 18 Mar 2015 14:52:17 +0000 (14:52 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Wed, 18 Mar 2015 14:52:17 +0000 (14:52 +0000)
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
grub.sh
libvirt.sh
xen.sh

diff --git a/grub.sh b/grub.sh
index 075763c63bf112e4651457b40435a2081dd74a88..40d9c1664a83a1605fd3d1fd0c0e62cdd7e4fc91 100644 (file)
--- a/grub.sh
+++ b/grub.sh
@@ -4,18 +4,18 @@ source config
 source common-functions.sh
 
 
-DEP_Debian_common="git build-essential tar autoconf bison flex"
-DEP_Debian_x86_32="$DEP_Debian_common"
-DEP_Debian_x86_64="$DEP_Debian_common libc6-dev-i386"
-DEP_Debian_arm32="$DEP_Debian_common"
-DEP_Debian_arm64="$DEP_Debian_common"
+function grub_install_dependencies() {
+    local DEP_Debian_common="git build-essential tar autoconf bison flex"
+    local DEP_Debian_x86_32="$DEP_Debian_common"
+    local DEP_Debian_x86_64="$DEP_Debian_common libc6-dev-i386"
+    local DEP_Debian_arm32="$DEP_Debian_common"
+    local DEP_Debian_arm64="$DEP_Debian_common"
 
-DEP_Fedora_common="git make gcc tar automake autoconf sysconftool bison flex"
-DEP_Fedora_x86_32="$DEP_Fedora_common"
-DEP_Fedora_x86_64="$DEP_Fedora_common glibc-devel.i686"
+    local DEP_Fedora_common="git make gcc tar automake autoconf sysconftool bison flex"
+    local DEP_Fedora_x86_32="$DEP_Fedora_common"
+    local DEP_Fedora_x86_64="$DEP_Fedora_common glibc-devel.i686"
 
 
-function grub_build() {
     if test $ARCH != "x86_64" && test $ARCH != "x86_32"
     then
         echo grub is only supported on x86_32 and x86_64
@@ -23,6 +23,11 @@ function grub_build() {
     fi
     echo installing Grub dependencies
     eval install_dependencies \$DEP_"$DISTRO"_"$ARCH"
+}
+
+
+function grub_build() {
+    grub_install_dependencies
 
     tar cf memdisk.tar grub.cfg
     ./git-checkout.sh $GRUB_UPSTREAM_URL $GRUB_UPSTREAM_REVISION grub-dir
index fda68f6e7061d04f904084cc7bbe38648a5da684..f63454f6a9c67c1c54e8a6df0691d037961fac7d 100644 (file)
@@ -4,20 +4,30 @@ source config
 source common-functions.sh
 
 
-DEP_Debian_common="git build-essential libtool autoconf autopoint xsltproc libxml2-utils pkg-config python-dev libxml-xpath-perl libyajl-dev libxml2-dev gettext libdevmapper-dev libnl-3-dev libnl-route-3-dev"
-DEP_Debian_x86_32="$DEP_Debian_common"
-DEP_Debian_x86_64="$DEP_Debian_common"
-DEP_Debian_arm32="$DEP_Debian_common"
-DEP_Debian_arm64="$DEP_Debian_common"
+function libvirt_install_dependencies() {
+    local DEP_Debian_common="git build-essential libtool autoconf autopoint \
+                             xsltproc libxml2-utils pkg-config python-dev   \
+                             libxml-xpath-perl libyajl-dev libxml2-dev      \
+                             gettext libdevmapper-dev libnl-3-dev           \
+                             libnl-route-3-dev"
+    local DEP_Debian_x86_32="$DEP_Debian_common"
+    local DEP_Debian_x86_64="$DEP_Debian_common"
+    local DEP_Debian_arm32="$DEP_Debian_common"
+    local DEP_Debian_arm64="$DEP_Debian_common"
+
+    local DEP_Fedora_common="git patch make gcc libtool autoconf gettext-devel \
+                             python-devel libxslt yajl-devel libxml2-devel     \
+                             device-mapper-devel libpciaccess-devel            \
+                             libuuid-devel"
+    local DEP_Fedora_x86_32="$DEP_Fedora_common"
+    local DEP_Fedora_x86_64="$DEP_Fedora_common"
 
-DEP_Fedora_common="git patch make gcc libtool autoconf gettext-devel python-devel libxslt yajl-devel libxml2-devel device-mapper-devel libpciaccess-devel libuuid-devel"
-DEP_Fedora_x86_32="$DEP_Fedora_common"
-DEP_Fedora_x86_64="$DEP_Fedora_common"
-
-
-function libvirt_build() {
     echo installing Libvirt dependencies
     eval install_dependencies \$DEP_"$DISTRO"_"$ARCH"
+}
+
+function libvirt_build() {
+    libvirt_install_dependencies
 
     ./git-checkout.sh $LIBVIRT_UPSTREAM_URL $LIBVIRT_UPSTREAM_REVISION libvirt-dir
     cd libvirt-dir
diff --git a/xen.sh b/xen.sh
index 484e3587abfe15285d30da832ccbf5af511f8f05..97ba5792077c9bcae41ad959b7eb3a639d786e7a 100644 (file)
--- a/xen.sh
+++ b/xen.sh
@@ -4,24 +4,27 @@ source config
 source common-functions.sh
 
 
-DEP_Debian_common="git build-essential python-dev gettext uuid-dev \
-    libncurses5-dev libyajl-dev libaio-dev pkg-config libglib2.0-dev \
-    libssl-dev libpixman-1-dev"
-DEP_Debian_x86_32="$DEP_Debian_common bcc iasl bin86 texinfo"
-DEP_Debian_x86_64="$DEP_Debian_x86_32 libc6-dev-i386"
-DEP_Debian_arm32="$DEP_Debian_common libfdt-dev"
-DEP_Debian_arm64="$DEP_Debian_arm32"
+function xen_install_dependencies() {
+    local DEP_Debian_common="git build-essential python-dev gettext uuid-dev   \
+             libncurses5-dev libyajl-dev libaio-dev pkg-config libglib2.0-dev  \
+             libssl-dev libpixman-1-dev"
+    local DEP_Debian_x86_32="$DEP_Debian_common bcc iasl bin86 texinfo"
+    local DEP_Debian_x86_64="$DEP_Debian_x86_32 libc6-dev-i386"
+    local DEP_Debian_arm32="$DEP_Debian_common libfdt-dev"
+    local DEP_Debian_arm64="$DEP_Debian_arm32"
+
+    local DEP_Fedora_common="git make gcc python-devel gettext libuuid-devel   \
+             ncurses-devel glib2-devel libaio-devel openssl-devel yajl-devel   \
+             patch pixman-devel"
+    local DEP_Fedora_x86_32="$DEP_Fedora_common dev86 iasl texinfo"
+    local DEP_Fedora_x86_64="$DEP_Fedora_x86_32 glibc-devel.i686"
 
-DEP_Fedora_common="git make gcc python-devel gettext libuuid-devel \
-    ncurses-devel glib2-devel libaio-devel openssl-devel yajl-devel patch \
-    pixman-devel"
-DEP_Fedora_x86_32="$DEP_Fedora_common dev86 iasl texinfo"
-DEP_Fedora_x86_64="$DEP_Fedora_x86_32 glibc-devel.i686"
-
-
-function xen_build() {
     echo installing Xen dependencies
     eval install_dependencies \$DEP_"$DISTRO"_"$ARCH"
+}
+
+function xen_build() {
+    xen_install_dependencies
 
     ./git-checkout.sh $XEN_UPSTREAM_URL $XEN_UPSTREAM_REVISION xen-dir
     cd xen-dir