targetmap={}
targets.register(targetmap)
-print "Available targets:",string.join(targetmap.keys())
-
if os.getuid()!=0:
#non-root callers can't go any further than here.
die("This script requires root privileges to operate.")
myspec["portdir"]="/usr/portage"
myspec["options"]="ccache pkgcache"
if "ccache" in string.split(myspec["options"]):
+ print "Compiler cache support enabled."
myspec["CCACHE"]="1"
if "pkgcache" in string.split(myspec["options"]):
+ print "Package cache support enabled."
myspec["PKGCACHE"]="1"
#determine target, call target constructor and hand it the rest of the arguments
raise CatalystError,"Target \""+myspec["target"]+"\" not available."
mytarget=targetmap[myspec["target"]](myspec,addlargs)
- #let's display our spec information in all its glory
- print
- spec_dump(myspec)
- print
-
mytarget.run()
except CatalystError:
sys.exit(1)
raise CatalystError, "Sed command failed: "+mycmd
def clean(self):
- "do not call without first unbinding"
- os.system("rm -f"+self.settings["chroot_path"]+"/etc/ld.so.preload")
- retval=os.system("rm -f"+self.settings["chroot_path"]+"/etc/resolv.conf")
+ "do not call without first unbinding; this code needs a cleanup once it stabilizes"
+ os.system("rm -f "+self.settings["chroot_path"]+"/etc/ld.so.preload")
+ retval=os.system("rm -f "+self.settings["chroot_path"]+"/etc/resolv.conf")
if retval!=0:
raise CatalystError,"Could not clean up resolv.conf."
- retval=os.system("rm -f"+self.settings["chroot_path"]+"/usr/portage")
+ retval=os.system("rm -rf "+self.settings["chroot_path"]+"/usr/portage")
+ if retval!=0:
+ raise CatalystError,"Could not clean up Portage tree."
+ retval=os.system("rm -rf "+self.settings["chroot_path"]+"/var/tmp/*")
if retval!=0:
raise CatalystError,"Could not clean up Portage tree."
retval=os.system(self.settings["storedir"]+"/targets/"+self.settings["target"]+"/"+self.settings["target"]+".sh clean")
# 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/Attic/stage3.sh,v 1.3 2003/10/29 06:52:15 drobbins Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage3/Attic/stage3.sh,v 1.4 2003/10/29 08:03:00 drobbins Exp $
case $1 in
enter)
source /etc/profile
if [ -n "${clst_CCACHE}" ]
then
- emerge -C ccache || exit 1
+ emerge -C dev-util/ccache || exit 1
fi
EOF
[ $? -ne 0 ] && exit 1
exit 1
;;
esac
+exit 0