From 902e3c8bc858bff59a4fd43c568e1236fae83b66 Mon Sep 17 00:00:00 2001 From: "John P. Davis" Date: Mon, 2 Aug 2004 23:23:34 +0000 Subject: [PATCH] patch for bug 58840 git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@423 d1e1f19c-881f-0410-ab34-b69fee027534 --- ChangeLog | 10 ++++++- modules/generic_stage_target.py | 7 ++++- targets/stage1/build.py | 35 +++++++++++++++++++++++ targets/stage1/build.sh | 17 ----------- targets/stage1/stage1-chroot.sh | 11 ++++--- targets/stage1/stage1-preclean2-chroot.sh | 10 +++++-- targets/stage1/stage1.sh | 6 ++-- targets/stage2/stage2-chroot.sh | 12 ++++---- targets/stage3/stage3-chroot.sh | 6 ++-- 9 files changed, 72 insertions(+), 42 deletions(-) create mode 100755 targets/stage1/build.py delete mode 100755 targets/stage1/build.sh diff --git a/ChangeLog b/ChangeLog index da66c899..d88fcfc7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for gentoo/src/catalyst # Copyright 2002-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.73 2004/07/21 05:03:42 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.74 2004/08/02 23:23:34 zhen Exp $ + + 02 Aug 2004; John Davis modules/generic_stage_target.py, + +targets/stage1/build.py, -targets/stage1/build.sh, + targets/stage1/stage1-chroot.sh, targets/stage1/stage1-preclean2-chroot.sh, + targets/stage1/stage1.sh, targets/stage2/stage2-chroot.sh, + targets/stage3/stage3-chroot.sh: + applied patch from bug #58840. it should fix up things for uclibc stages and + cascaded profiles. thanks to Mike Frysinger (vapier@gentoo.org) for the patch. 21 Jul 2004; John Davis +livecd/files/gamecd-xinitrc, +livecd/files/gamecd.motd.txt, +livecd/files/generic-motd.txt, diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py index c4b1588d..bed9b6d6 100644 --- a/modules/generic_stage_target.py +++ b/modules/generic_stage_target.py @@ -1,6 +1,6 @@ # Distributed under the GNU General Public License version 2 # Copyright 2003-2004 Gentoo Technologies, Inc. -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.7 2004/07/14 17:23:16 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.8 2004/08/02 23:23:34 zhen Exp $ """ This class does all of the chroot setup, copying of files, etc. It is @@ -89,6 +89,11 @@ class generic_stage_target(generic_target): print "Building on",self.settings["hostarch"],"for alternate machine type",\ self.settings["mainarch"] + # grab build settings from the environment + for envvar in "CHOST", "CFLAGS", "CXXFLAGS": + if os.environ.has_key(envvar): + self.settings[envvar] = os.environ[envvar] + # define all of our core variables self.settings["target_profile"]=self.settings["profile"] self.settings["target_subpath"]=self.settings["rel_type"]+"/"+self.settings["target"]+\ 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 / ... 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}" -- 2.26.2