lib/packagedata.py: Fix broken symlinks for providers with a '/'

If a package had a provider with a '/' in it (e.g. "/bin/sh",
"/bin/bash", etc.), the generated symlinks were broken due to being at a
hard coded depth. Use oe.path.relsymlink() instead to make a correct
relative symbolic link

(From OE-Core rev: 8b1482a4e2adb7cf358d638265cf116b34078b84)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Joshua Watt
2023-12-20 11:01:02 -07:00
committed by Richard Purdie
parent a22f7d7b53
commit 72b6728f82

View File

@@ -317,7 +317,7 @@ fi
for p in bb.utils.explode_deps(rprov):
subdata_sym = pkgdatadir + "/runtime-rprovides/%s/%s" % (p, pkg)
bb.utils.mkdirhier(os.path.dirname(subdata_sym))
oe.path.symlink("../../runtime/%s" % pkg, subdata_sym, True)
oe.path.relsymlink(subdata_file, subdata_sym, True)
allow_empty = d.getVar('ALLOW_EMPTY:%s' % pkg)
if not allow_empty:
@@ -328,7 +328,7 @@ fi
if g or allow_empty == "1":
# Symlinks needed for reverse lookups (from the final package name)
subdata_sym = pkgdatadir + "/runtime-reverse/%s" % pkgval
oe.path.symlink("../runtime/%s" % pkg, subdata_sym, True)
oe.path.relsymlink(subdata_file, subdata_sym, True)
packagedfile = pkgdatadir + '/runtime/%s.packaged' % pkg
open(packagedfile, 'w').close()