More path fixups, replace leading '/' for ld.so and .env functions.
authorKito <kito@gentoo.org>
Fri, 27 Jan 2006 19:44:26 +0000 (19:44 -0000)
committerKito <kito@gentoo.org>
Fri, 27 Jan 2006 19:44:26 +0000 (19:44 -0000)
svn path=/main/branches/prefix/; revision=2596

pym/portage.py

index 187090ef40f5bd0eab5c6570e61e7166e50d5b8f..629390d6ff9cb9b7bb35278962132afefa15006d 100644 (file)
@@ -575,8 +575,8 @@ def env_update(makelinks=1):
                for myenv in myconfig.keys():
                        env[myenv]=myconfig[myenv]
 
-       if os.path.exists(root+portage_const.PREFIX+"etc/ld.so.conf"):
-               myld=open(root+portage_const.PREFIX+"etc/ld.so.conf")
+       if os.path.exists(root+portage_const.PREFIX+"/etc/ld.so.conf"):
+               myld=open(root+portage_const.PREFIX+"/etc/ld.so.conf")
                myldlines=myld.readlines()
                myld.close()
                oldld=[]
@@ -598,7 +598,7 @@ def env_update(makelinks=1):
        newld=specials["LDPATH"]
        if (oldld!=newld):
                #ld.so.conf needs updating and ldconfig needs to be run
-               myfd=open(root+portage_const.PREFIX+"etc/ld.so.conf","w")
+               myfd=open(root+portage_const.PREFIX+"/etc/ld.so.conf","w")
                myfd.write("# ld.so.conf autogenerated by env-update; make all changes to\n")
                myfd.write("# contents of "+portage_const.PREFIX+"etc/env.d directory\n")
                for x in specials["LDPATH"]:
@@ -608,9 +608,9 @@ def env_update(makelinks=1):
 
        # Update prelink.conf if we are prelink-enabled
        if prelink_capable:
-               newprelink=open(root+portage_const.PREFIX+"etc/prelink.conf","w")
+               newprelink=open(root+portage_const.PREFIX+"/etc/prelink.conf","w")
                newprelink.write("# prelink.conf autogenerated by env-update; make all changes to\n")
-               newprelink.write("# contents of "+portage_const.PREFIX+"etc/env.d directory\n")
+               newprelink.write("# contents of "+portage_const.PREFIX+"/etc/env.d directory\n")
 
                for x in map(lambda x: portage_const.PREFIX+x, ["bin","/sbin","/usr/bin","/usr/sbin","/lib","/usr/lib"]):
                        newprelink.write("-l "+x+"\n");
@@ -669,7 +669,7 @@ def env_update(makelinks=1):
        elif ostype in ("FreeBSD","DragonFly"):
                if (ld_cache_update):
                        writemsg(">>> Regenerating "+str(root)+"var/run/ld-elf.so.hints...\n")
-                       commands.getstatusoutput("cd / ; "+portage_const.PREFIX+"/sbin/ldconfig -elf -i -f "+str(root)+portage_const.PREFIX+"var/run/ld-elf.so.hints "+str(root)+portage_const.PREFIX+"etc/ld.so.conf")
+                       commands.getstatusoutput("cd / ; "+portage_const.PREFIX+"/sbin/ldconfig -elf -i -f "+str(root)+portage_const.PREFIX+"/var/run/ld-elf.so.hints "+str(root)+portage_const.PREFIX+"/etc/ld.so.conf")
                        commands.getstatusoutput("cd / ; /sbin/ldconfig -elf -i -f "+str(root)+"var/run/ld-elf.so.hints "+str(root)+"etc/ld.so.conf")
 
        del specials["LDPATH"]
@@ -681,7 +681,7 @@ def env_update(makelinks=1):
        cenvnotice += "# GO INTO /etc/csh.cshrc NOT /etc/csh.env\n\n"
 
        #create /etc/profile.env for bash support
-       outfile=open(root+portage_const.PREFIX+"etc/profile.env","w")
+       outfile=open(root+portage_const.PREFIX+"/etc/profile.env","w")
        outfile.write(penvnotice)
 
        for path in specials.keys():
@@ -705,7 +705,7 @@ def env_update(makelinks=1):
        outfile.close()
 
        #create /etc/csh.env for (t)csh support
-       outfile=open(root+portage_const.PREFIX+"etc/csh.env","w")
+       outfile=open(root+portage_const.PREFIX+"/etc/csh.env","w")
        outfile.write(cenvnotice)
 
        for path in specials.keys():