From: Alec Warner Date: Thu, 18 Jan 2007 06:59:50 +0000 (-0000) Subject: lock file around chown/chmod X-Git-Tag: v2.1.2-r3~31 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=75252713bd394c7958a71535a655827d8b6168ae;p=portage.git lock file around chown/chmod svn path=/main/trunk/; revision=5700 --- 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 )