소스 검색

dpkg-gencontrol: Unify parsing of Section and Priority fields with Homepage

Guillem Jover 18 년 전
부모
커밋
4273bd95f0
3개의 변경된 파일11개의 추가작업 그리고 12개의 파일을 삭제
  1. 7 0
      ChangeLog
  2. 1 0
      debian/changelog
  3. 3 12
      scripts/dpkg-gencontrol.pl

+ 7 - 0
ChangeLog

@@ -1,3 +1,10 @@
+2007-11-29  Guillem Jover  <guillem@debian.org>
+
+	* scripts/dpkg-gencontrol.pl: Unify parsing of Section and Priority
+	fields with Homepage.
+	(%spvalue, %spdefault): Remove unued variables.
+	(spfileslistvalue): Use %f instead of %spvalue.
+
 2007-11-29  Guillem Jover  <guillem@debian.org>
 
 	* scripts/dpkg-gencontrol.pl (spfileslistvalue): Add prototype. Move

+ 1 - 0
debian/changelog

@@ -17,6 +17,7 @@ dpkg (1.14.12) UNRELEASED; urgency=low
   [ Guillem Jover ]
   * Define several private functions and variables as static.
   * Move extern declarations to header files and stop defining them as extern.
+  * Unify parsing of Section and Priority in dpkg-gencontrol with Homepage.
 
  -- Guillem Jover <guillem@debian.org>  Sat, 24 Nov 2007 07:38:13 +0200
 

+ 3 - 12
scripts/dpkg-gencontrol.pl

@@ -42,7 +42,6 @@ my $forcefilename;
 my $stdout;
 my %remove;
 my %override;
-my (%spvalue, %spdefault);
 my $oppackage;
 my $package_type = 'deb';
 
@@ -86,7 +85,7 @@ Options:
 
 sub spfileslistvalue($)
 {
-    my $r = $spvalue{$_[0]};
+    my $r = $f{$_[0]};
     $r = '-' if !defined($r);
     return $r;
 }
@@ -162,7 +161,7 @@ for $_ (keys %fi) {
 #print STDERR "G key >$_< value >$v<\n";
 	if (m/^(Origin|Bugs|Maintainer)$/) {
 	    $f{$_} = $v;
-	} elsif (m/^Homepage$/) {
+	} elsif (m/^(Section|Priority|Homepage)$/) {
 	    # Binary package stanzas can override these fields
 	    $f{$_} = $v if !defined($f{$_});
 	} elsif (m/^Source$/) {
@@ -174,17 +173,15 @@ for $_ (keys %fi) {
 	       m/^(Standards-Version|Uploaders)$/i ||
 	       m/^Vcs-(Browser|Arch|Bzr|Cvs|Darcs|Git|Hg|Mtn|Svn)$/i) {
 	}
-	elsif (m/^Section$|^Priority$/) { $spdefault{$_}= $v; }
         else { $_ = "C $_"; &unknown(_g('general section of control info file')); }
     } elsif (s/^C$myindex //) {
 #print STDERR "P key >$_< value >$v<\n";
         if (m/^(Package|Package-Type|Description|Homepage|Tag|Essential)$/ ||
+            m/^(Section$|Priority)$/ ||
             m/^(Subarchitecture|Kernel-Version|Installer-Menu-Item)$/) {
             $f{$_}= $v;
         } elsif (exists($pkg_dep_fields{$_})) {
 	    # Delay the parsing until later
-        } elsif (m/^Section$|^Priority$/) {
-            $spvalue{$_}= $v;
         } elsif (m/^Architecture$/) {
 	    my $host_arch = get_host_arch();
 
@@ -279,12 +276,6 @@ foreach my $field (@pkg_dep_fields) {
     }
 }
 
-
-for my $f (qw(Section Priority)) {
-    $spvalue{$f} = $spdefault{$f} unless defined($spvalue{$f});
-    $f{$f} = $spvalue{$f} if defined($spvalue{$f});
-}
-
 for my $f (qw(Package Version)) {
     defined($f{$f}) || error(_g("missing information for output field %s"), $f);
 }