Bug #270040 - Make repoman parse the categories file from the overlay.
authorZac Medico <zmedico@gentoo.org>
Wed, 22 Jul 2009 18:26:52 +0000 (18:26 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 22 Jul 2009 18:26:52 +0000 (18:26 -0000)
svn path=/main/trunk/; revision=13850

bin/repoman
pym/portage/dbapi/porttree.py

index c8f32f4a4b56360f694fb350a2c722dcf79df5d8..97f24ccd2598e581ad86d7e3fb6289bc3a10c77d 100755 (executable)
@@ -513,6 +513,14 @@ logging.info('Setting paths:')
 logging.info('PORTDIR = "' + portdir + '"')
 logging.info('PORTDIR_OVERLAY = "%s"' % env['PORTDIR_OVERLAY'])
 
+categories = []
+for path in set([portdir, portdir_overlay]):
+       categories.extend(portage.util.grabfile(
+               os.path.join(path, 'profiles', 'categories')))
+repoman_settings.categories = tuple(sorted(
+       portage.util.stack_lists([categories], incremental=1)))
+del categories
+
 portdb.mysettings = repoman_settings
 root_config = RootConfig(repoman_settings, trees[root], None)
 # We really only need to cache the metadata that's necessary for visibility
index 1fd5938113adb539d0d4ff7e507f0b0101c9fe88..9f427a14825c8d3df19f44e8fcc3c246931e964e 100644 (file)
@@ -124,6 +124,10 @@ class portdbapi(dbapi):
                "Define self.settings as an alias for self.mysettings, " + \
                "for conformity with other dbapi classes.")
 
+       @property
+       def _categories(self):
+               return self.settings.categories
+
        def __init__(self, porttree_root, mysettings=None):
                portdbapi.portdbapi_instances.append(self)
 
@@ -133,7 +137,7 @@ class portdbapi(dbapi):
                else:
                        from portage import settings
                        self.mysettings = config(clone=settings)
-               self._categories = self.mysettings.categories
+
                # This is strictly for use in aux_get() doebuild calls when metadata
                # is generated by the depend phase.  It's safest to use a clone for
                # this purpose because doebuild makes many changes to the config