Use write_atomic for dblink metadata updates.
authorZac Medico <zmedico@gentoo.org>
Sun, 9 Jul 2006 20:34:55 +0000 (20:34 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 9 Jul 2006 20:34:55 +0000 (20:34 -0000)
svn path=/main/trunk/; revision=3824

pym/portage.py

index 80358d4ed4fa358b0e8fa76a83cacaa64d912eff..1372ecb4ec84d7f6174c04d2c6ad531abf33bdbc 100644 (file)
@@ -6737,9 +6737,7 @@ class dblink:
                return mydata
 
        def setfile(self,fname,data):
-               myfile=open(self.dbdir+"/"+fname,"w")
-               myfile.write(data)
-               myfile.close()
+               write_atomic(os.path.join(self.dbdir, fname), data)
 
        def getelements(self,ename):
                if not os.path.exists(self.dbdir+"/"+ename):