Bug#626476: lintian: reduce dpkg-dev to Suggests
On Sat, May 14, 2011 at 07:50:45PM +0200, Niels Thykier wrote:
> On 2011-05-13 11:19, Niels Thykier wrote:
> > I had a short chat with Raphaël Hertzog (buxy) in #debian-qa about this
> > and he said that the unpacking part of the module was rather stable and
> > "it's certainly ok as a fallback when dpkg-source is not there".
> >
> > So as long as we only need dpkg-source -x (and not dpkg-source -b) we
> > can use libdpkg-perl.
>
> Functional proof-of-concept patch; simply apply and profit! The code is
> stolen from dpkg-source and cooked down a bit (... a lot).
>
> The patch here disables dpkg-source unpacking all together (saves you
> from peeling out dpkg-dev from a system).
That's a bit further than what Raphaël said this API was OK for - not
just "a fallback when dpkg-source is not there". Have you
double-checked that with him?
> The patch does not account for updating the Lintian Depends; I suspect
> that dpkg-dev should be replaced with bzip2, xz-utils and
> libdpkg-perl. The former two can be most likely be left out if you
> know there are no bz2 / xz / lmza sources.
Or perhaps we can just rely on libdpkg-perl's Recommends of bzip2 and
xz-utils?
> I had to redirect STDOUT of unpacked to keeping it the unpack process
> quiet (otherwise it would break the output format of Lintian)[1].
You're right that Dpkg::ErrorHandling::report_options isn't marked as
stable, but shouldn't we at least be using options => { quiet => 1 } as
an argument to Dpkg::Source::Package->new as well as this, to match
dpkg-source -q? It doesn't do much right now, but in principle it seems
as though it might avoid noise on stderr.
> + libdpkg_unpack_dsc ('dsc', 'unpacked');
Style nit: no space before the open parenthesis.
> +sub libdpkg_unpack_dsc {
> + my ($dsc, $target) = @_;
> + require Dpkg::Source::Package;
> + open(STDOUT, '>', '/dev/null') or fail "Redirecting stdout failed: $!";
> + # Create the object that does everything
> + my $srcpkg = Dpkg::Source::Package->new(filename => $dsc);
> +
> + $srcpkg->check_checksums();
> +
> + # Unpack the source package (delegated to Dpkg::Source::Package::*)
> + $srcpkg->extract($target);
> + return 1;
> +}
This drops the signature check currently performed by dpkg-source, so it
changes Lintian's behaviour to (a) accept .dsc files with bad signatures
and (b) stop issuing a warning for unsigned .dsc files. This seems
undesirable.
Aside from that, the patch does seem to work as advertised. Thanks!
--
Colin Watson [cjwatson@ubuntu.com]
Reply to: