From: Zac Medico Date: Sun, 5 Mar 2006 00:10:40 +0000 (-0000) Subject: Strip the leading slash from WORLD_FILE so that os.path.join works correctly for... X-Git-Tag: v2.1_pre6~33 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0b93a666b7d09d709a563d9ef76637ef7bbcd444;p=portage.git Strip the leading slash from WORLD_FILE so that os.path.join works correctly for bug #124471. Thanks to Thomas de Grenier de Latour for finding the cause of the problem and Jonathan Adamczewski for the initial report. svn path=/main/trunk/; revision=2812 --- diff --git a/bin/emerge b/bin/emerge index f13a95c1e..4afe24432 100755 --- a/bin/emerge +++ b/bin/emerge @@ -1861,7 +1861,9 @@ class depgraph: myfavdict[myfavkey]=myfavkey print ">>> Recording",myfavkey,"in \"world\" favorites file..." if not "--fetchonly" in myopts: - portage.write_atomic(os.path.join(portage.root,portage.WORLD_FILE),"\n".join(myfavdict.values())) + portage.write_atomic( + os.path.join(portage.root, portage.WORLD_FILE.lstrip(os.sep)), + "\n".join(myfavdict.values())) portage.mtimedb["resume"]["mergelist"]=mymergelist[:] @@ -2032,7 +2034,9 @@ class depgraph: myfavdict[myfavkey]=myfavkey print ">>> Recording",myfavkey,"in \"world\" favorites file..." emergelog(" === ("+str(mergecount)+" of "+str(len(mymergelist))+") Updating world file ("+x[pkgindex]+")") - portage.write_atomic(os.path.join(myroot,portage.WORLD_FILE),"\n".join(myfavdict.values())) + portage.write_atomic( + os.path.join(myroot, portage.WORLD_FILE.lstrip(os.sep)), + "\n".join(myfavdict.values())) if ("noclean" not in portage.features) and (x[0] != "binary"): short_msg = "emerge: ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" Clean Post" diff --git a/pym/portage.py b/pym/portage.py index 8dd2866b0..c36e19193 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -5826,7 +5826,8 @@ class dblink: os.chown(pdir, 0, portage_gid) os.chmod(pdir, 02770) - write_atomic(os.path.join(self.myroot,WORLD_FILE),"\n".join(newworldlist)) + write_atomic(os.path.join(self.myroot, WORLD_FILE.lstrip(os.sep)), + "\n".join(newworldlist)) #do original postrm if myebuildpath and os.path.exists(myebuildpath):