From 8b9b85e61ce218ba8ef6cf44b5509cc743ca1a07 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 16 Jun 2007 21:19:11 +0000 Subject: Fix profile and config arguments to NewsItem.isRelevant() inside NewsManager.updateItems(). svn path=/main/trunk/; revision=6862 --- pym/portage/news.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'pym/portage/news.py') 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 -- cgit v1.2.3-1-g7c22