Преглед изворни кода

dpkg-genchanges, dpkg-gencontrol: avoid perl warnings

Fix dpkg-genchanges and dpkg-gencontrol to not trigger perl warnings
when the Architecture field is missing.
Raphael Hertzog пре 17 година
родитељ
комит
4f761d89c8
3 измењених фајлова са 6 додато и 4 уклоњено
  1. 2 0
      debian/changelog
  2. 1 1
      scripts/dpkg-genchanges.pl
  3. 3 3
      scripts/dpkg-gencontrol.pl

+ 2 - 0
debian/changelog

@@ -14,6 +14,8 @@ dpkg (1.15.1) UNRELEASED; urgency=low
     the desired source package format.
   * Update deb-triggers(5) and dpkg-trigger(1) to add a reference to
     /usr/share/doc/dpkg/triggers.txt.gz. Closes: #519717
+  * Avoid perl warnings in dpkg-gencontrol and dpkg-genchanges when the
+    Architecture field is missing in a binary package. Closes: #510282
 
   [ Guillem Jover ]
   * Fix typo in dpkg output (‘unexecpted’ → ‘unexpected’). Closes: #519082

+ 1 - 1
scripts/dpkg-genchanges.pl

@@ -275,7 +275,7 @@ foreach $_ (keys %{$src_fields}) {
 # Scan control info of all binary packages
 foreach my $pkg ($control->get_packages()) {
     my $p = $pkg->{"Package"};
-    my $a = $pkg->{"Architecture"};
+    my $a = $pkg->{"Architecture"} || "";
     my $d = $pkg->{"Description"} || "no description available";
     $d = $1 if $d =~ /^(.*)\n/;
     my $pkg_type = $pkg->{"Package-Type"} ||

+ 3 - 3
scripts/dpkg-gencontrol.pl

@@ -327,7 +327,7 @@ if (open(X, "<", $fileslistfile)) {
         next if m/^([-+0-9a-z.]+)_[^_]+_([\w-]+)\.(a-z+) /
                 && ($1 eq $oppackage)
 	        && ($3 eq $pkg_type)
-	        && (debarch_eq($2, $fields->{'Architecture'})
+	        && (debarch_eq($2, $fields->{'Architecture'} || "")
 		    || debarch_eq($2, 'all'));
         print(Y "$_\n") || syserr(_g("copy old entry to new files list file"));
     }
@@ -337,8 +337,8 @@ if (open(X, "<", $fileslistfile)) {
 }
 my $sversion = $fields->{'Version'};
 $sversion =~ s/^\d+://;
-$forcefilename = sprintf("%s_%s_%s.%s", $oppackage, $sversion, $fields->{'Architecture'},
-			 $pkg_type)
+$forcefilename = sprintf("%s_%s_%s.%s", $oppackage, $sversion,
+                         $fields->{'Architecture'} || "", $pkg_type)
 	   unless ($forcefilename);
 print(Y $substvars->substvars(sprintf("%s %s %s\n", $forcefilename,
 				      $fields->{'Section'} || '-',