From f1152ae54d359010f4da6c5ae12e9464ce383d31 Mon Sep 17 00:00:00 2001 From: arifali Date: Tue, 10 Apr 2012 11:00:00 +0000 Subject: [PATCH] change build script for ubuntu * Generalised the CODENAME to be taken out of /etc/lsb-release * added building of xcat-dep, the script for that will be added later * added for loop to create packages rather than one line per package git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12176 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- build-debs-all | 17 ++++++++--------- build-ubunturepo | 21 +++++++++++++++++---- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/build-debs-all b/build-debs-all index ddebc60cf..f77464b18 100755 --- a/build-debs-all +++ b/build-debs-all @@ -6,6 +6,7 @@ # # Author: Leonardo Tonetto # Revisor: Adalberto Medeiros +# Revisor2: Arif Ali # # Input: # @@ -60,21 +61,19 @@ function makedeb { # # Clean up # - # Eliminate unnecessary directories and debian/files made by dpgk-buildpakcage + # Eliminate unnecessary directories and debian/files made by dpkg-buildpackage find $SRC_ROOT -maxdepth 3 -type d -name "xcat-*" | grep debian | xargs rm -rf find $SRC_ROOT -maxdepth 3 -type f -name "files" | grep debian | xargs rm -f } # build all debian packages -makedeb xCAT-client $PKG_LOCATION "$BUILD_STRING" $VERSION -makedeb xCAT-nbroot $PKG_LOCATION "$BUILD_STRING" $VERSION -makedeb perl-xCAT $PKG_LOCATION "$BUILD_STRING" $VERSION -makedeb xCAT-server $PKG_LOCATION "$BUILD_STRING" $VERSION -makedeb xCAT-UI $PKG_LOCATION "$BUILD_STRING" $VERSION -makedeb xCAT $PKG_LOCATION "$BUILD_STRING" $VERSION -makedeb xCATsn $PKG_LOCATION "$BUILD_STRING" $VERSION -makedeb xCAT-test $PKG_LOCATION "$BUILD_STRING" $VERSION +packages="xCAT-client xCAT-nbroot xCAT-nbroot2 perl-xCAT xCAT-server xCAT-UI xCAT xCATsn xCAT-test xCAT-IBMhpc xCAT-rmc" + +for file in `echo $packages` +do + makedeb $file $PKG_LOCATION "$BUILD_STRING" $VERSION +done if [ -d debs ]; then rm -rf debs diff --git a/build-ubunturepo b/build-ubunturepo index 750ea4bf7..2ebc47e7a 100755 --- a/build-ubunturepo +++ b/build-ubunturepo @@ -2,12 +2,17 @@ # Update GSA Ubuntu Repositories or create a local repository # # Author: Leonardo Tonetto (tonetto@linux.vnet.ibm.com) +# Revisor: Arif Ali (aali@ocf.co.uk) # # After running this script, add the following line to # /etc/apt/sources.list for local repository # deb file:///xcat-core/ maverick main +# deb file:///xcat-dep/ maverick main # +# For the purpose of getting the distribution name +. /etc/lsb-release + a_flag= # automatic flag - only update if repo was updated c_flag= # xcat-core (trunk-delvel) path d_flag= # xcat-dep (trunk) path @@ -131,7 +136,7 @@ then cat << __EOF__ > $repo_xcat_core_path/conf/distributions Origin: xCAT internal repository Label: xcat-core bazaar repository -Codename: maverick +Codename: $DISTRIB_CODENAME Architectures: i386 amd64 Components: main Description: Repository automatically genereted conf @@ -143,7 +148,7 @@ basedir . __EOF__ for file in `ls $repo_xcat_core_path/*.deb`; do - reprepro -b $repo_xcat_core_path includedeb maverick $file; + reprepro -b $repo_xcat_core_path includedeb $DISTRIB_CODENAME $file; done mv $xcat_core_path/latest_version $repo_xcat_core_path/xcat-core_latest-build @@ -174,6 +179,14 @@ else fi if [ "$d_flag" -a "$update_dep" ] then + echo "##############################" + echo "# Building xcat-dep packages #" + echo "##############################" + + CMD_PATH=`pwd` + cd $xcat_dep_path + ./build-debs-all "snap" "Nightly_Builds" + echo "################################" echo "# Creating xcat-dep repository #" echo "################################" @@ -183,7 +196,7 @@ then cat << __EOF__ > $repo_xcat_dep_path/conf/distributions Origin: xCAT internal repository Label: xcat-dep bazaar repository -Codename: maverick +Codename: $DISTRIB_CODENAME Architectures: i386 amd64 Components: main Description: Repository automatically genereted conf @@ -195,7 +208,7 @@ basedir . __EOF__ for file in `ls $repo_xcat_dep_path/*.deb`; do - reprepro -b $repo_xcat_dep_path includedeb maverick $file; + reprepro -b $repo_xcat_dep_path includedeb $DISTRIB_CODENAME $file; done if [ -z "$local_flag" ]