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

dpkg-genchanges: always list all binary packages in the Description field

Raphael Hertzog пре 18 година
родитељ
комит
15fa75bd71
3 измењених фајлова са 22 додато и 12 уклоњено
  1. 5 0
      ChangeLog
  2. 4 0
      debian/changelog
  3. 13 12
      scripts/dpkg-genchanges.pl

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+2008-01-31  Raphael Hertzog  <hertzog@debian.org>
+
+	* scripts/dpkg-genchanges.pl: Always list all binary packages in
+	the Description field of generated .changes files.
+
 2008-01-30  Justin Pryzby  <jpryzby+d@quoininc.com>
 
 	* utils/start-stop-daemon.c (do_help): Clarify --name and --user

+ 4 - 0
debian/changelog

@@ -21,6 +21,10 @@ dpkg (1.14.17) UNRELEASED; urgency=low
     libraries.
   * Add -R option to dpkg-buildpackage so that one can replace the usual
     "debian/rules" by something else. Closes: #355654
+  * Always list all binary packages in the Description: field of .changes
+    files. It's nice for reviewers and mentors.debian.net was using this field
+    on source only uploads to display short description of what the package is
+    about.
 
   [ Updated manpages translations ]
   * German (Helge Kreutzmann).

+ 13 - 12
scripts/dpkg-genchanges.pl

@@ -267,13 +267,20 @@ foreach $_ (keys %{$src_fields}) {
     }
 }
 
-# Scan control info of all binary packages unless
-# we have a source only upload
-my @pkg;
-push @pkg, $control->get_packages() unless is_sourceonly;
-foreach my $pkg (@pkg) {
+# Scan control info of all binary packages
+foreach my $pkg ($control->get_packages()) {
     my $p = $pkg->{"Package"};
     my $a = $pkg->{"Architecture"};
+    my $d = $pkg->{"Description"} || "no description available";
+    $d = $1 if $d =~ /^(.*)\n/;
+
+    my @f; # List of files for this binary package
+    push @f, @{$p2f{$p}} if defined $p2f{$p};
+
+    # Add description of all binary packages
+    my $desc = sprintf("%-10s - %-.65s", $p, $d);
+    $desc .= " (udeb)" if (grep(/\.udeb$/, @f)); # XXX: Check Package-Type field instead
+    push @descriptions, $desc;
 
     if (not defined($p2f{$p})) {
 	# No files for this package... warn if it's unexpected
@@ -286,18 +293,12 @@ foreach my $pkg (@pkg) {
 	next; # and skip it
     }
 
-    my @f = @{$p2f{$p}}; # List of files for this binary package
     $p2arch{$p} = $a;
 
     foreach $_ (keys %{$pkg}) {
 	my $v = $pkg->{$_};
 
-	if (m/^Description$/) {
-	    $v = $1 if $v =~ m/^(.*)\n/;
-	    my $desc = sprintf("%-10s - %-.65s", $p, $v);
-	    $desc .= " (udeb)" if (grep(/\.udeb$/, @f));
-	    push @descriptions, $desc;
-	} elsif (m/^Section$/) {
+	if (m/^Section$/) {
 	    $f2seccf{$_} = $v foreach (@f);
 	} elsif (m/^Priority$/) {
 	    $f2pricf{$_} = $v foreach (@f);