diff options
Diffstat (limited to 'scripts/Dpkg/Dist/Files.pm')
-rw-r--r-- | scripts/Dpkg/Dist/Files.pm | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/scripts/Dpkg/Dist/Files.pm b/scripts/Dpkg/Dist/Files.pm index 3860f4c3d..dc9e05dfb 100644 --- a/scripts/Dpkg/Dist/Files.pm +++ b/scripts/Dpkg/Dist/Files.pm @@ -110,15 +110,12 @@ sub get_file { sub add_file { my ($self, $filename, $section, $priority) = @_; - # XXX: Ideally we'd need to parse the filename, to match the behaviour - # on parse(), and initialize the other attributes, although no code is - # in need of this for now, at least in dpkg-dev. - - $self->{files}->{$filename} = { - filename => $filename, - section => $section, - priority => $priority, - }; + my $file = $self->parse_filename($filename); + error(g_('invalid filename %s'), $filename) unless defined $file; + $file->{section} = $section; + $file->{priority} = $priority; + + $self->{files}->{$filename} = $file; } sub del_file { |