diff options
author | Raphaël Hertzog <hertzog@debian.org> | 2009-11-18 11:20:58 +0100 |
---|---|---|
committer | Raphaël Hertzog <hertzog@debian.org> | 2009-11-18 11:20:58 +0100 |
commit | a7abd18299bdeb6e632774b3df7636a8c4aaeb58 (patch) | |
tree | 7f4e780f0b1538ea201c25a7357b831398495409 | |
parent | 2d74173f41909fd43061fb7d81a3795a6fefc59d (diff) | |
download | dpkg-a7abd18299bdeb6e632774b3df7636a8c4aaeb58.tar.gz |
Dpkg::Control::Fields, Dpkg::Version: avoid the "_" prototype
Keep compatibility with perl 5.8 by avoiding the "_" prototype which
has been introduced in perl 5.10.
-rw-r--r-- | debian/changelog | 1 | ||||
-rw-r--r-- | scripts/Dpkg/Control/Fields.pm | 3 | ||||
-rw-r--r-- | scripts/Dpkg/Version.pm | 6 |
3 files changed, 6 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog index f7b295e3b..4b65dba92 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ dpkg (1.15.5.2) UNRELEASED; urgency=low true if the version is valid, false otherwise. * Update dpkg-shlibdeps to always use Dpkg::Version now that it can contain the empty version string. Closes: #556786 + * Keep compatibility with perl 5.8 by avoiding the _ prototype. -- Raphael Hertzog <hertzog@debian.org> Wed, 18 Nov 2009 10:21:53 +0100 diff --git a/scripts/Dpkg/Control/Fields.pm b/scripts/Dpkg/Control/Fields.pm index c4c1a0f10..673784914 100644 --- a/scripts/Dpkg/Control/Fields.pm +++ b/scripts/Dpkg/Control/Fields.pm @@ -412,8 +412,9 @@ added to $to otherwise. =cut -sub field_transfer_single($$_) { +sub field_transfer_single($$;$) { my ($from, $to, $field) = @_; + $field = $_ unless defined $field; my ($from_type, $to_type) = ($from->get_type(), $to->get_type()); $field = field_capitalize($field); diff --git a/scripts/Dpkg/Version.pm b/scripts/Dpkg/Version.pm index 3a8e281e5..e2dda9275 100644 --- a/scripts/Dpkg/Version.pm +++ b/scripts/Dpkg/Version.pm @@ -270,7 +270,7 @@ of the character is used to sort between characters. =cut sub version_compare_string($$) { - sub order(_) { + sub order { my ($x) = @_; if ($x eq '~') { return -1; @@ -282,8 +282,8 @@ sub version_compare_string($$) { return ord($x) + 256; } } - my @a = map(order, split(//, shift)); - my @b = map(order, split(//, shift)); + my @a = map(order($_), split(//, shift)); + my @b = map(order($_), split(//, shift)); while (1) { my ($a, $b) = (shift @a, shift @b); return 0 if not defined($a) and not defined($b); |