From e5a9d1502282ac8d53239f9278cbfbaf531358c8 Mon Sep 17 00:00:00 2001 From: Marius Mauch Date: Sat, 23 Jun 2007 16:29:05 +0000 Subject: sort the world file before writing it and ensure that it's terminated by a newline svn path=/main/trunk/; revision=6976 --- pym/emerge/__init__.py | 8 +++++--- pym/portage/update.py | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py index 55e3be5ba..c086c7901 100644 --- a/pym/emerge/__init__.py +++ b/pym/emerge/__init__.py @@ -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 \ diff --git a/pym/portage/update.py b/pym/portage/update.py index 34c91224b..5c53f57bc 100644 --- a/pym/portage/update.py +++ b/pym/portage/update.py @@ -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) -- cgit v1.2.3-1-g7c22