diff options
author | Raphaël Hertzog <hertzog@debian.org> | 2010-02-25 17:47:14 +0100 |
---|---|---|
committer | Raphaël Hertzog <hertzog@debian.org> | 2010-02-25 18:40:57 +0100 |
commit | 08094e069d2ae05b50dc31ba64e3f3b865e4a8e0 (patch) | |
tree | 2ddb3c791911d3fe967a34812fc9244dec128a8f /scripts/Dpkg/Control | |
parent | af71e3484e0959d45dea24e254ab1d58010e8009 (diff) | |
download | dpkg-08094e069d2ae05b50dc31ba64e3f3b865e4a8e0.tar.gz |
Dpkg::Checksums: rewrite to provide an object-oriented API
Many other modules and scripts are also updated to cope with the new API.
The API of the module should be stable from now on, hence increased
$VERSION to "1.00".
Diffstat (limited to 'scripts/Dpkg/Control')
-rw-r--r-- | scripts/Dpkg/Control/Fields.pm | 8 | ||||
-rw-r--r-- | scripts/Dpkg/Control/Hash.pm | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/scripts/Dpkg/Control/Fields.pm b/scripts/Dpkg/Control/Fields.pm index 8f14d9f19..f0a17c4b0 100644 --- a/scripts/Dpkg/Control/Fields.pm +++ b/scripts/Dpkg/Control/Fields.pm @@ -24,7 +24,7 @@ use base qw(Exporter); use Dpkg::Gettext; use Dpkg::ErrorHandling; use Dpkg::Control::Types; -use Dpkg::Checksums qw(@check_supported %check_supported); +use Dpkg::Checksums; use Dpkg::Vendor qw(run_vendor_hook); our @EXPORT = qw(field_capitalize field_is_official field_is_allowed_in @@ -266,9 +266,9 @@ our %FIELDS = ( }, ); -my @checksum_fields = map { field_capitalize("Checksums-$_") } @check_supported; +my @checksum_fields = map { field_capitalize("Checksums-$_") } checksums_get_list(); my @sum_fields = map { $_ eq "md5" ? "MD5sum" : field_capitalize($_) } - @check_supported; + checksums_get_list(); &field_register($_, CTRL_PKG_SRC | CTRL_FILE_CHANGES) foreach @checksum_fields; &field_register($_, CTRL_INDEX_PKG) foreach @sum_fields; @@ -353,7 +353,7 @@ sub field_capitalize($) { my $field = lc(shift); # Some special cases due to history return "MD5sum" if $field eq "md5sum"; - return uc($field) if exists $check_supported{$field}; + return uc($field) if checksums_is_supported($field); # Generic case return join '-', map { ucfirst } split /-/, $field; } diff --git a/scripts/Dpkg/Control/Hash.pm b/scripts/Dpkg/Control/Hash.pm index b613da40d..2633b4f97 100644 --- a/scripts/Dpkg/Control/Hash.pm +++ b/scripts/Dpkg/Control/Hash.pm @@ -375,7 +375,7 @@ package Dpkg::Control::Hash::Tie; # type Dpkg::Control. use Dpkg::ErrorHandling; -use Dpkg::Checksums qw(%check_supported); +use Dpkg::Checksums; use Tie::Hash; use base qw(Tie::ExtraHash); @@ -384,7 +384,7 @@ sub field_capitalize($) { my $field = lc(shift); # Some special cases due to history return "MD5sum" if $field eq "md5sum"; - return uc($field) if exists $check_supported{$field}; + return uc($field) if checksums_is_supported($field); # Generic case return join '-', map { ucfirst } split /-/, $field; } |