Hi Steve, Wolfgang tested a patch for "#601203: tested patch for adding support for recursivly including recommends" and asked me for review and pushing it into debian-cd.git.
As I know how busy you are incl. with the shim-signed stuff, I've decided to push it to a h01ger/601203 branch and not master :) This patch (or rather these two small patches...) have been proven to work using the simple-cdd wrapper for debian-cd to build an ISO image like this: DISKTYPE=BD NORECOMMENDS=0 build-simple-cdd --dist buster --profiles xfce where xfce refers to a profile file ./profiles/xfce.packages which has a single entry, 'task-xfce-desktop'. This causes all recommends to be on the generated ISO. If called with NORECOMMENDS=1 (or NORECOMMENDS unset) it works as expected and doesnt include any recommends on the ISO (just the depends are there then.). (A second test has made with the same results using the education-ltsp-server metapackage instead of xfce.) We (Debian Edu) really really really would like to see this merged, as else the maintenance of the Edu BD image will be a PITA as the education-tasks-* metapackages heavily use recommends (due to the design of the blends-dev framework). For convinience I've also attached the patches to this mail. -- tschau, Holger ------------------------------------------------------------------------------- holger@(debian|reproducible-builds|layer-acht).org PGP fingerprint: B8BF 5413 7B09 D35C F026 FE9D 091A B856 069A AA1C
From 84878a80ab0f0560e9a55b2d5956c8707fd7b74e Mon Sep 17 00:00:00 2001 From: Wolfgang Schweer <wschw...@arcor.de> Date: Fri, 1 Mar 2019 11:27:46 +0100 Subject: [PATCH 1/3] Enable to pull in Recommends recursively To enable set NORECOMMENDS=0 in the build environment. (Closes: #601203) --- tools/sort_deps | 51 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/tools/sort_deps b/tools/sort_deps index 2bdbfcf..8582b90 100755 --- a/tools/sort_deps +++ b/tools/sort_deps @@ -24,7 +24,7 @@ my $extranonfree = read_env('EXTRANONFREE', 0); my $force_firmware = read_env('FORCE_FIRMWARE', 0); my $local = read_env('LOCAL', 0); my $complete = read_env('COMPLETE', 0); -my $norecommends = read_env('NORECOMMENDS', 1); +my $norecommends = (defined $ENV{'NORECOMMENDS'} ? $ENV{'NORECOMMENDS'} : 1); my $nosuggests = read_env('NOSUGGESTS', 1); my $verbose = read_env('VERBOSE', 0); my $max_pkg_size = read_env('MAX_PKG_SIZE', 9999999999999); @@ -87,8 +87,8 @@ msg(1, "Include non-free packages: "); msg(1, yesno($nonfree)."\n"); msg(1, "Force inclusion of firmware packages: "); msg(1, yesno($force_firmware)."\n"); -msg(1, "Ignore Recommends: "); -msg(1, yesno($norecommends)."\n"); +msg(1, "Include Recommends: "); +msg(1, yesno(!$norecommends)."\n"); msg(1, "Ignore Suggests: "); msg(1, yesno($nosuggests)."\n"); msg(1, "Maximum allowed package size: $max_pkg_size bytes\n"); @@ -647,6 +647,7 @@ sub check_versions { # Check if a specific dependency package is installed already sub dep_pkg_included { my $p = shift; + my $add_rec = shift; my $check_backports = shift; my %d = %$p; my $pn = $d{"Package"}; @@ -741,16 +742,17 @@ sub fix_backport_depends { # dependency or any one of an OR array sub dep_satisfied { my $p = shift; + my $add_rec = shift; my $check_backports = shift; if ("ARRAY" eq ref $p) { foreach (@{$p}) { - if (dep_pkg_included($_, $check_backports)) { + if (dep_pkg_included($_, $add_rec, $check_backports)) { return 1; } } } elsif ("HASH" eq ref $p) { - return dep_pkg_included($p, $check_backports); + return dep_pkg_included($p, $add_rec, $check_backports); } else { } return 0; @@ -864,7 +866,7 @@ sub add_package { } # Get all dependencies (not yet included) of each package - my (@dep) = (get_missing ($p, $check_backports)); + my (@dep) = (get_missing ($p, $add_rec, $check_backports)); # Stop here if apt failed if (not scalar(@dep)) { @@ -881,7 +883,7 @@ sub add_package { msg(3, " \@dep before checklist = " . dump_depend(\@dep) . "\n"); # Check if all packages are allowed (fail if one cannot) - ($ok, $reasons) = check_list (\@dep, 1, $check_backports); + ($ok, $reasons) = check_list (\@dep, 1, $add_rec, $check_backports); if (not $ok) { msg(2, "Can't add $p ... one of the packages needed has " . "been refused. Reasons: $reasons\n"); @@ -891,12 +893,11 @@ sub add_package { msg(3, " \@dep after checklist = " . dump_depend(\@dep) . "\n"); if ($add_rec) { - #TODO: Look for recommends (not yet included !!) - add_recommends (\@dep, $p, $check_backports); + add_recommends (\@dep, $p, $add_rec, $check_backports); msg(3, " \@dep after add_recommends = " . dump_depend(\@dep) . "\n"); # Check again but doesn't fail if one of the package cannot be # installed, just ignore it (it will be removed from @dep) - ($ok, $reasons) = check_list (\@dep, 0, $check_backports); + ($ok, $reasons) = check_list (\@dep, 0, $add_rec, $check_backports); if (not $ok) { msg(0, "UNEXPECTED: It shouldn't fail here !\n"); return; @@ -906,11 +907,11 @@ sub add_package { if ($add_sug) { #TODO: Look for suggests (not yet included !!) - add_suggests (\@dep, $p, $check_backports); + add_suggests (\@dep, $p, $add_rec, $check_backports); msg(3, " \@dep after add_suggests = " . dump_depend(\@dep) . "\n"); # Check again but doesn't fail if one of the package cannot be # installed, just ignore it (it will be removed from @dep) - ($ok, $reasons) = check_list (\@dep, 0, $check_backports); + ($ok, $reasons) = check_list (\@dep, 0, $add_rec, $check_backports); if (not $ok) { msg(0, "UNEXPECTED: It shouldn't fail here !\n"); return; @@ -938,6 +939,7 @@ sub accepted { sub add_suggests { my $deps_list = shift; my $pkg = shift; + my $add_rec = shift; my $check_backports = shift; my @parents = ($pkg); my $p; # = shift; @@ -946,13 +948,14 @@ sub add_suggests { foreach $p (@copy) { my %t = %$p; my $pkgname = $t{"Package"}; - add_missing($deps_list, $packages{$pkgname}{"Suggests"}, \%t, 1, \@parents, $check_backports); + add_missing($deps_list, $packages{$pkgname}{"Suggests"}, \%t, 1, \@parents, $add_rec, $check_backports); } } sub add_recommends { my $deps_list = shift; my $pkg = shift; + my $add_rec = shift; my $check_backports = shift; my @parents = ($pkg); my $p; # = shift; @@ -961,12 +964,13 @@ sub add_recommends { foreach $p (@copy) { my %t = %$p; my $pkgname = $t{"Package"}; - add_missing($deps_list, $packages{$pkgname}{"Recommends"}, \%t, 1, \@parents, $check_backports); + add_missing($deps_list, $packages{$pkgname}{"Recommends"}, \%t, 1, \@parents, $add_rec, $check_backports); } } sub get_missing { my $p = shift; + my $add_rec = shift; my $check_backports = shift; my @deps_list = (); my @parents = (); @@ -977,7 +981,7 @@ sub get_missing { $t{"CmpOp"} = ""; $t{"Version"} = ""; - if (not add_missing (\@deps_list, $packages{$p}{"Depends"}, \%t, 0, \@parents, $check_backports)) { + if (not add_missing (\@deps_list, $packages{$p}{"Depends"}, \%t, 0, \@parents, $add_rec, $check_backports)) { return (); } @@ -998,6 +1002,7 @@ sub add_missing { my $ok = 1; my $soft_depend = shift; my $parents = shift; + my $add_rec = shift; my $check_backports = shift; my $pkgname; my (%pkgin); @@ -1034,7 +1039,7 @@ sub add_missing { msg(3, " $pkgname Dep: $textout soft_depend $soft_depend\n"); # Bail out early if we can! - if (dep_satisfied ($thisdep, $check_backports)) { + if (dep_satisfied ($thisdep, $add_rec, $check_backports)) { next; } @@ -1057,7 +1062,7 @@ sub add_missing { } # Already installed? - if (dep_satisfied($pkg, $check_backports)) { + if (dep_satisfied($pkg, $add_rec, $check_backports)) { msg(3, " OR relationship already installed: " . dump_depend($pkg) . "\n"); $or_ok = 1; last; @@ -1109,7 +1114,7 @@ sub add_missing { # added successfully # FIXME! NEED TO CHECK IF VERSION DEPS ARE SATISFIED, FALL BACK TO BPO VERSION push (@{$list}, $pkg); - if (add_missing ($list, $packages{$pkgname}{"Depends"}, $pkg, $soft_depend, $parents, $check_backports)) { + if (add_missing ($list, $packages{$pkgname}{"Depends"}, $pkg, $soft_depend, $parents, $add_rec, $check_backports)) { $or_ok = 1; remove_entry($pkg, $list); push @{$list}, $pkg; @@ -1147,7 +1152,7 @@ sub add_missing { last; } } - if (dep_satisfied(\%t, $check_backports)) { + if (dep_satisfied(\%t, $add_rec, $check_backports)) { msg(1, " $pt already included\n"); next; # Already included, don't worry } @@ -1156,7 +1161,7 @@ sub add_missing { next; } push @{$list}, \%t; - if (not add_missing ($list, $packages{$t{"Package"}}{"Depends"}, \%t, $soft_depend, $parents, $check_backports)) { + if (not add_missing ($list, $packages{$t{"Package"}}{"Depends"}, \%t, $soft_depend, $parents, $add_rec, $check_backports)) { my $pkgname = $pkgin{"Package"}; msg(1, "couldn't add $pt ...\n"); if ($soft_depend) { @@ -1167,6 +1172,11 @@ sub add_missing { pop @{$list}; $ok = 0; } + } elsif ($add_rec) { + my $reclist = $packages{lc $_}{"Recommends"}; + msg(0, "trying to add recommended packages $reclist ...\n"); + # depends added successfully, add recommends too + add_missing ($list, $reclist, lc $_, $add_rec); } remove_entry(\%t, $list); push @{$list}, \%t; @@ -1233,6 +1243,7 @@ sub remove_entry { sub check_list { my $ref = shift; my $fail = shift; + my $add_rec = shift; my $check_backports = shift; my $ok = 1; my @to_remove = (); -- 2.11.0
From 0fb3d81c77168aada7fe9d1f0337f0114a361fb2 Mon Sep 17 00:00:00 2001 From: Wolfgang Schweer <wschw...@arcor.de> Date: Sun, 3 Mar 2019 17:42:08 +0100 Subject: [PATCH 2/3] Also pull in second level recommends --- tools/sort_deps | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/sort_deps b/tools/sort_deps index 8582b90..a7c5049 100755 --- a/tools/sort_deps +++ b/tools/sort_deps @@ -985,6 +985,10 @@ sub get_missing { return (); } + if (not add_missing (\@deps_list, $packages{$p}{"Recommends"}, \%t, 0, \@parents, $add_rec, $check_backports)) { + return (); + } + # Explicitly move the package itself to the end of the list, # i.e. *after* all its dependencies remove_entry(\%t, \@deps_list); -- 2.11.0
From 522e63bfe145ebc87970f4e20567a3776b975c13 Mon Sep 17 00:00:00 2001 From: Holger Levsen <hol...@layer-acht.org> Date: Mon, 4 Mar 2019 19:00:15 +0100 Subject: [PATCH 3/3] add changelog entry for Wolfgang Signed-off-by: Holger Levsen <hol...@layer-acht.org> --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index a1d2ce4..6dbb670 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ debian-cd (3.1.24) UNRELEASED; urgency=medium [ Wolfgang Schweer ] * tasks/buster/Debian-edu-full: Force missing packages onto the Edu BD. + * tools/sort_deps: add support for recursively including Recommends. This is + disabled by default, set NORECOMMENDS=0 for enabling this. Closes: #601203 -- Holger Levsen <hol...@debian.org> Wed, 20 Feb 2019 14:12:16 +0100 -- 2.11.0
signature.asc
Description: PGP signature