summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-02-09 04:25:56 +0000
committerZac Medico <zmedico@gentoo.org>2006-02-09 04:25:56 +0000
commitd10752fe04b87affd5886f205ab817cb54513257 (patch)
tree350870d2af9c8c46ccc9981aef91fb88bddf86b2
parent1d32856c808e1b52ff762efe24955e4d865293b6 (diff)
downloadportage-d10752fe04b87affd5886f205ab817cb54513257.tar.gz
portage-d10752fe04b87affd5886f205ab817cb54513257.tar.bz2
portage-d10752fe04b87affd5886f205ab817cb54513257.zip
use write_atomic for the counter file
svn path=/main/trunk/; revision=2686
-rw-r--r--pym/portage.py7
1 files changed, 1 insertions, 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):