summaryrefslogtreecommitdiffstats
path: root/pym/portage_news.py
diff options
context:
space:
mode:
authorAlec Warner <antarus@gentoo.org>2007-01-18 06:59:50 +0000
committerAlec Warner <antarus@gentoo.org>2007-01-18 06:59:50 +0000
commit75252713bd394c7958a71535a655827d8b6168ae (patch)
treec1b0e328408708ff3177f048c89c80442cee15dd /pym/portage_news.py
parente3daff129e4d688856b1a764a1ee25dd1326d974 (diff)
downloadportage-75252713bd394c7958a71535a655827d8b6168ae.tar.gz
portage-75252713bd394c7958a71535a655827d8b6168ae.tar.bz2
portage-75252713bd394c7958a71535a655827d8b6168ae.zip
lock file around chown/chmod
svn path=/main/trunk/; revision=5700
Diffstat (limited to 'pym/portage_news.py')
-rw-r--r--pym/portage_news.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/pym/portage_news.py b/pym/portage_news.py
index a0cb885ae..bd2a40789 100644
--- a/pym/portage_news.py
+++ b/pym/portage_news.py
@@ -114,11 +114,14 @@ class NewsManager(object):
unreadfile = os.path.join( self.UNREAD_PATH, "news-"+ repoid +".unread" )
# Set correct permissions on the news-repoid.unread file
try:
- apply_permissions( filename=unreadfile,
+ lock = lockfile(unreadfile)
+ apply_permissions( filename=unreadfile,
uid=self.config["PORTAGE_INST_UID"], gid=portage_gid, mode=664 )
except FileNotFound:
pass # It may not exist yet, thats ok.
-
+ finally:
+ if lock:
+ unlockfile(lock)
if update:
self.updateItems( repoid )