Commit 285e8097 authored by Simon McVittie's avatar Simon McVittie
Browse files

collect-dbgsym: Skip Multi-Arch: no -dbgsym packages for foreign archs



Ubuntu 12.04 somehow has libnss3-dbgsym and libnspr4-dbgsym packages
that are Multi-Arch: no, even though their corresponding libraries are
Multi-Arch: same.
Signed-off-by: Simon McVittie's avatarSimon McVittie <smcv@collabora.com>
parent 64dc6871
......@@ -57,6 +57,11 @@ class InstalledPackage:
self.binary_version = fields[1]
self.source = fields[2] or self.binary
if ':' not in self.qualified_binary:
self.architecture = None # type: typing.Optional[str]
else:
self.architecture = self.qualified_binary.split(':')[-1]
def __str__(self):
# type: () -> str
return '{}_{}'.format(self.qualified_binary, self.binary_version)
......@@ -120,6 +125,7 @@ def main():
parser = argparse.ArgumentParser(
description='Install corresponding -dbgsym packages if available',
)
parser.add_argument('--primary-architecture', default=None)
parser.add_argument('--debug', action='store_true', default=False)
parser.add_argument('sysroot')
......@@ -156,6 +162,12 @@ def main():
to_inspect.add(
'{}={}'.format(want.qualified_dbgsym_package, want.binary_version))
if args.primary_architecture is None:
args.primary_architecture = subprocess.run(
in_chroot_quick + ['dpkg', '--print-architecture'],
stdout=subprocess.PIPE,
).stdout.decode('ascii').strip()
result = subprocess.run(
in_chroot_quick + ['apt-cache', 'show'] + list(to_inspect),
stdout=subprocess.PIPE,
......@@ -212,6 +224,18 @@ def main():
if want.binary_version != binary_stanza['Version']:
continue
if (
want.architecture is not None
and want.architecture != args.primary_architecture
and binary_stanza.get('Multi-Arch', 'no') != 'same'
):
logger.info(
'Not installing %s: not Multi-Arch: same even '
'though the library is',
want.qualified_dbgsym_package,
)
continue
logger.info(
'Installing -dbgsym package: %s_%s',
want.qualified_dbgsym_package,
......
{{- $apt_debug := or .apt_debug false -}}
{{- $architecture := or .architecture "amd64" -}}
{{- $foreignarchs := or .foreignarchs "" -}}
{{- $suite := or .suite "stretch" -}}
{{- $flatpak_arch := or .flatpak_arch $architecture -}}
{{- $packages := or .packages "" -}}
......
......@@ -1045,6 +1045,9 @@ class Builder:
'--artifactdir={}'.format(self.build_area),
'--scratchsize=8G',
'-t', 'architecture:{}'.format(self.primary_dpkg_arch),
'-t', 'foreignarchs:{}'.format(
' '.join(self.dpkg_archs[1:]),
),
'-t', 'flatpak_arch:{}'.format(self.flatpak_arch),
'-t', 'suite:{}'.format(self.apt_suite),
'-t', 'ospack:{}'.format(tarball),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment