summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Mauch <genone@gentoo.org>2008-02-05 21:29:15 +0000
committerMarius Mauch <genone@gentoo.org>2008-02-05 21:29:15 +0000
commit7014857203ba5b84322eff0760a13d7ee96ab97c (patch)
treef245d3a103deafd5bd939da17e89727ad0163b8e
parentb25f0d29b75e92786b36f90ffd2d61bcee4285b4 (diff)
downloadportage-7014857203ba5b84322eff0760a13d7ee96ab97c.tar.gz
portage-7014857203ba5b84322eff0760a13d7ee96ab97c.tar.bz2
portage-7014857203ba5b84322eff0760a13d7ee96ab97c.zip
don't try to copy manually removed libraries (bug #208946)
svn path=/main/trunk/; revision=9277
-rw-r--r--pym/portage/dbapi/vartree.py11
-rw-r--r--pym/portage/util.py14
2 files changed, 24 insertions, 1 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 3ce61424a..3b11823b6 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -1594,11 +1594,16 @@ class dblink(object):
# get the real paths for the libs
preserve_paths = [x for x in old_contents if os.path.basename(x) in preserve_libs]
del old_contents, old_libs, mylibs, preserve_libs
-
+
# inject files that should be preserved into our image dir
import shutil
+ missing_paths = []
for x in preserve_paths:
print "injecting %s into %s" % (x, srcroot)
+ if not os.path.exists(os.path.join(destroot, x.lstrip(os.sep))):
+ print "%s does not exist so can't be preserved"
+ missing_paths.append(x)
+ continue
mydir = os.path.join(srcroot, os.path.dirname(x).lstrip(os.sep))
if not os.path.exists(mydir):
os.makedirs(mydir)
@@ -1616,6 +1621,10 @@ class dblink(object):
shutil.copy2(os.path.join(destroot, x.lstrip(os.sep)),
os.path.join(srcroot, x.lstrip(os.sep)))
+ preserve_paths = [x for x in preserve_paths if x not in missing_paths]
+
+ del missing_paths
+
# keep track of the libs we preserved
self.vartree.dbapi.plib_registry.register(self.mycpv, self.settings["SLOT"], counter, preserve_paths)
diff --git a/pym/portage/util.py b/pym/portage/util.py
index 39abcd81e..deda2e2c3 100644
--- a/pym/portage/util.py
+++ b/pym/portage/util.py
@@ -1058,3 +1058,17 @@ def new_protect_filename(mydest, newmd5=None):
os.path.join(real_dirname, last_pfile)) == newmd5:
return old_pfile
return new_pfile
+
+def getlibpaths():
+ """ Return a list of paths that are used for library lookups """
+
+ # the following is based on the information from ld.so(8)
+ rval = os.environ.get("LD_LIBRARY_PATH", "").split(":")
+ rval.extend(grabfile("/etc/ld.so.conf"))
+ rval.append("/usr/lib")
+ rval.append("/lib")
+
+ rval = [normalize_path(x) for x in rval if x != ""]
+
+ return rval
+