Non-Linux systems allow to open directories, which return their contents, this makes the load method fail with parsing errors. Make the code only try to ever load regular files.
@@ -1,6 +1,8 @@
dpkg (1.18.13) UNRELEASED; urgency=medium
- *
+ * Perl modules:
+ - Do not try to load non-files in Dpkg::Dist::Files load_dir method.
+ Fixes test failures on non-Linux architectures.
-- Guillem Jover <guillem@debian.org> Sun, 06 Nov 2016 06:28:11 +0100
@@ -110,7 +110,9 @@ sub load_dir {
my $dh = IO::Dir->new($dir) or syserr(g_('cannot open directory %s'), $dir);
while (defined(my $file = $dh->read)) {
- $count += $self->load("$dir/$file");
+ my $pathname = "$dir/$file";
+ next unless -f $pathname;
+ $count += $self->load($pathname);
}
return $count;