diff options
author | Guillem Jover <guillem@debian.org> | 2015-03-13 23:59:55 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2015-05-09 06:19:40 +0200 |
commit | ab15fd24dd1a8207ab1463410338f24283989f7c (patch) | |
tree | 1dbdb0df5ced829a7c084068f4ecd9b9f16e90e5 /scripts/Dpkg/Dist/Files.pm | |
parent | 715a507fc59c7cf679c7fedcd8f336697893ed27 (diff) | |
download | dpkg-ab15fd24dd1a8207ab1463410338f24283989f7c.tar.gz |
Dpkg::Dist::Files: Parse filename on add_file() to initialize files values
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 { |