# Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
# $Id: $
+ 25 Nov 2007; Andrew Gaffney <agaffney@gentoo.org> catalyst,
+ files/catalyst.conf, modules/generic_stage_target.py:
+ add option for metadata_overlay use with portage
+
25 Nov 2007; Andrew Gaffney <agaffney@gentoo.org>
modules/stage1_target.py, modules/stage2_target.py,
modules/stage3_target.py:
print "Snapshot cache support enabled."
conf_values["SNAPCACHE"]="1"
+ if "metadata_overlay" in conf_values["options"].split():
+ print "Use of metadata_overlay module for portage enabled."
+ conf_values["METADATA_OVERLAY"]="1"
+
# if "tarball" in string.split(conf_values["options"]):
# print "Tarball creation enabled."
# conf_values["TARBALL"]="1"
# build stops in livecd-stage2)
# pkgcache = keeps a tbz2 of every built package (useful if your build stops
# prematurely)
+# metadata_overlay = enabled the metadata_overlay cache module in portage, which
+# uses the in-tree metadata
# seedcache = use the build output of a previous target if it exists to speed up
# the copy
# snapcache = cache the snapshot so that it can be bind-mounted into the chroot.
# your cache. The cache is unlinked before any empty or rm processing, though.
#
# (These options can be used together)
-options="autoresume kerncache pkgcache seedcache snapcache"
+options="autoresume kerncache pkgcache seedcache snapcache metadata_overlay"
# portdir specifies the source portage tree used by the snapshot target.
portdir="/usr/portage"
cmd("cp "+self.settings["ENVSCRIPT"]+" "+self.settings["chroot_path"]+"/tmp/envscript",\
"Could not copy envscript into place.",env=self.env)
+ # Setup metadata_overlay
+ if self.settings.has_key("METADATA_OVERLAY") and not self.settings.has_key("portage_confdir"):
+ if not os.path.exists(self.settings["chroot_path"] + "/etc/portage"):
+ cmd("mkdir " + self.settings["chroot_path"] + "/etc/portage")
+ myf = open(self.settings["chroot_path"] + "/etc/portage/modules", "a")
+ myf.write("portdbapi.auxdbmodule = cache.metadata_overlay.database\n")
+ myf.close()
+
# Copy over /etc/hosts from the host in case there are any
# specialties in there
if os.path.exists(self.settings["chroot_path"]+"/etc/hosts"):
if self.settings.has_key("portage_overlay"):
# myf.write('PORTDIR_OVERLAY="'+string.join(self.settings["portage_overlay"])+'"\n')
myf.write('PORTDIR_OVERLAY="/usr/local/portage"\n')
-
+
myf.close()
touch(self.settings["autoresume_path"]+"chroot_setup")