Bug#826401: devscripts: FTBFS with Perl 5.24: dd-list option parsing affected by Getopt::Long change

Niko Tyni ntyni at debian.org
Sun Jun 5 10:20:35 UTC 2016


Package: devscripts
Version: 2.16.5
Severity: important
Tags: patch
User: debian-perl at lists.debian.org
Usertags: perl-5.24-transition

This package fails to build with Perl 5.24 (currently in experimental):

  ./test_dd-list
  testBinariesFromSameSource
  E: Unknown package: vim-nox
  E: Unknown package: vim-gtk
  E: Unknown package: /build/devscripts-yjxbvh/devscripts-2.16.5/test/dd-list/sources
  ASSERT:packages found expected:<0> but was:<1>
  testExtraSourceOnlyIgnored
  E: Unknown package: bzip2
  E: Unknown package: /build/devscripts-yjxbvh/devscripts-2.16.5/test/dd-list/sources
  testUseOnlyLatestVersion
  E: Unknown package: /build/devscripts-yjxbvh/devscripts-2.16.5/test/dd-list/sources
  E: Unknown package: subversion
  
  Ran 3 tests.
  
  FAILED (failures=1)
  Makefile:18: recipe for target 'test_dd-list.test' failed

A full build log is available at
  http://perl.debian.net/rebuild-logs/perl-5.24-throwaway/devscripts_2.16.5/
 
It looks like dd-list option parsing is affected by a change in Getopt::Long:
it's specifying 

  use Getopt::Long qw(:config gnu_getopt);
  [...]
  GetOptions([...], "sources|s:s@" => \$source_files, [...])

and calling dd-list in the test suite with
  scripts/dd-list.pl -s test/dd-list/sources vim-gtk vim-no

which now leaves $source_files empty and test/dd-list/sources in @ARGV.

This seems to be an intentional bufix change in Getopt::Long, see
 https://rt.cpan.org/Public/Bug/Display.html?id=39052
which says that GNU getopt compatibility means optional arguments
need to be passed with '=' on the command line, i.e.
  scripts/dd-list.pl -s=test/dd-list/sources vim-gtk vim-no

A test case is
  #!/usr/bin/perl -w
  use strict;
  use Getopt::Long qw(:config gnu_compat);
  my $files = [];
  GetOptions('f:s@' => \$files);
  print "got @$files, ARGV left: @ARGV\n";

which, when called as 't.pl -f foo bar' indeed behaves differently on
5.22 vs. 5.24.

I'm not sure what the use case for an empty '-s' option is?  It seems
like leaving '-s' out altogether gives the default behaviour of looking
for sources files in /var/lib/apt/lists, so it should be fine to require
a file argument to go with the '-s' option?

If that's the case, the attached patch should be enough to fix this. I've
verified it makes the package build on both Perl 5.22 and 5.24.
-- 
Niko Tyni   ntyni at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-dd-list-make-the-file-argument-of-the-s-option-manda.patch
Type: text/x-diff
Size: 1143 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/devscripts-devel/attachments/20160605/94b2d4dc/attachment.patch>


More information about the devscripts-devel mailing list