package_deb: Handle / in dependency name

We can end up with / in dependency names from file dependencies but the
deb format doesn't allow this. Filter the names to allow such dependencies
to work. Names have to start with an alphanumeric digit so also handle this.

This allows for future handling of "per file" dependencies similarly to
the rpm backend, bring parity to the functionality of the backends.

(From OE-Core rev: fc08972688d784f561c8be88d3100d6baaf22070)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2018-01-09 11:22:54 +00:00
parent 3da70202cc
commit 1117f74385

View File

@@ -230,9 +230,11 @@ def deb_write_pkg(pkg, d):
# '>' = greater or equal
# adjust these to the '<<' and '>>' equivalents
#
for dep in var:
if '(' in dep:
newdep = re.sub(r'[(:)]', '__', dep)
for dep in list(var.keys()):
if '(' in dep or '/' in dep:
newdep = re.sub(r'[(:)/]', '__', dep)
if newdep.startswith("__"):
newdep = "A" + newdep
if newdep != dep:
var[newdep] = var[dep]
del var[dep]