From 75252713bd394c7958a71535a655827d8b6168ae Mon Sep 17 00:00:00 2001 From: Alec Warner Date: Thu, 18 Jan 2007 06:59:50 +0000 Subject: [PATCH] lock file around chown/chmod svn path=/main/trunk/; revision=5700 --- pym/portage_news.py | 7 +++++-- 1 file 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 ) -- 2.26.2