From: Marius Mauch Date: Thu, 31 May 2007 00:22:06 +0000 (-0000) Subject: remove pointless $PORTDIR lock X-Git-Tag: v2.2_pre1~1333 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3d0a0dbd105c9346b6dc3ac1205f00453c2e7b51;p=portage.git remove pointless $PORTDIR lock svn path=/main/trunk/; revision=6682 --- 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")