sort the world file before writing it and ensure that it's terminated by a newline
authorMarius Mauch <genone@gentoo.org>
Sat, 23 Jun 2007 16:29:05 +0000 (16:29 -0000)
committerMarius Mauch <genone@gentoo.org>
Sat, 23 Jun 2007 16:29:05 +0000 (16:29 -0000)
svn path=/main/trunk/; revision=6976

pym/emerge/__init__.py
pym/portage/update.py

index 55e3be5ba163e4813d2fd3cdf96e4c68bb2b1eee..c086c7901c570da97431a9c37a8bd6dd0dde5bf6 100644 (file)
@@ -586,10 +586,12 @@ def clean_world(vardb, cpv):
                else:
                        #this doesn't match the package we're unmerging; keep it.
                        newworldlist.append(x)
-
+       
+       newworldlist.sort()
+       
        portage.util.ensure_dirs(os.path.join(vardb.root, portage.PRIVATE_PATH),
                gid=portage.portage_gid, mode=02770)
-       portage.util.write_atomic(world_filename, "\n".join(newworldlist))
+       portage.util.write_atomic(world_filename, "\n".join(newworldlist)+"\n")
 
 def genericdict(mylist):
        mynewdict={}
@@ -3339,7 +3341,7 @@ class MergeTask(object):
                                                        ") Updating world file ("+x[pkgindex]+")")
                                                portage.write_atomic(
                                                os.path.join(myroot, portage.WORLD_FILE),
-                                               "\n".join(myfavdict.values()))
+                                               "\n".join(sorted(myfavdict.values()))+"\n")
 
                                if "--pretend" not in self.myopts and \
                                        "--fetchonly" not in self.myopts and \
index 34c91224bb72ff255e28a01c64ee49ea49f8ac7f..5c53f57bcf0758089da9b44694302b72f3b2d08b 100644 (file)
@@ -202,7 +202,8 @@ def update_config_files(config_root, protect, protect_mask, update_iter):
                                                sys.stdout.write("p")
                                                sys.stdout.flush()
 
-       write_atomic(os.path.join(config_root, WORLD_FILE), "\n".join(worldlist))
+       worldlist.sort()
+       write_atomic(os.path.join(config_root, WORLD_FILE), "\n".join(worldlist)+"\n")
 
        protect_obj = ConfigProtect(
                config_root, protect, protect_mask)