Bug#886235: dh-make-perl: Please support Contents-all by default

Niels Thykier niels at thykier.net
Wed Jan 3 11:43:08 UTC 2018


Source: dh-make-perl
Version: 0.97
Severity: normal
Control: block 649882 by -1

Hi,

Please support Contents-all files by default.

By the looks of it, it should be as simple as:


"""
  sub get_contents_files {
      my $self = shift;

      my $archspec = `dpkg --print-architecture`;
      chomp($archspec);

      my @res;

      # stolen from apt-file, contents_file_paths()
      my @cmd = (
          'apt-get',  'indextargets',
          '--format', '$(CREATED_BY) $(ARCHITECTURE) $(SUITE) $(FILENAME)'
      );
      open( my $fd, '-|', @cmd )
          or die "Cannot execute apt-get indextargets: $!\n";
      while ( my $line = <$fd> ) {
          chomp($line);
          next unless $line =~ m/^Contents-deb/;
          my ( $index_name, $arch, $suite, $filename ) = split( ' ', $line, 4 );
          next unless $arch eq $archspec;
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Adding "or $arch eq 'all'" in the above line before the semi-colon.
          if ( $self->dist ) {
              next unless $suite eq $self->dist;
          }
          push @res, $filename;
      }
      close($fd);

      return [ uniq sort @res ];
  }
"""

(Caveat: I have only done a quick source review of the code)

Source:
 https://anonscm.debian.org/cgit/pkg-perl/packages/dh-make-perl.git/tree/lib/Debian/AptContents.pm#n160

Thanks,
~Niels



More information about the pkg-perl-maintainers mailing list