aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndré Draszik <andre.draszik@jci.com>2019-02-05 02:32:34 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-02-12 14:04:24 +0000
commitfc709be54fee06801446774ff1a434294c2eda9b (patch)
tree9f1f404defad4c22ba59c4da9e7221d15958f677
parent97554a56f7d9fa82294b1316f143de3f37506fc7 (diff)
downloadopenembedded-core-contrib-fc709be54fee06801446774ff1a434294c2eda9b.tar.gz
openembedded-core-contrib-fc709be54fee06801446774ff1a434294c2eda9b.tar.bz2
openembedded-core-contrib-fc709be54fee06801446774ff1a434294c2eda9b.zip
util-linux: one package per binary (pt 1b: symlinks)
Some of the binaries have symlinks. Add them to the package owning the binary they are pointing to. Signed-off-by: André Draszik <andre.draszik@jci.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/util-linux/util-linux.inc22
1 files changed, 22 insertions, 0 deletions
diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc
index a81045251b..a250db94aa 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -52,6 +52,28 @@ python util_linux_binpackages () {
file_regex=r'(.*)', output_pattern='${PN}-%s',
description='${PN} %s',
hook=pkg_hook, extra_depends='', prepend=True)
+
+ # There are some symlinks for some binaries which we have ignored
+ # above. Add them to the package owning the binary they are
+ # pointing to
+ extras = {}
+ dvar = d.getVar('PKGD')
+ for root in [ '${base_sbindir}' ]:
+ root = d.expand(root)
+ for walkroot, dirs, files in os.walk(dvar + root):
+ for f in files:
+ file = os.path.join(walkroot, f)
+ if not os.path.islink(file):
+ continue
+
+ pkg = os.path.basename(os.readlink(file))
+ extras[pkg] = extras.get(pkg, '') + ' ' + file.replace(dvar, '', 1)
+
+ pn = d.getVar('PN')
+ for pkg, links in extras.items():
+ of = d.getVar('FILES_' + pn + '-' + pkg)
+ links = of + links
+ d.setVar('FILES_' + pn + '-' + pkg, links)
}
# we must execute before update-alternatives PACKAGE_PREPROCESS_FUNCS