add option for metadata_overlay use with portage
authorAndrew Gaffney <agaffney@gentoo.org>
Sun, 25 Nov 2007 03:31:42 +0000 (03:31 +0000)
committerAndrew Gaffney <agaffney@gentoo.org>
Sun, 25 Nov 2007 03:31:42 +0000 (03:31 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@1262 d1e1f19c-881f-0410-ab34-b69fee027534

ChangeLog
catalyst
files/catalyst.conf
modules/generic_stage_target.py

index 1d7e1291610976ccbc607d2a389a4eb0be2a4784..de55ee246f2aed14f31a5c1b3a559c3d43f12014 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,10 @@
 # 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:
index 819e7558db26655ecc316a3f39afb7e84bdfed93..e53569558f9610ff44b5a2a4ddc3ddcdc7762e6b 100755 (executable)
--- a/catalyst
+++ b/catalyst
@@ -133,6 +133,10 @@ def parse_config(myconfig):
                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"
index 4dfd3cf83398f72156e004249fab9b90d339891d..909e0d7b144867e32407681e29f7b391a7e52e8b 100644 (file)
@@ -38,6 +38,8 @@ hash_function="crc32"
 #      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.
@@ -45,7 +47,7 @@ hash_function="crc32"
 #      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"
index 32315840e3dd85ebe55b830fa0e4a37965349f1c..f57443a92709fc207e802b8b698b135cac55c2c7 100644 (file)
@@ -865,6 +865,14 @@ class generic_stage_target(generic_target):
                                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"):
@@ -909,7 +917,7 @@ class generic_stage_target(generic_target):
                        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")