summaryrefslogtreecommitdiffstats
path: root/pym/portage/news.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-06-16 21:19:11 +0000
committerZac Medico <zmedico@gentoo.org>2007-06-16 21:19:11 +0000
commit8b9b85e61ce218ba8ef6cf44b5509cc743ca1a07 (patch)
tree438d088ffe9371d7ac21ac33031578de09a31055 /pym/portage/news.py
parent7952a52ad798e5e6130d739501683b6df236a5e4 (diff)
downloadportage-8b9b85e61ce218ba8ef6cf44b5509cc743ca1a07.tar.gz
portage-8b9b85e61ce218ba8ef6cf44b5509cc743ca1a07.tar.bz2
portage-8b9b85e61ce218ba8ef6cf44b5509cc743ca1a07.zip
Fix profile and config arguments to NewsItem.isRelevant() inside NewsManager.updateItems().
svn path=/main/trunk/; revision=6862
Diffstat (limited to 'pym/portage/news.py')
-rw-r--r--pym/portage/news.py12
1 files changed, 11 insertions, 1 deletions
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