[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#560317: dpkg-reconfigure does not set DPKG_MAINTSCRIPT_PACKAGE (et al)



On Fri, 09 Mar 2012, Colin Watson wrote:
> happening.  The result of this work is attached, minus changelog which I
> can write up if this is acceptable.

Thank you for this! A quick comment though:

> +# Returns a list of all packages with pending triggers.
> +sub triggers_pending {
> +	my @ret;
> +	local $_;
> +
> +	open (QUERY, '-|', 'dpkg-query', '-W',
> +		'-f', '${Package} ${Triggers-Pending}\n');
> +	while (<QUERY>) {
> +		my ($pkg, @triggers) = split;
> +		push @ret, $pkg if @triggers;
> +	}
> +	close QUERY;

To be fully multi-arch compliant, you should in theory use
"${binary:Package}" instead of ${Package}. That way multi-arch: same
package will be arch-qualified.

But for backwards compatibility, you'll have to detect when
it's available. (And just testing "dpkg --assert-multiarch" will
break on Ubuntu since the current multiarch implementation there
doesn't know this field under this name)

The easiest is to put both fields in the query and to use the one
that's not empty.

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Pre-order a copy of the Debian Administrator's Handbook and help
liberate it: http://debian-handbook.info/liberation/


Reply to: