Changeset 3502
- Timestamp:
- Jun 19, 2007, 4:04:19 AM (18 years ago)
- Location:
- trunk/essentials/sys-apps/prefix-portage/pym
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/essentials/sys-apps/prefix-portage/pym/emerge/__init__.py
r3494 r3502 48 48 import portage.locks 49 49 import portage.exception 50 from portage.const import EPREFIX 50 from portage.const import EPREFIX, EXEEXT 51 51 from portage.data import secpass 52 52 from portage.util import normalize_path as normpath … … 3848 3848 from portage.util import normalize_path 3849 3849 if "noinfo" not in settings.features: 3850 chk_updated_info_files( normalize_path(target_root + EPREFIX), infodirs, info_mtimes, retval)3851 chk_updated_cfg_files( normalize_path(target_root + EPREFIX), config_protect)3850 chk_updated_info_files(target_root + EPREFIX.lstrip(os.path.sep), infodirs, info_mtimes, retval) 3851 chk_updated_cfg_files(target_root + EPREFIX.lstrip(os.path.sep), config_protect) 3852 3852 3853 3853 display_news_notification(settings) … … 3980 3980 tmpservertimestampfile = None 3981 3981 elif syncuri[:8]=="rsync://": 3982 if not os.path.exists(EPREFIX+"/usr/bin/rsync" ):3982 if not os.path.exists(EPREFIX+"/usr/bin/rsync"+EXEEXT): 3983 3983 print "!!! rsync does not exist, so rsync support is disabled." 3984 3984 print "!!! Type \"emerge net-misc/rsync\" to enable rsync support." … … 4196 4196 print ">>> Checking server timestamp ..." 4197 4197 4198 rsynccommand = [EPREFIX+"/usr/bin/rsync" ] + rsync_opts + extra_rsync_opts4198 rsynccommand = [EPREFIX+"/usr/bin/rsync"+EXEEXT] + rsync_opts + extra_rsync_opts 4199 4199 4200 4200 if "--debug" in myopts: … … 4335 4335 sys.exit(exitcode) 4336 4336 elif syncuri[:6]=="cvs://": 4337 if not os.path.exists(EPREFIX+"/usr/bin/cvs" ):4337 if not os.path.exists(EPREFIX+"/usr/bin/cvs"+EXEEXT): 4338 4338 print "!!! cvs does not exist, so CVS support is disabled." 4339 4339 print "!!! Type \"emerge dev-util/cvs\" to enable CVS support." … … 4369 4369 elif syncuri[:11]=="svn+http://": 4370 4370 # this should be way more generic! 4371 if not os.path.exists(EPREFIX+"/usr/bin/svn" ):4371 if not os.path.exists(EPREFIX+"/usr/bin/svn"+EXEEXT): 4372 4372 print "!!! svn does not exist, so SVN support is disabled." 4373 4373 print "!!! Type \"emerge dev-util/subversion\" to enable SVN support." … … 4648 4648 print header_width * "=" 4649 4649 print "System uname: "+unameout 4650 from portage.util import normalize_path 4651 foo = os.path.join(settings["PORTAGE_CONFIGROOT"] + EPREFIX.lstrip(os.path.sep), "etc", "gentoo-release") 4650 4652 gentoo_release = portage.grabfile(os.path.join( 4651 settings["PORTAGE_CONFIGROOT"] + EPREFIX , "etc", "gentoo-release"))4653 settings["PORTAGE_CONFIGROOT"] + EPREFIX.lstrip(os.path.sep), "etc", "gentoo-release")) 4652 4654 if gentoo_release: 4653 4655 print gentoo_release[0] -
trunk/essentials/sys-apps/prefix-portage/pym/portage/__init__.py
r3501 r3502 472 472 if env is None: 473 473 env = os.environ 474 envd_dir = os.path.join( normalize_path(target_root + EPREFIX), "etc", "env.d")474 envd_dir = os.path.join(target_root + EPREFIX.lstrip(os.path.sep), "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( normalize_path(target_root + EPREFIX), "etc", "ld.so.conf")549 ldsoconf_path = os.path.join(target_root + EPREFIX.lstrip(os.path.sep), "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( normalize_path(target_root + EPREFIX), "etc", "prelink.conf"))581 os.path.join(target_root + EPREFIX.lstrip(os.path.sep), "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( normalize_path(target_root + EPREFIX), lib_dir.lstrip(os.sep))616 x = os.path.join(target_root + EPREFIX.lstrip(os.path.sep), 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" % ( normalize_path(target_root+EPREFIX)))672 writemsg(">>> Regenerating %s/etc/ld.so.cache...\n" % (target_root+EPREFIX.lstrip(os.path.sep))) 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 normalize_path(target_root+EPREFIX))679 target_root+EPREFIX.lstrip(os.path.sep)) 680 680 os.system(("cd / ; %s -elf -i " + \ 681 681 "-f '%svar/run/ld-elf.so.hints' '%setc/ld.so.conf'") % \ 682 (ldconfig, normalize_path(target_root+EPREFIX), normalize_path(target_root+EPREFIX)))682 (ldconfig, target_root+EPREFIX.lstrip(os.path.sep), target_root+EPREFIX.lstrip(os.path.sep))) 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( normalize_path(target_root + EPREFIX), "etc", "profile.env"))693 outfile = atomic_ofstream(os.path.join(target_root + EPREFIX.lstrip(os.path.sep), "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( normalize_path(target_root + EPREFIX), "etc", "csh.env"))703 outfile = atomic_ofstream(os.path.join(target_root + EPREFIX.lstrip(os.path.sep), "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", normalize_path(config_root + EPREFIX))946 check_var_directory("PORTAGE_CONFIGROOT", config_root + EPREFIX.lstrip(os.path.sep)) 947 947 948 948 self.depcachedir = DEPCACHE_PATH … … 1080 1080 1081 1081 try: 1082 self.mygcfg = getconfig(os.path.join( normalize_path(config_root + EPREFIX), "etc", "make.globals"))1082 self.mygcfg = getconfig(os.path.join(config_root + EPREFIX.lstrip(os.path.sep), "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", normalize_path(target_root + EPREFIX))1192 check_var_directory("ROOT", target_root + EPREFIX.lstrip(os.path.sep)) 1193 1193 1194 1194 env_d = getconfig( 1195 os.path.join( normalize_path(target_root + EPREFIX), "etc", "profile.env"), expand=False)1195 os.path.join(target_root + EPREFIX.lstrip(os.path.sep), "etc", "profile.env"), expand=False) 1196 1196 # env_d will be None if profile.env doesn't exist. 1197 1197 if env_d: … … 1216 1216 self["EPREFIX"] = EPREFIX 1217 1217 self.backup_changes("EPREFIX") 1218 self["EROOT"] = normalize_path(target_root + EPREFIX ) + os.sep1218 self["EROOT"] = normalize_path(target_root + EPREFIX.lstrip(os.path.sep)) + os.sep 1219 1219 self.backup_changes("EROOT") 1220 1220 … … 1490 1490 for mypath, (gid, mode, modemask) in dir_mode_map.iteritems(): 1491 1491 try: 1492 mydir = normalize_path(os.path.join(self["ROOT"] + EPREFIX , mypath))1492 mydir = normalize_path(os.path.join(self["ROOT"] + EPREFIX.lstrip(os.path.sep), mypath)) 1493 1493 portage.util.ensure_dirs(mydir, gid=gid, mode=mode, mask=modemask) 1494 1494 except portage.exception.PortageException, e: … … 1898 1898 self.configdict["env.d"].clear() 1899 1899 env_d = getconfig( 1900 os.path.join( normalize_path(self["ROOT"] + EPREFIX), "etc", "profile.env"), expand=False)1900 os.path.join(self["ROOT"] + EPREFIX.lstrip(os.path.sep), "etc", "profile.env"), expand=False) 1901 1901 if env_d: 1902 1902 # env_d will be None if profile.env doesn't exist. … … 3213 3213 mysettings["EPREFIX"] = EPREFIX.rstrip(os.sep) 3214 3214 mysettings["ROOT"] = myroot 3215 mysettings["EROOT"] = normalize_path(myroot + mysettings["EPREFIX"] ) + os.sep3215 mysettings["EROOT"] = normalize_path(myroot + mysettings["EPREFIX"].lstrip(os.path.sep)) + os.sep 3216 3216 mysettings["STARTDIR"] = getcwd() 3217 3217 … … 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( normalize_path(myroot + EPREFIX), "usr/src/linux"))3291 mykv,err1=ExtractKernelVersion(os.path.join(myroot + EPREFIX.lstrip(os.path.sep), "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( normalize_path(myroot+EPREFIX).lstrip("/"), os.W_OK):4155 if not os.access(myroot+EPREFIX.lstrip(os.path.sep), os.W_OK): 4156 4156 writemsg("Permission denied: access('%s', W_OK)\n" % 4157 ( normalize_path(myroot+EPREFIX).lstrip("/")), noiselevel=-1)4157 (myroot+EPREFIX.lstrip(os.path.sep)), 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/const.py
r3499 r3502 73 73 MANIFEST1_HASH_FUNCTIONS = ["MD5"] 74 74 MANIFEST2_HASH_FUNCTIONS = ["SHA1"] 75 76 # bird: Added EXEEXT for appending ".exe" on OS/2 and windows. 77 EXEEXT = "@EXEEXT" 78 if EXEEXT == "@"+"EXEEXT"+"@": 79 EXEEXT = "" 75 80 76 81 # =========================================================================== -
trunk/essentials/sys-apps/prefix-portage/pym/portage/dbapi/vartree.py
r3488 r3502 404 404 return mymatch 405 405 try: 406 curmtime = os.stat( self.root+VDB_PATH+"/"+mycat)[stat.ST_MTIME]406 curmtime = os.stat(os.path.join(self.root, VDB_PATH+"/"+mycat))[stat.ST_MTIME] 407 407 except (IOError, OSError): 408 408 curmtime=0 -
trunk/essentials/sys-apps/prefix-portage/pym/portage/util.py
r3501 r3502 48 48 mypath = mypath[1:] 49 49 elif mypath[:12] == "///@unixroot": 50 print "dbg: %s -> %s\n" % (mypath, mypath[2:])51 50 mypath = mypath[2:] 52 51 return os.path.normpath(mypath) … … 948 947 for x in self.protect_list: 949 948 ppath = normalize_path( 950 os.path.join(self.myroot + EPREFIX , x.lstrip(os.path.sep)))949 os.path.join(self.myroot + EPREFIX.lstrip(os.path.sep), x.lstrip(os.path.sep))) 951 950 mystat = None 952 951 try: … … 961 960 for x in self.mask_list: 962 961 ppath = normalize_path( 963 os.path.join(self.myroot + EPREFIX , x.lstrip(os.path.sep)))962 os.path.join(self.myroot + EPREFIX.lstrip(os.path.sep), x.lstrip(os.path.sep))) 964 963 mystat = None 965 964 try:
Note:
See TracChangeset
for help on using the changeset viewer.