X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=build.common;h=622bd8005fa5cb3b0d89b847d1947fafb777fc8e;hb=refs%2Fheads%2Flxc_devel;hp=6bffc4c61f34863d170b2cd72ceefa5ceddca418;hpb=56fa0dcde7b96d5ba59996ef5ce5e517c585fd6c;p=build.git diff --git a/build.common b/build.common index 6bffc4c6..622bd800 100644 --- a/build.common +++ b/build.common @@ -1,8 +1,5 @@ # -*-Shell-script-*- # -# $Id$ -# $URL$ -# # Common functions for build scripts used by various packages # incorporated (e.g., build, myplc, myplc-devel, vserver-reference) # @@ -18,7 +15,7 @@ export PATH=.:$PATH function pl_getDistro() { if [ -f "/etc/redhat-release" ] ; then distro=$(awk ' { print $1 } ' /etc/redhat-release) - case $distro in Red*) distro="Redhat" ; esac + case $distro in Scientific*) distro="SL" ; esac else echo "build.common.pl_getDistro-unknown" exit 1 @@ -30,7 +27,7 @@ function pl_getDistro() { # returns something like 8, 10, or 5.3 function pl_getRelease() { if [ -f "/etc/redhat-release" ] ; then - release=$(awk ' { if ($1=="Fedora" && $2=="Core") print $4 ; if (($1=="Fedora" && $2!="Core")||$1=="CentOS") print $3 ; if ($1=="Red") print $6 } ' /etc/redhat-release) + release=$(awk ' { if ($1=="Fedora" && $2=="Core") print $4 ; if (($1=="Fedora" && $2!="Core")||$1=="CentOS") print $3 ; if ($1=="Scientific") print $4 } ' /etc/redhat-release) else echo "build.common.pl_getRelease-unknown" exit 1 @@ -48,9 +45,6 @@ function pl_getReleaseName () { [Ff]edora*) releasename=f$release ;; - [Re]edhat*) - releasename=rhel6 - ;; [Cc]entOS*) old_IFS="$IFS" IFS="." @@ -58,6 +52,9 @@ function pl_getReleaseName () { IFS="$old_IFS" releasename=centos$1 ;; + [Ss]L*) + releasename=sl$release + ;; *) releasename="unknown-name-for-${pl_DISTRO}-please-edit-build.common" echo 1>&2 "build.common: WARNING - releasename not set for distro=$distro" @@ -73,17 +70,20 @@ function pl_getReleaseName () { function pl_getKexcludes () { distroname=$1; shift case $distroname in - ### there is an ugly hack going on around here - # with f12, the dependencies somehow require kernel 2.6.29 but our own kernel is 2.6.27 - # so the ugly workaround here is to let 'kernel-debug' get installed from the stock repos - # we then remove it manually after the image is done, look for kernel-debug below - # relyong on kernel-PAE for this trick won't work, as 64 bits distros don't have PAE of course - f*) - echo 'kernel kernel-PAE kernel-PAEdebug kernel-vserver kernel-devel kernel-headers kernel-debuginfo util-vserver* iptables iptables-ipv6 iproute drupal' ;; - centos5) - echo 'kernel kernel-vserver kernel-devel kernel-headers kernel-debuginfo util-vserver* iptables iproute drupal inotify-tools* libnl' ;; - *) - echo "pl_DISTRO_NAME=$pl_DISTRO_NAME not supported in getexcludes.sh" ; exit 1 ;; + # when using k27, we need our own flavour of iproute + # for now we build only for k32, regardless of fcdistro + f8) + echo 'kernel* util-vserver* iptables iptables-ipv6 drupal' ;; + f16) + echo 'drupal' ;; + f*) + echo 'util-vserver* drupal' ;; + centos5) + echo 'kernel kernel-vserver kernel-devel kernel-headers kernel-debuginfo util-vserver* iptables drupal inotify-tools* libnl' ;; + sl*) + echo 'kernel kernel-debug kernel-debug-devel kernel-devel kernel-doc kernel-firmware kernel-headers iptables' ;; + *) + echo "pl_DISTRO_NAME=$pl_DISTRO_NAME not supported in getexcludes.sh" ; exit 1 ;; esac } @@ -330,6 +330,7 @@ cachedir=/var/cache/yum debuglevel=2 logfile=/var/log/yum.log pkgpolicy=newest +multilib_policy=best distroverpkg=redhat-release tolerant=1 exactarch=1 @@ -381,6 +382,7 @@ fi if [ -n "$pkgs_packages" ] ; then echo "* Installing optional packages" $pkgs_packages # ignore yum's return code that is basically undefined + echo "* Install options" $vroot $yum_options yum $yum_options install $pkgs_packages || : if ! rpm --root $vroot -q $pkgs_packages >/dev/null ; then echo "* Warning: Missing packages" @@ -546,6 +548,7 @@ function pl_parsePkgs () { fcdistro=$1; shift pldistro=$1; shift + echo 1>&2 "pl_parsePkgs: using -a $target_arch -f $fcdistro -d $pldistro $keyword $@" pkgs.py -a $target_arch -f $fcdistro -d $pldistro $keyword "$@" } # usage: pl_getPackages [-a arch] fcdistro pldistro pkg-file[..s] @@ -743,15 +746,13 @@ $kexclude_line" $template > $dest_yumconf return 0 } -# from a yum.conf as generated above, computes the (first) gpgkey url +# from a yum.conf as generated above, computes the gpgkey urls function yumconf_gpgkey () { dest_yumconf=$1; shift - first_line=$(grep '^gpgkey=' $dest_yumconf | head -1) - values=$(echo $first_line | sed -e s,gpgkey=,,) - value=$(echo $values | awk '{print $1;}' | sed -e 's,$basearch,'"$pl_DISTRO_ARCH",g) - [ -n "$value" ] || return 1 - echo $value + values=$(grep -h '^gpgkey=' $dest_yumconf | sed -e s,gpgkey=,, | sed -e 's,$basearch,'"$pl_DISTRO_ARCH",g | sed -e 's, ,\n,g' | sort | uniq | xargs) + [ -n "$values" ] || return 1 + echo $values return 0 }