diff options
author | John P. Davis <zhen@gentoo.org> | 2004-08-02 23:23:34 +0000 |
---|---|---|
committer | John P. Davis <zhen@gentoo.org> | 2004-08-02 23:23:34 +0000 |
commit | 902e3c8bc858bff59a4fd43c568e1236fae83b66 (patch) | |
tree | b36200841e470a3e501741286f0b3d3e4dd7b64d /targets | |
parent | small bash fix (diff) | |
download | catalyst-902e3c8bc858bff59a4fd43c568e1236fae83b66.tar.gz catalyst-902e3c8bc858bff59a4fd43c568e1236fae83b66.tar.bz2 catalyst-902e3c8bc858bff59a4fd43c568e1236fae83b66.zip |
patch for bug 58840
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@423 d1e1f19c-881f-0410-ab34-b69fee027534
Diffstat (limited to 'targets')
-rwxr-xr-x | targets/stage1/build.py | 35 | ||||
-rwxr-xr-x | targets/stage1/build.sh | 17 | ||||
-rwxr-xr-x | targets/stage1/stage1-chroot.sh | 11 | ||||
-rwxr-xr-x | targets/stage1/stage1-preclean2-chroot.sh | 10 | ||||
-rwxr-xr-x | targets/stage1/stage1.sh | 6 | ||||
-rwxr-xr-x | targets/stage2/stage2-chroot.sh | 12 | ||||
-rwxr-xr-x | targets/stage3/stage3-chroot.sh | 6 |
7 files changed, 57 insertions, 40 deletions
diff --git a/targets/stage1/build.py b/targets/stage1/build.py new file mode 100755 index 00000000..ae64e0d7 --- /dev/null +++ b/targets/stage1/build.py @@ -0,0 +1,35 @@ +#!/usr/bin/python +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/build.py,v 1.1 2004/08/02 23:23:34 zhen Exp $ + +import portage + +# this loads files from the profiles ... +# wrap it here to take care of the different +# ways portage handles stacked profiles +def scan_profile(file): + if "grab_stacked" in dir(portage): + return portage.grab_stacked(file, portage.settings.profiles, portage.grabfile, incremental_lines=1); + else: + return portage.stack_lists( portage.grab_multiple(file, portage.settings.profiles, portage.grabfile), incremental=1); + +# loaded the stacked packages / packages.build files +pkgs = scan_profile("packages") +buildpkgs = scan_profile("packages.build") + +# go through the packages list and strip off all the +# crap to get just the <category>/<package> ... then +# search the buildpkg list for it ... if it's found, +# we replace the buildpkg item with the one in the +# system profile (it may have <,>,=,etc... operators +# and version numbers) +for idx in range(0, len(pkgs)): + try: + bidx = buildpkgs.index(portage.dep_getkey(pkgs[idx])) + buildpkgs[bidx] = pkgs[idx] + if buildpkgs[bidx][0:1] == "*": + buildpkgs[bidx] = buildpkgs[bidx][1:] + except: pass + +for b in buildpkgs: print b diff --git a/targets/stage1/build.sh b/targets/stage1/build.sh deleted file mode 100755 index c589d010..00000000 --- a/targets/stage1/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# Copyright 1999-2003 Gentoo Technologies, Inc. -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/Attic/build.sh,v 1.7 2004/06/18 18:06:21 zhen Exp $ - -for x in `cat /etc/make.profile/packages.build | grep -v '^#'` -do - myp=$(grep -E "${x}(-[^[:space:]]*)?[[:space:]]*$" /etc/make.profile/packages | grep -v '^#' | sed -e 's:^\*::' | cat ) - if [ "$myp" = "" ] - then - #if not in the system profile, include it anyway - echo $x - else - echo $myp - fi -done - diff --git a/targets/stage1/stage1-chroot.sh b/targets/stage1/stage1-chroot.sh index c2e07adc..6aac3b45 100755 --- a/targets/stage1/stage1-chroot.sh +++ b/targets/stage1/stage1-chroot.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/stage1-chroot.sh,v 1.19 2004/07/12 15:01:17 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/stage1-chroot.sh,v 1.20 2004/08/02 23:23:34 zhen Exp $ /usr/sbin/env-update source /etc/profile @@ -35,11 +35,10 @@ export ROOT=${1} install -d ${ROOT} ## START BUILD -for x in $(/tmp/build.sh) -do - #echo $x >> /tmp/build.log - export clst_buildpkgs="${clst_buildpkgs} ${x}" -done +export clst_buildpkgs="$(/tmp/build.py)" +STAGE1_USE="$(source /etc/make.profile/make.defaults ; echo ${STAGE1_USE})" + +USE="-* build ${STAGE1_USE}" emerge ${clst_myemergeopts} --noreplace ${clst_buildpkgs} || exit 1 if [ -n "${clst_VERBOSE}" ] then diff --git a/targets/stage1/stage1-preclean2-chroot.sh b/targets/stage1/stage1-preclean2-chroot.sh index 28ac12ca..71cbf887 100755 --- a/targets/stage1/stage1-preclean2-chroot.sh +++ b/targets/stage1/stage1-preclean2-chroot.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/Attic/stage1-preclean2-chroot.sh,v 1.2 2004/05/17 01:21:17 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/Attic/stage1-preclean2-chroot.sh,v 1.3 2004/08/02 23:23:34 zhen Exp $ #now, some finishing touches to initialize gcc-config.... unset ROOT @@ -14,5 +14,9 @@ then fi #stage1 is not going to have anything in zoneinfo, so save our Factory timezone -rm -f /etc/localtime -cp /usr/share/zoneinfo/Factory /etc/localtime +if [ -d /usr/share/zoneinfo ] ; then + rm -f /etc/localtime + cp /usr/share/zoneinfo/Factory /etc/localtime +else + echo UTC > /etc/TZ +fi diff --git a/targets/stage1/stage1.sh b/targets/stage1/stage1.sh index 4906e8fc..d5a1db4e 100755 --- a/targets/stage1/stage1.sh +++ b/targets/stage1/stage1.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/Attic/stage1.sh,v 1.14 2004/07/03 00:33:37 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/Attic/stage1.sh,v 1.15 2004/08/02 23:23:34 zhen Exp $ case $1 in enter) @@ -10,7 +10,7 @@ case $1 in run) cp ${clst_sharedir}/targets/stage1/stage1-chroot.sh ${clst_chroot_path}/tmp - cp ${clst_sharedir}/targets/stage1/build.sh ${clst_chroot_path}/tmp + cp ${clst_sharedir}/targets/stage1/build.py ${clst_chroot_path}/tmp # set up "ROOT in chroot" dir install -d ${clst_chroot_path}/tmp/stage1root/etc @@ -39,7 +39,7 @@ case $1 in clean) #clean runs after preclean with bind mounts unmounted - keepers="virtual/os-headers sys-devel/binutils sys-devel/gcc virtual/baselayout sys-libs/glibc virtual/libc virtual/kernel" + keepers="virtual/os-headers sys-devel/binutils sys-devel/gcc sys-apps/baselayout virtual/libc virtual/kernel" # set everything to uid 999 (nouser) cd ${clst_chroot_path}/tmp/stage1root install -d var/db/pkg2 diff --git a/targets/stage2/stage2-chroot.sh b/targets/stage2/stage2-chroot.sh index ddcfd0f9..5a2aaa6f 100755 --- a/targets/stage2/stage2-chroot.sh +++ b/targets/stage2/stage2-chroot.sh @@ -1,7 +1,7 @@ #!/bin/sh # Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage2/stage2-chroot.sh,v 1.4 2004/06/18 18:06:21 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage2/stage2-chroot.sh,v 1.5 2004/08/02 23:23:34 zhen Exp $ /usr/sbin/env-update source /etc/profile @@ -15,7 +15,7 @@ then fi if [ -n "${clst_DISTCC}" ] -then +then export clst_myfeatures="${clst_myfeatures} distcc" export DISTCC_HOSTS="${clst_distcc_hosts}" @@ -29,15 +29,13 @@ then export EMERGE_OPTS="--usepkg --buildpkg" fi -grep GRP_STAGE23_USE /etc/make.profile/make.defaults > /tmp/stage23 -source /tmp/stage23 -rm -f /tmp/stage23 +GRP_STAGE23_USE="$(source /etc/make.profile/make.defaults ; echo ${GRP_STAGE23_USE})" if [ -f /usr/portage/profiles/${clst_profile}/parent ] then - export clst_bootstrap="bootstrap-cascade.sh" + export clst_bootstrap="bootstrap-cascade.sh" else - export clst_bootstrap=bootstrap.sh + export clst_bootstrap=bootstrap.sh fi ## setup the environment diff --git a/targets/stage3/stage3-chroot.sh b/targets/stage3/stage3-chroot.sh index b6cf04c2..76ca9751 100755 --- a/targets/stage3/stage3-chroot.sh +++ b/targets/stage3/stage3-chroot.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage3/stage3-chroot.sh,v 1.7 2004/07/12 15:01:17 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage3/stage3-chroot.sh,v 1.8 2004/08/02 23:23:34 zhen Exp $ /usr/sbin/env-update source /etc/profile @@ -29,9 +29,7 @@ then export clst_myemergeopts="${clst_myemergeopts} --usepkg --buildpkg" fi -grep GRP_STAGE23_USE /etc/make.profile/make.defaults > /tmp/stage23 -source /tmp/stage23 -rm -f /tmp/stage23 +GRP_STAGE23_USE="$(source /etc/make.profile/make.defaults ; echo ${GRP_STAGE23_USE})" # setup the build environment export FEATURES="${clst_myfeatures}" |