Quellcode durchsuchen

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 vor 16 Jahren
Ursprung
Commit
a7abd18299
3 geänderte Dateien mit 6 neuen und 4 gelöschten Zeilen
  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.
     true if the version is valid, false otherwise.
   * Update dpkg-shlibdeps to always use Dpkg::Version now that it can
   * Update dpkg-shlibdeps to always use Dpkg::Version now that it can
     contain the empty version string. Closes: #556786
     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
  -- 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
 =cut
 
 
-sub field_transfer_single($$_) {
+sub field_transfer_single($$;$) {
     my ($from, $to, $field) = @_;
     my ($from, $to, $field) = @_;
+    $field = $_ unless defined $field;
     my ($from_type, $to_type) = ($from->get_type(), $to->get_type());
     my ($from_type, $to_type) = ($from->get_type(), $to->get_type());
     $field = field_capitalize($field);
     $field = field_capitalize($field);
 
 

+ 3 - 3
scripts/Dpkg/Version.pm

@@ -270,7 +270,7 @@ of the character is used to sort between characters.
 =cut
 =cut
 
 
 sub version_compare_string($$) {
 sub version_compare_string($$) {
-    sub order(_) {
+    sub order {
         my ($x) = @_;
         my ($x) = @_;
 	if ($x eq '~') {
 	if ($x eq '~') {
 	    return -1;
 	    return -1;
@@ -282,8 +282,8 @@ sub version_compare_string($$) {
 	    return ord($x) + 256;
 	    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) {
     while (1) {
         my ($a, $b) = (shift @a, shift @b);
         my ($a, $b) = (shift @a, shift @b);
         return 0 if not defined($a) and not defined($b);
         return 0 if not defined($a) and not defined($b);