Add proper support for virtual packages in check-mir, basing the determination solely off of binary packages. This is not expected to be a typical case.

This commit is contained in:
Simon Quigley 2024-01-10 20:03:44 -06:00
parent e90ceaf26b
commit a5185e4612
2 changed files with 37 additions and 3 deletions

View File

@ -47,10 +47,41 @@ def check_support(apt_cache, pkgname, alt=False):
else: else:
prefix = " * " + pkgname prefix = " * " + pkgname
try: prov_packages = apt_cache.get_providing_packages(pkgname)
if pkgname in apt_cache:
pkg = apt_cache[pkgname] pkg = apt_cache[pkgname]
except KeyError:
print(prefix, "does not exist (pure virtual?)", file=sys.stderr) # If this is a virtual package, iterate through the binary packages that
# provide this, and ensure they are all in Main. Source packages in and of
# themselves cannot provide virtual packages, only binary packages can.
elif len(prov_packages) > 0:
supported, unsupported = [], []
for pkg in prov_packages:
candidate = pkg.candidate
if candidate:
section = candidate.section
if section.startswith("universe") or section.startswith("multiverse"):
unsupported.append(pkg.name)
else:
supported.append(pkg.name)
if len(supported) > 0:
msg = "is a virtual package, which is provided by the following "
msg += "candidates in Main: " + " ".join(supported)
print(prefix, msg)
elif len(unsupported) > 0:
msg = "is a virtual package, but is only provided by the "
msg += "following non-Main candidates: " + " ".join(unsupported)
print(prefix, msg, file=sys.stderr)
return False
else:
msg = "is a virtual package that exists but is not provided by "
msg += "package currently in the archive. Proceed with caution."
print(prefix, msg, file=sys.stderr)
return False
else:
print(prefix, "does not exist", file=sys.stderr)
return False return False
section = pkg.candidate.section section = pkg.candidate.section

3
debian/changelog vendored
View File

@ -3,6 +3,9 @@ ubuntu-dev-tools (0.198) UNRELEASED; urgency=medium
* In check-mir, ignore debhelper-compat when checking the build * In check-mir, ignore debhelper-compat when checking the build
dependencies. This is expected to be a build dependency of all packages, dependencies. This is expected to be a build dependency of all packages,
so warning about it in any way is surely a red herring. so warning about it in any way is surely a red herring.
* Add proper support for virtual packages in check-mir, basing the
determination solely off of binary packages. This is not expected to be a
typical case.
-- Simon Quigley <tsimonq2@debian.org> Wed, 10 Jan 2024 18:54:07 -0600 -- Simon Quigley <tsimonq2@debian.org> Wed, 10 Jan 2024 18:54:07 -0600