summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-02-12 23:43:40 +0000
committerZac Medico <zmedico@gentoo.org>2006-02-12 23:43:40 +0000
commiteab2719aa5dbf539b3525bd576dc3ae7b72fcea8 (patch)
tree856335f06a1a5141868f5b6f9a4ddd24d9afc563
parentc0d04cb8dd9020c1c0414a700f31ffe8279aef6c (diff)
downloadportage-eab2719aa5dbf539b3525bd576dc3ae7b72fcea8.tar.gz
portage-eab2719aa5dbf539b3525bd576dc3ae7b72fcea8.tar.bz2
portage-eab2719aa5dbf539b3525bd576dc3ae7b72fcea8.zip
use write_atomic for move_ent CATEGORY updates
svn path=/main/trunk/; revision=2701
-rw-r--r--pym/portage.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/pym/portage.py b/pym/portage.py
index aa0d3d5c2..650e831f5 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -4357,9 +4357,7 @@ class vardbapi(dbapi):
if os.path.exists(old_eb_path+".ebuild"):
os.rename(old_eb_path+".ebuild", new_eb_path+".ebuild")
- catfile=open(newpath+"/CATEGORY", "w")
- catfile.write(mynewcat+"\n")
- catfile.close()
+ write_atomic(os.path.join(newpath, "CATEGORY"), mynewcat+"\n")
dbdir = self.root+VDB_PATH
for catdir in listdir(dbdir):
@@ -5296,9 +5294,7 @@ class binarytree(packagetree):
fixdbentries(origcp, newcp, mytmpdir)
- catfile=open(mytmpdir+"/CATEGORY", "w")
- catfile.write(mynewcat+"\n")
- catfile.close()
+ write_atomic(os.path.join(mytmpdir, "CATEGORY"), mynewcat+"\n")
try:
os.rename(mytmpdir+"/"+string.split(mycpv,"/")[1]+".ebuild", mytmpdir+"/"+string.split(mynewcpv, "/")[1]+".ebuild")
except SystemExit, e: