From: Zac Medico Date: Sat, 19 May 2007 07:56:24 +0000 (-0000) Subject: Avoid permission errors when trying to lock repo_path. Note that the lock file shoul... X-Git-Tag: v2.2_pre1~1410 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e4510e633c9bcf26f6c82606f852927728cf8386;p=portage.git Avoid permission errors when trying to lock repo_path. Note that the lock file should be mapped into /var somewhere. svn path=/main/trunk/; revision=6555 --- diff --git a/pym/portage/news.py b/pym/portage/news.py index 0bb12c5ed..327fe15f4 100644 --- a/pym/portage/news.py +++ b/pym/portage/news.py @@ -66,7 +66,12 @@ class NewsManager(object): path = os.path.join(self.portdb.getRepositoryPath(repoid), self.NEWS_PATH) newsdir_lock = None try: - newsdir_lock = lockdir(self.portdb.getRepositoryPath(repoid)) + 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):