summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/util-linux
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:31 +0000
commitc1a24f2421b48673527fafbca07eaefbe89f769c (patch)
tree5567382c54007d4c51b35004319518153259b0b9 /meta/recipes-core/util-linux
parent0548b8f39373dfe68c3e6aa0a6e52a3c93ad43cb (diff)
downloadpoky-c1a24f2421b48673527fafbca07eaefbe89f769c.tar.gz
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. (From OE-Core rev: fc709be54fee06801446774ff1a434294c2eda9b) Signed-off-by: André Draszik <andre.draszik@jci.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/util-linux')
-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 () {
52 file_regex=r'(.*)', output_pattern='${PN}-%s', 52 file_regex=r'(.*)', output_pattern='${PN}-%s',
53 description='${PN} %s', 53 description='${PN} %s',
54 hook=pkg_hook, extra_depends='', prepend=True) 54 hook=pkg_hook, extra_depends='', prepend=True)
55
56 # There are some symlinks for some binaries which we have ignored
57 # above. Add them to the package owning the binary they are
58 # pointing to
59 extras = {}
60 dvar = d.getVar('PKGD')
61 for root in [ '${base_sbindir}' ]:
62 root = d.expand(root)
63 for walkroot, dirs, files in os.walk(dvar + root):
64 for f in files:
65 file = os.path.join(walkroot, f)
66 if not os.path.islink(file):
67 continue
68
69 pkg = os.path.basename(os.readlink(file))
70 extras[pkg] = extras.get(pkg, '') + ' ' + file.replace(dvar, '', 1)
71
72 pn = d.getVar('PN')
73 for pkg, links in extras.items():
74 of = d.getVar('FILES_' + pn + '-' + pkg)
75 links = of + links
76 d.setVar('FILES_' + pn + '-' + pkg, links)
55} 77}
56 78
57# we must execute before update-alternatives PACKAGE_PREPROCESS_FUNCS 79# we must execute before update-alternatives PACKAGE_PREPROCESS_FUNCS