Explorar o código

scripts: Switch raw information output to use info()

Guillem Jover %!s(int64=10) %!d(string=hai) anos
pai
achega
579db424c7
Modificáronse 3 ficheiros con 8 adicións e 5 borrados
  1. 1 0
      debian/changelog
  2. 3 3
      scripts/dpkg-buildpackage.pl
  3. 4 2
      scripts/dpkg-genchanges.pl

+ 1 - 0
debian/changelog

@@ -70,6 +70,7 @@ dpkg (1.18.5) UNRELEASED; urgency=medium
     - <new-prerm> failed-upgrade <old-version> <new-version>
     Prompted by Andrey Utkin <andrey.krieger.utkin@gmail.com>.
   * Promote a print to a warning for missing control files in dpkg-deb.
+  * Use info() instead of print in dpkg-buildpackage and dpkg-genchanges.
   * Portability:
     - Move DPKG_ADMINDIR environment variable name out from update-alternatives
       code, to make life easier for non-dpkg-based systems.

+ 3 - 3
scripts/dpkg-buildpackage.pl

@@ -558,7 +558,7 @@ chdir('..') or syserr('chdir ..');
 withecho('dpkg-source', @source_opts, '--after-build', $dir);
 chdir($dir) or syserr("chdir $dir");
 
-printf "$Dpkg::PROGNAME: %s\n", describe_build($changes->{'Files'});
+info(describe_build($changes->{'Files'}));
 
 run_hook('check', $check_command);
 
@@ -609,7 +609,7 @@ sub mustsetvar {
     error(g_('unable to determine %s'), $text)
 	unless defined($var);
 
-    print "$Dpkg::PROGNAME: $text $var\n";
+    info("$text $var");
     return $var;
 }
 
@@ -625,7 +625,7 @@ sub run_hook {
 
     return if not $cmd;
 
-    print { *STDERR } "$Dpkg::PROGNAME: running hook $name\n";
+    info("running hook $name");
 
     my %hook_vars = (
         '%' => '%',

+ 4 - 2
scripts/dpkg-genchanges.pl

@@ -179,6 +179,9 @@ while (@ARGV) {
     }
 }
 
+# Do not pollute STDOUT with info messages.
+report_options(info_fh => \*STDERR, quiet_warnings => $quiet);
+
 # Retrieve info from the current changelog entry
 my %options = (file => $changelogfile);
 $options{changelogformat} = $changelogformat if $changelogformat;
@@ -413,8 +416,7 @@ for my $p (keys %p2f) {
     }
 }
 
-print { *STDERR } "$Dpkg::PROGNAME: $origsrcmsg\n"
-    or syserr(g_('write original source message')) unless $quiet;
+info($origsrcmsg);
 
 $fields->{'Format'} = $substvars->get('Format');