diff options
author | Guillem Jover <guillem@debian.org> | 2013-07-18 18:40:02 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2013-07-26 23:53:33 +0200 |
commit | 383dcd074ebaa3e7c2f983cd281f192eb17c80b4 (patch) | |
tree | 8d57d8c449804a272c3771e98603464ee2882753 /scripts/Dpkg/Control/HashCore.pm | |
parent | a2d801487228e2616c19461fb101190b0ccb7bd7 (diff) | |
download | dpkg-383dcd074ebaa3e7c2f983cd281f192eb17c80b4.tar.gz |
Dpkg::Control::HashCore: Switch module to use Dpkg::Control::FieldsCore
Because Dpkg::Vendor is not entangled with Dpkg::Control::FieldsCore
anymore, Dpkg::Control::HashCore will be able to use it and
Dpkg::Control::HashCore::Tie can use it now instead of duplicating
field_capitalize().
Diffstat (limited to 'scripts/Dpkg/Control/HashCore.pm')
-rw-r--r-- | scripts/Dpkg/Control/HashCore.pm | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/scripts/Dpkg/Control/HashCore.pm b/scripts/Dpkg/Control/HashCore.pm index 53d826f29..597ad371a 100644 --- a/scripts/Dpkg/Control/HashCore.pm +++ b/scripts/Dpkg/Control/HashCore.pm @@ -23,10 +23,9 @@ our $VERSION = '1.00'; use Dpkg::Gettext; use Dpkg::ErrorHandling; -# This module must absolutely not use Dpkg::Control::Fields -# it's used by other modules that are required to compile -# Dpkg::Control::Fields itself (Dpkg::Vendor) -# That's why field_capitalize is duplicated +# This module cannot use Dpkg::Control::Fields, because that one makes use +# of Dpkg::Vendor which at the same time uses this module, which would turn +# into a compilation error. We can use Dpkg::Control::FieldsCore instead. use parent qw(Dpkg::Interface::Storable); @@ -399,19 +398,11 @@ package Dpkg::Control::HashCore::Tie; # type Dpkg::Control. use Dpkg::Checksums; +use Dpkg::Control::FieldsCore; use Tie::Hash; use parent -norequire, qw(Tie::ExtraHash); -sub field_capitalize($) { - my $field = lc(shift); - # Some special cases due to history - return 'MD5sum' if $field eq 'md5sum'; - return uc($field) if checksums_is_supported($field); - # Generic case - return join '-', map { ucfirst } split /-/, $field; -} - # $self->[0] is the real hash # $self->[1] is a reference to the hash contained by the parent object. # This reference bypasses the top-level scalar reference of a |