From: fuzzyray Date: Tue, 2 Jan 2007 20:57:36 +0000 (-0000) Subject: Fix get_provide() method to also work for uninstalled packages X-Git-Tag: gentoolkit-0.2.4.3~181 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8bd4fa191a8e607cdc4eec90693af09b5ae57bb1;p=gentoolkit.git Fix get_provide() method to also work for uninstalled packages svn path=/; revision=332 --- diff --git a/trunk/src/gentoolkit/package.py b/trunk/src/gentoolkit/package.py index d583c8a..87fef28 100644 --- a/trunk/src/gentoolkit/package.py +++ b/trunk/src/gentoolkit/package.py @@ -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"""