Просмотр исходного кода

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.
Raphaël Hertzog лет назад: 16
Родитель
Сommit
a7abd18299
3 измененных файлов с 6 добавлено и 4 удалено
  1. 1 0
      debian/changelog
  2. 2 1
      scripts/Dpkg/Control/Fields.pm
  3. 3 3
      scripts/Dpkg/Version.pm

+ 1 - 0
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
 

+ 2 - 1
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);
 

+ 3 - 3
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);