From d10752fe04b87affd5886f205ab817cb54513257 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 9 Feb 2006 04:25:56 +0000 Subject: use write_atomic for the counter file svn path=/main/trunk/; revision=2686 --- pym/portage.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pym/portage.py b/pym/portage.py index 339cd2e42..dd7775a5d 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -4142,12 +4142,7 @@ class dbapi: #increment counter counter += 1 # update new global counter file - newcpath=cpath+".new" - newcfile=open(newcpath,"w") - newcfile.write(str(counter)) - newcfile.close() - # now move global counter file into place - os.rename(newcpath,cpath) + write_atomic(cpath, str(counter)) return counter def invalidentry(self, mypath): -- cgit v1.2.3-1-g7c22