summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Mauch <genone@gentoo.org>2007-05-31 00:22:06 +0000
committerMarius Mauch <genone@gentoo.org>2007-05-31 00:22:06 +0000
commit3d0a0dbd105c9346b6dc3ac1205f00453c2e7b51 (patch)
tree575bcef49079cde0bfbc410770c7f1f231797344
parentd2f49c205c63d98a38113a13d479f2ed2965b843 (diff)
downloadportage-3d0a0dbd105c9346b6dc3ac1205f00453c2e7b51.tar.gz
portage-3d0a0dbd105c9346b6dc3ac1205f00453c2e7b51.tar.bz2
portage-3d0a0dbd105c9346b6dc3ac1205f00453c2e7b51.zip
remove pointless $PORTDIR lock
svn path=/main/trunk/; revision=6682
-rw-r--r--pym/portage/news.py42
1 files changed, 16 insertions, 26 deletions
diff --git a/pym/portage/news.py b/pym/portage/news.py
index 327fe15f4..3cfb5de12 100644
--- a/pym/portage/news.py
+++ b/pym/portage/news.py
@@ -64,32 +64,22 @@ class NewsManager(object):
timestamp = 0
path = os.path.join(self.portdb.getRepositoryPath(repoid), self.NEWS_PATH)
- newsdir_lock = None
- try:
- repo_path = self.portdb.getRepositoryPath(repoid)
- if os.access(os.path.dirname(repo_path), os.W_OK):
- # This lock file should really be mapped into /var somewhere
- # since the repo_path or it's parent directory may not even be
- # writable.
- newsdir_lock = lockdir(repo_path)
- # Skip reading news for repoid if the news dir does not exist. Requested by
- # NightMorph :)
- if not os.path.exists(path):
- return None
- news = os.listdir(path)
- updates = []
- for itemid in news:
- try:
- filename = os.path.join(path, itemid, itemid + "." + self.LANGUAGE_ID + ".txt")
- item = NewsItem(filename, itemid, timestamp)
- except (TypeError, ValueError), e:
- continue
- if item.isRelevant(profile=os.readlink(PROFILE_PATH), config=config, vardb=self.vdb):
- updates.append(item)
- finally:
- if newsdir_lock:
- unlockdir(newsdir_lock)
-
+
+ repo_path = self.portdb.getRepositoryPath(repoid)
+ # Skip reading news for repoid if the news dir does not exist. Requested by
+ # NightMorph :)
+ if not os.path.exists(path):
+ return None
+ news = os.listdir(path)
+ updates = []
+ for itemid in news:
+ try:
+ filename = os.path.join(path, itemid, itemid + "." + self.LANGUAGE_ID + ".txt")
+ item = NewsItem(filename, itemid, timestamp)
+ except (TypeError, ValueError), e:
+ continue
+ if item.isRelevant(profile=os.readlink(PROFILE_PATH), config=config, vardb=self.vdb):
+ updates.append(item)
del path
path = os.path.join(self.UNREAD_PATH, "news-"+repoid+".unread")