Do not mark direct dependencies of ubiquity as auto installed

This caused cryptsetup to remain auto on the installed system

LP: #1801629

Squashed commits:
* Fix change to ignore ubiquity packages, it failed to mark anything as automatic.
sil2100/backport-datasource-raspi3
Julian Andres Klode 6 years ago
parent be180bcf93
commit a38a62e09f

2
debian/changelog vendored

@ -2,6 +2,8 @@ livecd-rootfs (2.525.20) UNRELEASED; urgency=medium
* Minimize the number of manually installed packages in images by marking * Minimize the number of manually installed packages in images by marking
dependencies of metapackages as automatically installed. (LP: #1800610) dependencies of metapackages as automatically installed. (LP: #1800610)
* Do not mark direct dependencies of ubiquity as auto installed. This caused
cryptsetup to remain auto on the installed system (LP: #1801629)
-- Julian Andres Klode <juliank@ubuntu.com> Mon, 04 Mar 2019 18:00:26 +0100 -- Julian Andres Klode <juliank@ubuntu.com> Mon, 04 Mar 2019 18:00:26 +0100

@ -23,6 +23,7 @@ def main():
roots = set(pkg for pkg in cache if is_root(pkg)) roots = set(pkg for pkg in cache if is_root(pkg))
workset = set(roots) workset = set(roots)
seen = set() seen = set()
ubiquity_depends = set()
with cache.actiongroup(): with cache.actiongroup():
while True: while True:
@ -33,7 +34,7 @@ def main():
for pkg in sorted(to_proc): for pkg in sorted(to_proc):
print(" Visiting", pkg, file=sys.stderr) print(" Visiting", pkg, file=sys.stderr)
if pkg not in roots: if pkg not in roots and pkg not in ubiquity_depends:
pkg.mark_auto() pkg.mark_auto()
for dep in (pkg.installed.dependencies + for dep in (pkg.installed.dependencies +
@ -41,6 +42,16 @@ def main():
for bdep in dep.or_dependencies: for bdep in dep.or_dependencies:
for ver in bdep.target_versions: for ver in bdep.target_versions:
if ver.package.is_installed: if ver.package.is_installed:
if pkg.name == "ubiquity":
ubiquity_depends.add(ver.package)
if pkg.name != "ubiquity":
# Reprocess this package again, as we did not mark it when we visited it from ubiquity
try:
ubiquity_depends.remove(ver.package)
# This will raise the KeyError here if ubiquity did not depend on it
seen.remove(ver.package)
except KeyError:
pass
workset.add(ver.package) workset.add(ver.package)
seen.add(pkg) seen.add(pkg)

Loading…
Cancel
Save