From: fuzzyray Date: Fri, 9 Jan 2009 04:20:48 +0000 (-0000) Subject: Fix package.py to account for PORTDIR being a symbolic link when checking if a packag... X-Git-Tag: gentoolkit-0.2.4.3^2~19 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=af6e0bc6b606d21fb212765fe34bad45ac41cd7e;p=gentoolkit.git Fix package.py to account for PORTDIR being a symbolic link when checking if a package is in an overlay. (Bug #253968) svn path=/; revision=537 --- diff --git a/trunk/ChangeLog b/trunk/ChangeLog index f9605ad..42415d4 100644 --- a/trunk/ChangeLog +++ b/trunk/ChangeLog @@ -1,3 +1,7 @@ +2009-01-08: Paul Varner + * equery: Fix package.py to account for PORTDIR being a symbolic link + when checking if a package is in an overlay. (Bug #253968) + 2008-11-25: Paul Varner * revdep-rebuild: Fixes for non-linux Gentoo systems. Add patch from igli to fix find command to comply with POSIX. Change awk calls to diff --git a/trunk/src/gentoolkit/package.py b/trunk/src/gentoolkit/package.py index 3319860..6f525ad 100644 --- a/trunk/src/gentoolkit/package.py +++ b/trunk/src/gentoolkit/package.py @@ -7,6 +7,7 @@ # # $Header$ +import os from errors import FatalError import portage from gentoolkit import * @@ -25,6 +26,9 @@ class Package: self._db = None self._settings = settings self._settingslock = settingslock + self._portdir_path = settings["PORTDIR"] + if os.path.islink(self._portdir_path): + self._portdir_path = os.path.join(os.path.dirname(self._portdir_path), os.readlink(self._portdir_path)) def get_name(self): """Returns base name of package, no category nor version""" @@ -151,7 +155,7 @@ class Package: def is_overlay(self): """Returns true if the package is in an overlay.""" dir,ovl = portage.portdb.findname2(self._cpv) - return ovl != settings["PORTDIR"] + return ovl != self._portdir_path def is_masked(self): """Returns true if this package is masked against installation. Note: We blindly assume that