2 ===================================================================
3 --- pym/portage.py (revision 2563)
4 +++ pym/portage.py (working copy)
7 #parse /etc/env.d and generate /etc/profile.env
9 -def env_update(makelinks=1):
10 +def env_update(makelinks=1,srcroot=""):
12 if not os.path.exists(root+"etc/env.d"):
15 if not mtimedb.has_key("ldpath"):
18 - for x in specials["LDPATH"]+['/usr/lib','/lib']:
20 + for x in portage_util.unique_array(specials["LDPATH"]+['/usr/lib','/usr/lib64','/usr/lib32','/lib','/lib64','/lib32']):
21 + if makelinks and skip_makelinks and os.access(srcroot+x,os.R_OK):
24 newldpathtime=os.stat(x)[stat.ST_MTIME]
27 mtimedb["ldpath"][x]=newldpathtime
30 - # ldconfig has very different behaviour between FreeBSD and Linux
31 - if ostype=="Linux" or ostype.lower().endswith("gnu"):
32 - if (ld_cache_update or makelinks):
33 + # Don't run ldconfig if the package didn't install any libs
34 + if (ld_cache_update or (makelinks and not skip_makelinks)):
35 + # ldconfig has very different behaviour between FreeBSD and Linux
36 + if ostype=="Linux" or ostype.lower().endswith("gnu"):
37 # We can't update links if we haven't cleaned other versions first, as
38 # an older package installed ON TOP of a newer version will cause ldconfig
39 # to overwrite the symlinks we just made. -X means no links. After 'clean'
41 commands.getstatusoutput("cd / ; /sbin/ldconfig -r "+root)
43 commands.getstatusoutput("cd / ; /sbin/ldconfig -X -r "+root)
44 - elif ostype in ("FreeBSD","DragonFly"):
45 - if (ld_cache_update):
46 + elif ostype in ("FreeBSD","DragonFly"):
47 writemsg(">>> Regenerating "+str(root)+"var/run/ld-elf.so.hints...\n")
48 commands.getstatusoutput("cd / ; /sbin/ldconfig -elf -i -f "+str(root)+"var/run/ld-elf.so.hints "+str(root)+"etc/ld.so.conf")
53 #update environment settings, library paths. DO NOT change symlinks.
54 - env_update(makelinks=(not downgrade))
55 + env_update(makelinks=(not downgrade),srcroot=srcroot)
56 #dircache may break autoclean because it remembers the -MERGING-pkg file
58 if dircache.has_key(self.dbcatdir):