Use write_atomic() for manifest updates. (trunk r10016)
authorZac Medico <zmedico@gentoo.org>
Mon, 28 Apr 2008 02:34:44 +0000 (02:34 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 28 Apr 2008 02:34:44 +0000 (02:34 -0000)
svn path=/main/branches/2.1.2/; revision=10017

pym/portage_manifest.py

index 84189e1a543b30b9ca19bc0ecf871ccd4d3cfede..95ce1efd44d9dd99bd5793cd1d75cdbc393ebd66 100644 (file)
@@ -385,10 +385,8 @@ class Manifest(object):
                                        else:
                                                raise
                        if update_manifest:
-                               fd = open(self.getFullname(), "w")
-                               for myentry in myentries:
-                                       fd.write("%s\n" % str(myentry))
-                               fd.close()
+                               write_atomic(self.getFullname(),
+                                       "".join("%s\n" % str(myentry) for myentry in myentries))
                        if sign:
                                self.sign()
                except (IOError, OSError), e: