#809300 util/pkg-list lists udeb dependencies for excluded udebs

Package:
debian-installer
Source:
debian-installer
Description:
Debian Installer documentation
Submitter:
Martin Michlmayr
Date:
2015-12-30 04:45:04 UTC
Severity:
normal
#809300#5
Date:
2015-12-29 04:54:57 UTC
From:
To:
pkg-lists/netboot/armel.cfg contains:
usb-serial-modules-${kernel:Version} ?
so usb-serial-modules is included when available.

Now put the following line in
pkg-lists/netboot/network-console/armel/orion5x.cfg
usb-serial-modules-${kernel:Version} -
to exclude the usb-serial-modules udeb.

util/pkg-list correctly does NOT list usb-serial-modules for the
network-console orion5x type.

However, it incorrectly adds usb-modules, a dependency of
usb-serial-modules which is to be excluded.  Only usb-serial-modules
pulled in usb-modules, no other udeb, so it doesn't make sense to
include usb-modules when usb-serial-modules is excluded.

The log shows this:

pkg-lists:          excluding usb-serial-modules-4.3.0-1-orion5x-di
....
pkg-lists:          adding usb-serial-modules-4.3.0-1-orion5x-
pkg-lists:          collecting dependencies for usb-serial-modules-4.3.0-1-orion5x-
pkg-lists:              added kernel-image-4.3.0-1-orion5x-di for usb-serial-modules-4.3.0-1-orion5x-
pkg-lists:              added usb-modules-4.3.0-1-orion5x-di for usb-serial-modules-4.3.0-1-orion5x-
pkg-lists:              collecting dependencies for usb-modules-4.3.0-1-orion5x-di
pkg-lists:                  added kernel-image-4.3.0-1-orion5x-di for usb-modules-4.3.0-1-orion5x-di

In the end, usb-serial-modules is not listed since it's excluded, but
the dependency (usb-modules) was added and will be listed.

The following workaround works for me but I'm not sure if it's the
right approach.

diff --git a/build/util/pkg-list b/build/util/pkg-list
index 29c56c9..6ef74b8 100755
--- a/build/util/pkg-list
+++ b/build/util/pkg-list
@@ -101,9 +101,13 @@ sub collectpackage {
 	}
 	else {
 		my $package=$line;
+                if (exists $exclude->{$package}) {
+                  debug 0, "ignored skipped $package";
+                } else {
 		$collect->{$package}=1;
 		debug 0, "adding $package";
 		collectdeps($package, $collect, $postponed);
+                }
 	}
 }

#809300#10
Date:
2015-12-29 18:19:11 UTC
From:
To:
I forgot to mention that I called pkg-list like this:

./util/pkg-list netboot/network-console "" di 2.6 "orion5x" 4.3.0-1-orion5x

#809300#15
Date:
2015-12-30 04:44:17 UTC
From:
To:
Hi,

Martin Michlmayr <tbm@cyrius.com> (2015-12-28):

I'm travelling these days so can't really look, but it would be nice if
someone could double check what happens in d-i daily builds before/after
such a change.

Probably easiest by logging in on dillon and diffing files there. Feel
free to poke me after a commit so that I can look into doing so.

Mraw,
KiBi.