From 8513b237afbdb59a4a59d1bc707d37f0aa9138f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Hertzog?= Date: Thu, 4 Aug 2022 19:51:56 +0200 Subject: [PATCH] Implement recursive lookup of Recommends and Suggests Everywhere where we call add_missing() on Depends, we must do it also on Recommends and Suggests based on $add_rec and $add_sug. Closes: #601203 --- debian/changelog | 2 ++ tools/sort_deps | 28 +++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index e0a1fb98..7cec68d9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,8 @@ debian-cd (3.1.36) UNRELEASED; urgency=medium * Add cryptsetup-initramfs to tools/generate_di+k_list as cryptsetup 2.4.0 dropped the recommends on the package and it's needed by d-i. * Fix install_firmwares_initrd to not fail when the firmware is not found. + * Implement recursive lookup of Recommends and Suggests in sort_deps. + Closes: #601203 [ Wolfgang Schweer ] * data/bookworm: Use Debian Edu 12 installer logo and syslinux splash image diff --git a/tools/sort_deps b/tools/sort_deps index a2425301..ea0587d3 100755 --- a/tools/sort_deps +++ b/tools/sort_deps @@ -984,12 +984,25 @@ sub get_missing { my @parents = (); my %t; my $dep_text; + my $found_missing = 0; $t{"Package"} = $p; $t{"CmpOp"} = ""; $t{"Version"} = ""; - if (not add_missing (\@deps_list, $packages{$p}{"Depends"}, \%t, 0, \@parents, $check_backports)) { + if (add_missing (\@deps_list, $packages{$p}{"Depends"}, \%t, 0, \@parents, $check_backports)) { + $found_missing = 1; + } + + if ($add_rec and add_missing (\@deps_list, $packages{$p}{"Recommends"}, \%t, 1, \@parents, $check_backports)) { + $found_missing = 1; + } + + if ($add_sug and add_missing (\@deps_list, $packages{$p}{"Suggests"}, \%t, 1, \@parents, $check_backports)) { + $found_missing = 1; + } + + if (not $found_missing) { return (); } @@ -1125,6 +1138,12 @@ sub add_missing { push (@{$list}, $pkg); if (add_missing ($list, $packages{$pkgname}{"Depends"}, $pkg, $soft_depend, $parents, $check_backports)) { $or_ok = 1; + if ($add_rec) { + add_missing ($list, $packages{$pkgname}{"Recommends"}, $pkg, 1, $parents, $check_backports); + } + if ($add_sug) { + add_missing ($list, $packages{$pkgname}{"Suggests"}, $pkg, 1, $parents, $check_backports); + } remove_entry($pkg, $list); push @{$list}, $pkg; last; @@ -1181,6 +1200,13 @@ sub add_missing { pop @{$list}; $ok = 0; } + } else { + if ($add_rec) { + add_missing ($list, $packages{$t{"Package"}}{"Recommends"}, \%t, 1, $parents, $check_backports); + } + if ($add_sug) { + add_missing ($list, $packages{$t{"Package"}}{"Suggests"}, \%t, 1, $parents, $check_backports); + } } remove_entry(\%t, $list); push @{$list}, \%t;