From: Fabian Groffen Date: Wed, 11 Nov 2009 20:19:31 +0000 (-0000) Subject: It makes no sense to write an ${EPREFIX}/etc/ld.so.conf file since it'll never be... X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=9be6d2e8106e1bf21871276aff032e092e74d605;p=portage.git It makes no sense to write an ${EPREFIX}/etc/ld.so.conf file since it'll never be used by ld.so. It makes no sense to make that code Prefix enabled for that reason either. Don't run it on a Prefix install. svn path=/main/branches/prefix/; revision=14809 --- diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index a3e1eb5dd..3816c8a80 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -1035,8 +1035,16 @@ def env_update(makelinks=1, target_root=None, prev_mtimes=None, contents=None, """Cumulative variables have already been deleted from myconfig so that they won't be overwritten by this dict.update call.""" env.update(myconfig) - - ldsoconf_path = os.path.join(target_root, EPREFIX_LSTRIP, "etc", "ld.so.conf") + + if EPREFIX == '': + dolinkingstuff() + writeshellprofile() + +def dolinkingstuff(): + # updating this stuff will never work in an offset, other than ROOT + # (e.g. not in Prefix), hence the EPREFIX is not taken into account + # here since this code should never be triggered on an offset install + ldsoconf_path = os.path.join(target_root, "etc", "ld.so.conf") try: myld = codecs.open(_unicode_encode(ldsoconf_path, encoding=_encodings['fs'], errors='strict'), @@ -1061,7 +1069,7 @@ def env_update(makelinks=1, target_root=None, prev_mtimes=None, contents=None, #ld.so.conf needs updating and ldconfig needs to be run myfd = atomic_ofstream(ldsoconf_path) myfd.write("# ld.so.conf autogenerated by env-update; make all changes to\n") - myfd.write("# contents of "+EPREFIX+"/etc/env.d directory\n") + myfd.write("# contents of /etc/env.d directory\n") for x in specials["LDPATH"]: myfd.write(x+"\n") myfd.close() @@ -1070,11 +1078,11 @@ def env_update(makelinks=1, target_root=None, prev_mtimes=None, contents=None, # Update prelink.conf if we are prelink-enabled if prelink_capable: newprelink = atomic_ofstream( - os.path.join(target_root, EPREFIX_LSTRIP, "etc", "prelink.conf")) + os.path.join(target_root, "etc", "prelink.conf")) newprelink.write("# prelink.conf autogenerated by env-update; make all changes to\n") - newprelink.write("# contents of "+EPREFIX+"/etc/env.d directory\n") + newprelink.write("# contents of /etc/env.d directory\n") - for x in map(lambda x: os.path.join(EPREFIX,x), ["bin","sbin","usr/bin","usr/sbin","lib","usr/lib"]): + for x in map(lambda x: x, ["bin","sbin","usr/bin","usr/sbin","lib","usr/lib"]): newprelink.write("-l "+x+"\n"); for x in specials["LDPATH"]+specials["PATH"]+specials["PRELINK_PATH"]: if not x: @@ -1105,7 +1113,7 @@ def env_update(makelinks=1, target_root=None, prev_mtimes=None, contents=None, mtime_changed = False lib_dirs = set() for lib_dir in portage.util.unique_array(specials["LDPATH"]+['usr/lib','usr/lib64','usr/lib32','lib','lib64','lib32']): - x = os.path.join(target_root, EPREFIX_LSTRIP, lib_dir.lstrip(os.sep)) + x = os.path.join(target_root, lib_dir.lstrip(os.sep)) try: newldpathtime = long(os.stat(x).st_mtime) lib_dirs.add(normalize_path(x)) @@ -1147,14 +1155,14 @@ def env_update(makelinks=1, target_root=None, prev_mtimes=None, contents=None, if not libdir_contents_changed: makelinks = False - ldconfig = EPREFIX+"/sbin/ldconfig" + ldconfig = "/sbin/ldconfig" if "CHOST" in env and "CBUILD" in env and \ env["CHOST"] != env["CBUILD"]: from portage.process import find_binary ldconfig = find_binary("%s-ldconfig" % env["CHOST"]) # Only run ldconfig as needed - if (ld_cache_update or makelinks) and ldconfig and EPREFIX == '': + if (ld_cache_update or makelinks) and ldconfig: # ldconfig has very different behaviour between FreeBSD and Linux if ostype=="Linux" or ostype.lower().endswith("gnu"): # We can't update links if we haven't cleaned other versions first, as @@ -1162,20 +1170,21 @@ def env_update(makelinks=1, target_root=None, prev_mtimes=None, contents=None, # to overwrite the symlinks we just made. -X means no links. After 'clean' # we can safely create links. writemsg_level(_(">>> Regenerating %setc/ld.so.cache...\n") % \ - (target_root + EPREFIX_LSTRIP,)) + (target_root,)) if makelinks: os.system("cd / ; %s -r '%s'" % (ldconfig, target_root)) else: os.system("cd / ; %s -X -r '%s'" % (ldconfig, target_root)) elif ostype in ("FreeBSD","DragonFly"): writemsg_level(_(">>> Regenerating %svar/run/ld-elf.so.hints...\n") % \ - target_root + EPREFIX_LSTRIP) + target_root) os.system(("cd / ; %s -elf -i " + \ "-f '%svar/run/ld-elf.so.hints' '%setc/ld.so.conf'") % \ - (ldconfig, target_root + EPREFIX_LSTRIP, target_root + EPREFIX_LSTRIP)) + (ldconfig, target_root, target_root)) del specials["LDPATH"] +def writeshellprofile(): penvnotice = "# THIS FILE IS AUTOMATICALLY GENERATED BY env-update.\n" penvnotice += "# DO NOT EDIT THIS FILE. CHANGES TO STARTUP PROFILES\n" cenvnotice = penvnotice[:]