summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorPhil Blundell <philb@gnu.org>2004-08-07 14:30:44 +0000
committerPhil Blundell <philb@gnu.org>2004-08-07 14:30:44 +0000
commitc28d9aa7982bd478cb8842ce5e37d1e8afd349a3 (patch)
treee08f3117a4ff8a2a1fac6e59bf02674d08662c5e /classes
parentede64449fc9785e4aa49aac6d639384596088047 (diff)
move shlibs files into tmp/staging/HOST_SYS/shlibs (though old location tmp/staging/shlibs still read for compatibility)
avoid re-reading shlibs data for every subpackage to speed up processing time BKrev: 4114e7948YOWm-LaY7ihWY4PU1iVYA
Diffstat (limited to 'classes')
-rw-r--r--classes/package.oeclass71
1 files changed, 42 insertions, 29 deletions
diff --git a/classes/package.oeclass b/classes/package.oeclass
index 589f99f950..907d737bb2 100644
--- a/classes/package.oeclass
+++ b/classes/package.oeclass
@@ -296,6 +296,15 @@ python package_do_shlibs() {
oe.error("PV not defined")
return
+ target_sys = oe.data.getVar('TARGET_SYS', d, 1)
+ if not target_sys:
+ oe.error("TARGET_SYS not defined")
+ return
+
+ shlibs_dir = os.path.join(staging, target_sys, "shlibs")
+ old_shlibs_dir = os.path.join(staging, "shlibs")
+ oe.mkdirhier(shlibs_dir)
+
needed = {}
for pkg in packages.split():
needs_ldconfig = False
@@ -326,8 +335,6 @@ python package_do_shlibs() {
sonames.append(m.group(1))
if m and libdir_re.match(root):
needs_ldconfig = True
- shlibs_dir = os.path.join(staging, "shlibs")
- oe.mkdirhier(shlibs_dir)
shlibs_file = os.path.join(shlibs_dir, pkgname + ".list")
if os.path.exists(shlibs_file):
os.remove(shlibs_file)
@@ -350,40 +357,46 @@ python package_do_shlibs() {
postinst += oe.data.getVar('ldconfig_postinst_fragment', d, 1)
oe.data.setVar('pkg_postinst_%s' % pkg, postinst, d)
+ shlib_provider = {}
+ list_re = re.compile('^(.*)\.list$')
+ for dir in [shlibs_dir, old_shlibs_dir]:
+ if not os.path.exists(dir):
+ continue
+ for file in os.listdir(dir):
+ m = list_re.match(file)
+ if m:
+ dep_pkg = m.group(1)
+ fd = open(os.path.join(dir, file))
+ lines = fd.readlines()
+ fd.close()
+ ver_file = os.path.join(dir, dep_pkg + '.ver')
+ lib_ver = None
+ if os.path.exists(ver_file):
+ fd = open(ver_file)
+ lib_ver = fd.readline().rstrip()
+ fd.close()
+ for l in lines:
+ shlib_provider[l.rstrip()] = (dep_pkg, lib_ver)
+
+
for pkg in packages.split():
oe.debug(2, "calculating shlib requirements for %s" % pkg)
deps = list()
for n in needed[pkg]:
- found = False
- for file in os.listdir(shlibs_dir):
- m = re.match('^(.*)\.list$', file)
- if m:
- dep_pkg = m.group(1)
- fd = open(os.path.join(shlibs_dir, file))
- lines = fd.readlines()
- fd.close()
- for l in lines:
- if n == l.rstrip():
- if dep_pkg == pkg:
- found = True
- continue
- ver_file = os.path.join(shlibs_dir, dep_pkg + '.ver')
- ver_needed = None
- if os.path.exists(ver_file):
- fd = open(ver_file)
- ver_needed = fd.readline().rstrip()
- fd.close()
- if ver_needed:
- dep = "%s (>= %s)" % (dep_pkg, ver_needed)
- else:
- dep = dep_pkg
- if not dep in deps:
- deps.append(dep)
- found = True
- if found == False:
+ if n in shlib_provider.keys():
+ (dep_pkg, ver_needed) = shlib_provider[n]
+
+ if ver_needed:
+ dep = "%s (>= %s)" % (dep_pkg, ver_needed)
+ else:
+ dep = dep_pkg
+ if not dep in deps:
+ deps.append(dep)
+ else:
oe.note("Couldn't find shared library provider for %s" % n)
+
deps_file = os.path.join(workdir, "install", pkg + ".shlibdeps")
if os.path.exists(deps_file):
os.remove(deps_file)