summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 )