From eab2719aa5dbf539b3525bd576dc3ae7b72fcea8 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 12 Feb 2006 23:43:40 +0000 Subject: use write_atomic for move_ent CATEGORY updates svn path=/main/trunk/; revision=2701 --- pym/portage.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'pym/portage.py') 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: -- cgit v1.2.3-1-g7c22