Changeset 3501
- Timestamp:
- Jun 19, 2007, 2:44:17 AM (18 years ago)
- Location:
- trunk/essentials/sys-apps/prefix-portage/pym/portage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/essentials/sys-apps/prefix-portage/pym/portage/__init__.py
r3488 r3501 472 472 if env is None: 473 473 env = os.environ 474 envd_dir = os.path.join( target_root + EPREFIX, "etc", "env.d")474 envd_dir = os.path.join(normalize_path(target_root + EPREFIX), "etc", "env.d") 475 475 portage.util.ensure_dirs(envd_dir, mode=0755) 476 476 fns = listdir(envd_dir, EmptyOnError=1) … … 547 547 env.update(myconfig) 548 548 549 ldsoconf_path = os.path.join( target_root + EPREFIX, "etc", "ld.so.conf")549 ldsoconf_path = os.path.join(normalize_path(target_root + EPREFIX), "etc", "ld.so.conf") 550 550 try: 551 551 myld = open(ldsoconf_path) … … 579 579 if prelink_capable: 580 580 newprelink = atomic_ofstream( 581 os.path.join( target_root + EPREFIX, "etc", "prelink.conf"))581 os.path.join(normalize_path(target_root + EPREFIX), "etc", "prelink.conf")) 582 582 newprelink.write("# prelink.conf autogenerated by env-update; make all changes to\n") 583 583 newprelink.write("# contents of "+EPREFIX+"/etc/env.d directory\n") … … 614 614 lib_dirs = set() 615 615 for lib_dir in portage.util.unique_array(specials["LDPATH"]+['usr/lib','usr/lib64','usr/lib32','lib','lib64','lib32']): 616 x = os.path.join( target_root + EPREFIX, lib_dir.lstrip(os.sep))616 x = os.path.join(normalize_path(target_root + EPREFIX), lib_dir.lstrip(os.sep)) 617 617 try: 618 618 newldpathtime = long(os.stat(x).st_mtime) … … 670 670 # to overwrite the symlinks we just made. -X means no links. After 'clean' 671 671 # we can safely create links. 672 writemsg(">>> Regenerating %s/etc/ld.so.cache...\n" % ( target_root+EPREFIX))672 writemsg(">>> Regenerating %s/etc/ld.so.cache...\n" % (normalize_path(target_root+EPREFIX))) 673 673 if makelinks: 674 674 os.system("cd / ; %s -r '%s'" % (ldconfig, target_root)) … … 677 677 elif ostype in ("FreeBSD","DragonFly"): 678 678 writemsg(">>> Regenerating %svar/run/ld-elf.so.hints...\n" % \ 679 target_root+EPREFIX)679 normalize_path(target_root+EPREFIX)) 680 680 os.system(("cd / ; %s -elf -i " + \ 681 681 "-f '%svar/run/ld-elf.so.hints' '%setc/ld.so.conf'") % \ 682 (ldconfig, target_root+EPREFIX, target_root+EPREFIX))682 (ldconfig, normalize_path(target_root+EPREFIX), normalize_path(target_root+EPREFIX))) 683 683 684 684 del specials["LDPATH"] … … 691 691 692 692 #create /etc/profile.env for bash support 693 outfile = atomic_ofstream(os.path.join( target_root + EPREFIX, "etc", "profile.env"))693 outfile = atomic_ofstream(os.path.join(normalize_path(target_root + EPREFIX), "etc", "profile.env")) 694 694 outfile.write(penvnotice) 695 695 … … 701 701 702 702 #create /etc/csh.env for (t)csh support 703 outfile = atomic_ofstream(os.path.join( target_root + EPREFIX, "etc", "csh.env"))703 outfile = atomic_ofstream(os.path.join(normalize_path(target_root + EPREFIX), "etc", "csh.env")) 704 704 outfile.write(cenvnotice) 705 705 for x in env_keys: … … 944 944 config_root)).rstrip(os.path.sep) + os.path.sep 945 945 946 check_var_directory("PORTAGE_CONFIGROOT", config_root + EPREFIX)946 check_var_directory("PORTAGE_CONFIGROOT", normalize_path(config_root + EPREFIX)) 947 947 948 948 self.depcachedir = DEPCACHE_PATH … … 1080 1080 1081 1081 try: 1082 self.mygcfg = getconfig(os.path.join( config_root + EPREFIX, "etc", "make.globals"))1082 self.mygcfg = getconfig(os.path.join(normalize_path(config_root + EPREFIX), "etc", "make.globals")) 1083 1083 1084 1084 if self.mygcfg is None: … … 1190 1190 target_root)).rstrip(os.path.sep) + os.path.sep 1191 1191 1192 check_var_directory("ROOT", target_root + EPREFIX)1192 check_var_directory("ROOT", normalize_path(target_root + EPREFIX)) 1193 1193 1194 1194 env_d = getconfig( 1195 os.path.join( target_root + EPREFIX, "etc", "profile.env"), expand=False)1195 os.path.join(normalize_path(target_root + EPREFIX), "etc", "profile.env"), expand=False) 1196 1196 # env_d will be None if profile.env doesn't exist. 1197 1197 if env_d: … … 1478 1478 Create a few directories that are critical to portage operation 1479 1479 """ 1480 if not os.access( self["ROOT"] + EPREFIX, os.W_OK):1480 if not os.access(normalize_path(self["ROOT"] + EPREFIX), os.W_OK): 1481 1481 return 1482 1482 … … 1898 1898 self.configdict["env.d"].clear() 1899 1899 env_d = getconfig( 1900 os.path.join( self["ROOT"] + EPREFIX, "etc", "profile.env"), expand=False)1900 os.path.join(normalize_path(self["ROOT"] + EPREFIX), "etc", "profile.env"), expand=False) 1901 1901 if env_d: 1902 1902 # env_d will be None if profile.env doesn't exist. … … 3289 3289 #set up KV variable -- DEP SPEEDUP :: Don't waste time. Keep var persistent. 3290 3290 if (mydo!="depend") or not mysettings.has_key("KV"): 3291 mykv,err1=ExtractKernelVersion(os.path.join( myroot + EPREFIX, "usr/src/linux"))3291 mykv,err1=ExtractKernelVersion(os.path.join(normalize_path(myroot + EPREFIX), "usr/src/linux")) 3292 3292 if mykv: 3293 3293 # Regular source tree … … 4153 4153 def merge(mycat, mypkg, pkgloc, infloc, myroot, mysettings, myebuild=None, 4154 4154 mytree=None, mydbapi=None, vartree=None, prev_mtimes=None): 4155 if not os.access( myroot+EPREFIX.lstrip("/"), os.W_OK):4155 if not os.access(normalize_path(myroot+EPREFIX).lstrip("/"), os.W_OK): 4156 4156 writemsg("Permission denied: access('%s', W_OK)\n" % 4157 ( myroot+EPREFIX.lstrip("/")), noiselevel=-1)4157 (normalize_path(myroot+EPREFIX).lstrip("/")), noiselevel=-1) 4158 4158 return errno.EACCES 4159 4159 mylink = dblink(mycat, mypkg, myroot, mysettings, treetype=mytree, -
trunk/essentials/sys-apps/prefix-portage/pym/portage/util.py
r3494 r3501 40 40 This doesn't apply to OS/2 kNIX where "//foo/bar" differs 41 41 from "/foo/bar" in that the former is a UNC path while the 42 later is a local path. 42 later is a local path. However, on OS/2 we must fix the silly 43 //@unixroot -> /@unixroot that's caused by config_target+EPREFIX 44 all over the 'ing place. 43 45 """ 44 if mypath.startswith(os.path.sep) and sys.platform != "os2knix":: 46 if sys.platform == "os2knix": 47 if mypath[:11] == "//@unixroot": 48 mypath = mypath[1:] 49 elif mypath[:12] == "///@unixroot": 50 print "dbg: %s -> %s\n" % (mypath, mypath[2:]) 51 mypath = mypath[2:] 52 return os.path.normpath(mypath) 53 elif mypath.startswith(os.path.sep): 45 54 # posixpath.normpath collapses 3 or more leading slashes to just 1. 46 55 return os.path.normpath(2*os.path.sep + mypath)
Note:
See TracChangeset
for help on using the changeset viewer.