The following commit has been merged in the master branch:
commit 383dcd074ebaa3e7c2f983cd281f192eb17c80b4
Author: Guillem Jover <[email protected]>
Date:   Thu Jul 18 18:40:02 2013 +0200

    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().

diff --git a/scripts/Dpkg/Control/HashCore.pm b/scripts/Dpkg/Control/HashCore.pm
index 53d826f..597ad37 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

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to