summaryrefslogtreecommitdiff
path: root/scripts/Dpkg/Dist
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2016-11-06 07:42:11 +0100
committerGuillem Jover <guillem@debian.org>2016-11-06 07:43:44 +0100
commit1095fdab355a0e41114e753827dc41dd3d8b879c (patch)
treed9a1d1119f51c1eff7eae63c87d575ecf4ac6efc /scripts/Dpkg/Dist
parentf7e8c9bbf1dfb8e26c11a66625dba34301585e7e (diff)
downloaddpkg-1095fdab355a0e41114e753827dc41dd3d8b879c.tar.gz
Dpkg::Dist::Files: Do not try to load non-files in load_dir method
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.
Diffstat (limited to 'scripts/Dpkg/Dist')
-rw-r--r--scripts/Dpkg/Dist/Files.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/Dpkg/Dist/Files.pm b/scripts/Dpkg/Dist/Files.pm
index 2c4ab53ce..347f58e5d 100644
--- a/scripts/Dpkg/Dist/Files.pm
+++ b/scripts/Dpkg/Dist/Files.pm
@@ -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;