def fix(self):
errors = []
try:
- portage.write_atomic(self.world_file, "\n".join(self.okay))
+ portage.write_atomic(self.world_file,
+ "\n".join(sorted(self.okay)) + "\n")
except portage_exception.PortageException:
errors.append(self.world_file + " could not be opened for writing")
return errors
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={}
"--pretend" in self.myopts):
portage.write_atomic(
os.path.join(self.target_root, portage.WORLD_FILE),
- "\n".join(myfavdict.values()))
+ "\n".join(sorted(myfavdict.values())) + "\n")
mtimedb["resume"]["mergelist"]=mymergelist[:]
mtimedb.commit()
") 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 \
print "add to world:",myfavkey
worldlist.append(myfavkey)
-portage.write_atomic(os.path.join("/", portage.WORLD_FILE), "\n".join(worldlist))
+portage.write_atomic(os.path.join("/", portage.WORLD_FILE),
+ "\n".join(sorted(worldlist)) + "\n")
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)