From 383dcd074ebaa3e7c2f983cd281f192eb17c80b4 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Thu, 18 Jul 2013 18:40:02 +0200 Subject: 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(). --- scripts/Dpkg/Control/HashCore.pm | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'scripts/Dpkg/Control/HashCore.pm') 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 -- cgit v1.2.3