Fix get_provide() method to also work for uninstalled packages
authorfuzzyray <fuzzyray@gentoo.org>
Tue, 2 Jan 2007 20:57:36 +0000 (20:57 -0000)
committerfuzzyray <fuzzyray@gentoo.org>
Tue, 2 Jan 2007 20:57:36 +0000 (20:57 -0000)
svn path=/; revision=332

trunk/src/gentoolkit/package.py

index d583c8a51ed13689a46280aaaaa9842525aceeac..87fef28981a7bfd3a427a50621fc2c0979a30978 100644 (file)
@@ -56,7 +56,14 @@ class Package:
 
        def get_provide(self):
                """Return a list of provides, if any"""
-               return vartree.get_provide(self._cpv)
+               if not self.is_installed():
+                       try:
+                               x = [self.get_env_var('PROVIDE')]
+                       except KeyError:
+                               x = []
+                       return x
+               else:
+                       return vartree.get_provide(self._cpv)
 
        def get_dependants(self):
                """Retrieves a list of CPVs for all packages depending on this one"""