Commit 71d3ba72 authored by Mattia Rizzolo's avatar Mattia Rizzolo

Merge branch '915668-debi-other-archs' of salsa.debian.org:smcv/devscripts

MR: debian/devscripts!93Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parents d513cffd 941f76ed
devscripts (2.19.3) UNRELEASED; urgency=medium
[ Mattia Rizzolo ]
* grep-excuses:
+ Add a patch from Niels Thykier to fix a possible crash. Closes: #919191
[ Simon McVittie ]
* debc/debi:
+ List packages of any architecture.
+ Consider installing foreign 'Multi-Arch: same' packages, as long as they
belong of a known foreign architecture.
+ Closes: #915668; MR: !93
-- Mattia Rizzolo <mattia@debian.org> Sat, 12 Jan 2019 20:41:40 +0100
devscripts (2.19.2) unstable; urgency=medium
......
......@@ -32,6 +32,8 @@ use filetest 'access';
use Cwd;
use Dpkg::Control;
use Dpkg::Changelog::Parse qw(changelog_parse);
use IPC::Run qw(run);
use IO::Handle;
my $progname = basename($0, '.pl'); # the '.pl' is for when we're debugging
my $modified_conf_msg;
......@@ -242,6 +244,12 @@ if ($? != 0 or !$arch) {
}
chomp $arch;
my @foreign_architectures;
unless ($opt_a || $opt_t || $progname eq 'debc') {
@foreign_architectures
= map { chomp; $_ } `dpkg --print-foreign-architectures`;
}
my $chdir = 0;
if (!defined $changes) {
......@@ -363,12 +371,23 @@ for (split(/\n/, $ctrl->{Files})) {
# udebs are only supported for debc
if ( (($progname eq 'debi') && (/ (\S*\.deb)$/))
|| (($progname eq 'debc') && (/ (\S*\.u?deb)$/))) {
my $deb = $1;
$deb =~ /^([a-z0-9+\.-]+)_/ or warn "unrecognised .deb name: $deb\n";
# don't want other archs' .debs:
next unless $deb =~ /[_+]($arch|all)[\.+]/;
my $pkg = $deb;
$pkg =~ s/_.*$//;
my $deb = $1;
my $stdout = IO::Handle->new();
run(['dpkg-deb', '-f', $deb], '>pipe', \*$stdout);
my $fields = Dpkg::Control->new(name => $deb, type => CTRL_PKG_DEB);
$fields->parse($stdout, $deb);
my $pkg = $fields->{Package};
# don't want to install other archs' .debs, unless they are
# Multi-Arch: same:
next
unless (
$progname eq 'debc'
|| $fields->{Architecture} eq 'all'
|| $fields->{Architecture} eq $arch
|| (($fields->{'Multi-Arch'} || 'no') eq 'same'
&& grep { $_ eq $fields->{Architecture} }
@foreign_architectures));
if (@ARGV) {
if (exists $pkgs{$pkg}) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment