summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-02-09 01:10:08 +0000
committerZac Medico <zmedico@gentoo.org>2006-02-09 01:10:08 +0000
commitcbc38717d510b106a27dabeec517111fcd54a5b0 (patch)
treeafcc0a31a47f6d1bff7a498cae929540559c7ce7 /bin
parente390bbaa28903e6d3f6faca15bb4ff9714a889ee (diff)
downloadportage-cbc38717d510b106a27dabeec517111fcd54a5b0.tar.gz
portage-cbc38717d510b106a27dabeec517111fcd54a5b0.tar.bz2
portage-cbc38717d510b106a27dabeec517111fcd54a5b0.zip
use new write_atomic() function for all world file updates
svn path=/main/trunk/; revision=2681
Diffstat (limited to 'bin')
-rwxr-xr-xbin/emaint2
-rwxr-xr-xbin/emerge4
-rwxr-xr-xbin/regenworld4
3 files changed, 4 insertions, 6 deletions
diff --git a/bin/emaint b/bin/emaint
index 6f9977dee..e6d11fc15 100755
--- a/bin/emaint
+++ b/bin/emaint
@@ -40,7 +40,7 @@ class WorldHandler(object):
def fix(self):
errors = []
try:
- open(portage_const.WORLD_FILE, "w").write("\n".join(self.okay))
+ portage.write_atomic(portage_const.WORLD_FILE,"\n".join(self.okay))
except OSError:
errors.append(portage_const.WORLD_FILE + " could not be opened for writing")
return errors
diff --git a/bin/emerge b/bin/emerge
index 716068a24..795092e34 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -1916,7 +1916,7 @@ class depgraph:
myfavdict[myfavkey]=myfavkey
print ">>> Recording",myfavkey,"in \"world\" favorites file..."
if not "--fetchonly" in myopts:
- portage.writedict(myfavdict,portage.root+portage.WORLD_FILE,writekey=0)
+ portage.write_atomic(os.path.join(portage.root,portage.WORLD_FILE),"\n".join(myfavdict.values()))
portage.mtimedb["resume"]["mergelist"]=mymergelist[:]
@@ -2087,7 +2087,7 @@ class depgraph:
myfavdict[myfavkey]=myfavkey
print ">>> Recording",myfavkey,"in \"world\" favorites file..."
emergelog(" === ("+str(mergecount)+" of "+str(len(mymergelist))+") Updating world file ("+x[pkgindex]+")")
- portage.writedict(myfavdict,myroot+portage.WORLD_FILE,writekey=0)
+ portage.write_atomic(os.path.join(myroot,portage.WORLD_FILE),"\n".join(myfavdict.values()))
if ("noclean" not in portage.features) and (x[0] != "binary"):
short_msg = "emerge: ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" Clean Post"
diff --git a/bin/regenworld b/bin/regenworld
index 14ec51d5c..8723d7f20 100755
--- a/bin/regenworld
+++ b/bin/regenworld
@@ -88,6 +88,4 @@ for mykey in biglist:
print "add to world:",myfavkey
worldlist.append(myfavkey)
-myfile=open(portage.WORLD_FILE, "w")
-myfile.write(string.join(worldlist, '\n')+'\n')
-myfile.close()
+portage.write_atomic(portage.WORLD_FILE,"\n".join(worldlist))