diff options
Diffstat (limited to 'classes/package.bbclass')
-rw-r--r-- | classes/package.bbclass | 69 |
1 files changed, 23 insertions, 46 deletions
diff --git a/classes/package.bbclass b/classes/package.bbclass index 6c61f7bdda..ec8c3d97e2 100644 --- a/classes/package.bbclass +++ b/classes/package.bbclass @@ -34,9 +34,6 @@ def do_split_packages(d, root, file_regex, output_pattern, description, postinst return packages = bb.data.getVar('PACKAGES', d, 1).split() - if not packages: - # nothing to do - return if postinst: postinst = '#!/bin/sh\n' + postinst + '\n' @@ -152,6 +149,12 @@ def runstrip(file, d): bb.debug(1, "runstrip: skip %s" % file) return 0 + # If the file is in a .debug directory it was already stripped, + # don't do it again... + if os.path.dirname(file).endswith(".debug"): + bb.note("Already run strip") + return 0 + strip = bb.data.getVar("STRIP", d, 1) objcopy = bb.data.getVar("OBJCOPY", d, 1) @@ -189,42 +192,15 @@ def runstrip(file, d): # Package data handling routines # -STAGING_PKGMAPS_DIR ?= "${STAGING_DIR}/pkgmaps" - -def add_package_mapping (pkg, new_name, d): - import bb, os - - def encode(str): - import codecs - c = codecs.getencoder("string_escape") - return c(str)[0] - - pmap_dir = bb.data.getVar('STAGING_PKGMAPS_DIR', d, 1) - - bb.mkdirhier(pmap_dir) - - data_file = os.path.join(pmap_dir, pkg) - - f = open(data_file, 'w') - f.write("%s\n" % encode(new_name)) - f.close() - def get_package_mapping (pkg, d): import bb, os - def decode(str): - import codecs - c = codecs.getdecoder("string_escape") - return c(str)[0] + data = read_subpkgdata(pkg, d) + key = "PKG_%s" % pkg - data_file = bb.data.expand("${STAGING_PKGMAPS_DIR}/%s" % pkg, d) + if key in data: + return data[key] - if os.access(data_file, os.R_OK): - f = file(data_file, 'r') - lines = f.readlines() - f.close() - for l in lines: - return decode(l).strip() return pkg def runtime_mapping_rename (varname, d): @@ -258,9 +234,6 @@ python package_do_split_locales() { return packages = (bb.data.getVar('PACKAGES', d, 1) or "").split() - if not packages: - bb.debug(1, "no packages to build; not splitting locales") - return datadir = bb.data.getVar('datadir', d, 1) if not datadir: @@ -410,9 +383,6 @@ python populate_packages () { bb.mkdirhier(dvar) packages = bb.data.getVar('PACKAGES', d, 1) - if not packages: - bb.debug(1, "PACKAGES not defined, nothing to package") - return pn = bb.data.getVar('PN', d, 1) if not pn: @@ -516,8 +486,6 @@ python populate_packages () { pkgname = bb.data.getVar('PKG_%s' % pkg, d, 1) if pkgname is None: bb.data.setVar('PKG_%s' % pkg, pkg, d) - else: - add_package_mapping(pkg, pkgname, d) dangling_links = {} pkg_files = {} @@ -604,6 +572,8 @@ python emit_pkgdata() { sf.close() allow_empty = bb.data.getVar('ALLOW_EMPTY_%s' % pkg, d, 1) + if not allow_empty: + allow_empty = bb.data.getVar('ALLOW_EMPTY', d, 1) root = "%s/install/%s" % (workdir, pkg) os.chdir(root) g = glob('*') @@ -730,6 +700,16 @@ python package_do_shlibs() { for l in lines: shlib_provider[l.rstrip()] = (dep_pkg, lib_ver) + assumed_libs = bb.data.getVar('ASSUME_SHLIBS', d, 1) + if assumed_libs: + for e in assumed_libs.split(): + l, dep_pkg = e.split(":") + lib_ver = None + dep_pkg = dep_pkg.rsplit("_", 1) + if len(dep_pkg) == 2: + lib_ver = dep_pkg[1] + dep_pkg = dep_pkg[0] + shlib_provider[l] = (dep_pkg, lib_ver) for pkg in packages.split(): bb.debug(2, "calculating shlib requirements for %s" % pkg) @@ -903,10 +883,7 @@ python package_depchains() { prefixes = (bb.data.getVar('DEPCHAIN_PRE', d, 1) or '').split() def pkg_addrrecs(pkg, base, suffix, getname, rdepends, d): - def packaged(pkg, d): - return os.access(bb.data.expand('${PKGDATA_DIR}/runtime/%s.packaged' % pkg, d), os.R_OK) - - #bb.note('rdepends for %s is %s' % (base, rdepends)) + #bb.note('rdepends for %s is %s' % (base, rdepends)) rreclist = explode_deps(bb.data.getVar('RRECOMMENDS_' + pkg, d, 1) or bb.data.getVar('RRECOMMENDS', d, 1) or "") |