From: Zac Medico Date: Sat, 16 Jun 2007 21:19:11 +0000 (-0000) Subject: Fix profile and config arguments to NewsItem.isRelevant() inside NewsManager.updateIt... X-Git-Tag: v2.2_pre1~1230 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8b9b85e61ce218ba8ef6cf44b5509cc743ca1a07;p=portage.git Fix profile and config arguments to NewsItem.isRelevant() inside NewsManager.updateItems(). svn path=/main/trunk/; revision=6862 --- diff --git a/pym/portage/news.py b/pym/portage/news.py index 028805876..d8df8c294 100644 --- a/pym/portage/news.py +++ b/pym/portage/news.py @@ -36,6 +36,15 @@ class NewsManager(object): self.vdb = vardb self.portdb = portdb + portdir = portdb.porttree_root + profiles_base = os.path.join(portdir, "profiles") + os.path.sep + from portage.util import normalize_path + profile_path = normalize_path( + os.path.realpath(portdb.mysettings.profile_path)) + if profile_path.startswith(profiles_base): + profile_path = profile_path[len(profiles_base):] + self._profile_path = profile_path + # Ensure that the unread path exists and is writable. dirmode = 02070 modemask = 02 @@ -76,7 +85,8 @@ class NewsManager(object): item = NewsItem(filename, itemid, timestamp) except (TypeError, ValueError), e: continue - if item.isRelevant(profile=os.readlink(PROFILE_PATH), config=config, vardb=self.vdb): + if item.isRelevant(profile=self._profile_path, + config=self.config, vardb=self.vdb): updates.append(item) del path