Merged from trunk -r13331:13335
authorFabian Groffen <grobian@gentoo.org>
Sun, 12 Apr 2009 19:03:00 +0000 (19:03 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sun, 12 Apr 2009 19:03:00 +0000 (19:03 -0000)
   | 13333   | Add a LibraryFileConsumerSet class that can be used to       |
   | zmedico | rebuild all packages that consume one or more given files.   |
   |         | Note: This does not detect libtool archive (*.la) files that |
   |         | consume the specified files (revdep-rebuild is able to       |
   |         | detect them).                                                |

   | 13334   | Add a note about dlopen and libtool archives in the          |
   | zmedico | LinkageMap.findConsumers() docstring.                        |

   | 13335   | Ensure that the correct PORTDIR setting is passed into the   |
   | zmedico | profile-specific config constructors.                        |

svn path=/main/branches/prefix/; revision=13338

bin/repoman
pym/portage/dbapi/vartree.py
pym/portage/sets/libs.py

index 5bc12b788451fc0d696416fdf2d10f11a17df982..78cd058c89b484ec70cb05bc8e134c61cdb17820 100755 (executable)
@@ -501,6 +501,7 @@ portdir = portdb.porttrees[0]
 # Generate an appropriate PORTDIR_OVERLAY value for passing into the
 # profile-specific config constructor calls.
 env = os.environ.copy()
+env['PORTDIR'] = portdir
 env['PORTDIR_OVERLAY'] = ' '.join(portdb.porttrees[1:])
 
 logging.info('Setting paths:')
index 28fc92c36624b5e31aa655b411eb84b34b6afa43..006a58c67650d799ce5fb84e708de38a45dc53e6 100644 (file)
@@ -642,6 +642,11 @@ class LinkageMap(object):
                fail to preserve binutils libs that are needed by these unrecognized
                consumers.
 
+               Note that library consumption via dlopen (common for kde plugins) is
+               currently undetected. However, it is possible to use the
+               corresponding libtool archive (*.la) files to detect such consumers
+               (revdep-rebuild is able to detect them).
+
                @param obj: absolute path to an object or a key from _obj_properties
                @type obj: string (example: '/usr/bin/bar') or _ObjectKey
                @rtype: set of strings (example: set(['/bin/foo', '/usr/bin/bar']))
index 3722c846257cf11df1bad58a3a10a2a48620e74e..1c5067ebc3933588c0041f05788ae30da978ecfd 100644 (file)
@@ -22,6 +22,39 @@ class LibraryConsumerSet(PackageSet):
                        rValue.add("%s/%s:%s" % (cat, pn, slot))
                return rValue
 
+class LibraryFileConsumerSet(LibraryConsumerSet):
+
+       """
+       Note: This does not detect libtool archive (*.la) files that consume the
+       specified files (revdep-rebuild is able to detect them).
+       """
+
+       description = "Package set which contains all packages " + \
+               "that consume the specified library file(s)."
+
+       def __init__(self, vardbapi, files, **kargs):
+               super(LibraryFileConsumerSet, self).__init__(vardbapi, **kargs)
+               self.files = files
+
+       def load(self):
+               consumers = set()
+               for lib in self.files:
+                       consumers.update(self.dbapi.linkmap.findConsumers(lib))
+
+               if not consumers:
+                       return
+               self._setAtoms(self.mapPathsToAtoms(consumers))
+
+       def singleBuilder(cls, options, settings, trees):
+               import shlex
+               files = tuple(shlex.split(options.get("files", "")))
+               if not files:
+                       raise SetConfigError("no files given")
+               debug = get_boolean(options, "debug", False)
+               return LibraryFileConsumerSet(trees["vartree"].dbapi,
+                       files, debug=debug)
+       singleBuilder = classmethod(singleBuilder)
+
 class PreservedLibraryConsumerSet(LibraryConsumerSet):
        def load(self):
                reg = self.dbapi.plib_registry
@@ -48,5 +81,6 @@ class PreservedLibraryConsumerSet(LibraryConsumerSet):
 
        def singleBuilder(cls, options, settings, trees):
                debug = get_boolean(options, "debug", False)
-               return PreservedLibraryConsumerSet(trees["vartree"].dbapi, debug)
+               return PreservedLibraryConsumerSet(trees["vartree"].dbapi,
+                       debug=debug)
        singleBuilder = classmethod(singleBuilder)