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

dpkg-source: better explain how --print-format works

In the manual page, mentions that any upstream tarball must be available
in the current directory and make it obvious when a format is discarded
(for example due to lack of an upstream tarball) by displaying a message
on STDERR.
Raphaël Hertzog лет назад: 16
Родитель
Сommit
b50008f973
3 измененных файлов с 6 добавлено и 3 удалено
  1. 2 0
      debian/changelog
  2. 2 1
      man/dpkg-source.1
  3. 2 2
      scripts/dpkg-source.pl

+ 2 - 0
debian/changelog

@@ -6,6 +6,8 @@ dpkg (1.15.5.6) UNRELEASED; urgency=low
     patch. Closes: #561237
   * Fix dpkg-buildpackage to set "parallel=" in DEB_BUILD_OPTIONS instead of
     the invalid "parallel=-1" when option "-j" is given. Closes: #562038
+  * Clarify how dpkg-source --print-format works and display messages on
+    STDERR when the requested format is discarded. Closes: #560391
 
  -- Raphael Hertzog <hertzog@debian.org>  Wed, 23 Dec 2009 17:05:43 +0100
 

+ 2 - 1
man/dpkg-source.1

@@ -67,7 +67,8 @@ source package formats.
 .RI "\fB\-\-print\-format\fP " directory
 Print the source format that would be used to build the source package if
 \fBdpkg\-source \-b \fIdirectory\fR was called (in the same conditions and
-with the same options).
+with the same parameters). In particular it's important that the upstream
+tarball (if any) can be found in the current directory.
 
 .TP
 .BR \-h ", " \-\-help

+ 2 - 2
scripts/dpkg-source.pl

@@ -78,6 +78,7 @@ while (@ARGV && $ARGV[0] =~ m/^-/) {
         setopmode('-x');
     } elsif (m/^--print-format$/) {
 	setopmode('--print-format');
+	report_options(info_fh => \*STDERR); # Avoid clutter on STDOUT
     } else {
 	push @options, $_;
     }
@@ -296,8 +297,7 @@ if ($options{'opmode'} =~ /^(-b|--print-format)$/) {
         $srcpkg->upgrade_object_type(); # Fails if format is unsupported
         my ($res, $msg) = $srcpkg->can_build($dir);
         last if $res;
-        info(_g("source format `%s' discarded: %s"), $format, $msg)
-	    unless $options{'opmode'} eq "--print-format";
+        info(_g("source format `%s' discarded: %s"), $format, $msg);
     }
     if ($options{'opmode'} eq "--print-format") {
 	print $fields->{'Format'} . "\n";