# 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 <zhen@gentoo.org> 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 <zhen@gentoo.org> +livecd/files/gamecd-xinitrc,
+livecd/files/gamecd.motd.txt, +livecd/files/generic-motd.txt,
# 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
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"]+\
--- /dev/null
+#!/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
+++ /dev/null
-#!/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
-
#!/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
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
#!/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
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
#!/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)
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
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
#!/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
fi
if [ -n "${clst_DISTCC}" ]
-then
+then
export clst_myfeatures="${clst_myfeatures} distcc"
export DISTCC_HOSTS="${clst_distcc_hosts}"
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
#!/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
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}"