diff options
author | Marius Mauch <genone@gentoo.org> | 2007-06-23 16:29:05 +0000 |
---|---|---|
committer | Marius Mauch <genone@gentoo.org> | 2007-06-23 16:29:05 +0000 |
commit | e5a9d1502282ac8d53239f9278cbfbaf531358c8 (patch) | |
tree | d2c0c6899f00d41ce9de0e0f82846ad20b938e99 | |
parent | e7b4a43587adc4da8761adf88b05e1238303331a (diff) | |
download | portage-e5a9d1502282ac8d53239f9278cbfbaf531358c8.tar.gz portage-e5a9d1502282ac8d53239f9278cbfbaf531358c8.tar.bz2 portage-e5a9d1502282ac8d53239f9278cbfbaf531358c8.zip |
sort the world file before writing it and ensure that it's terminated by a newline
svn path=/main/trunk/; revision=6976
-rw-r--r-- | pym/emerge/__init__.py | 8 | ||||
-rw-r--r-- | 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) |