tags 355043 + patch fixed-upstream pending
thanks

Martin Michlmayr <[EMAIL PROTECTED]> writes:

> In my opinion log_command() is much too verbous.  I'm not really
> interested in any of those message.  Could you convert this to a
> debugging command and only enable it if a special variable is set in
> /etc/sbuild.conf.

The following patch fixes this problem.  It still prints the command
being run, but strips off all of the extra stuff to run it inside the
chroot (which was the old behaviour).  If debugging is enabled, it
will then print the complete command.


Regards,
Roger

-- 
Roger Leigh
                Printing on GNU/Linux?  http://gutenprint.sourceforge.net/
                Debian GNU/Linux        http://www.debian.org/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.
Index: sbuild
===================================================================
RCS file: /cvsroot/buildd-tools/sbuild/sbuild,v
retrieving revision 1.75
diff -u -r1.75 sbuild
--- sbuild	27 Feb 2006 11:39:39 -0000	1.75
+++ sbuild	6 Mar 2006 21:50:36 -0000
@@ -1817,7 +1817,11 @@
 	my $chroot = shift;  # Run in chroot?
 	my $cmdline = get_command_internal($command, $user, $chroot);
 
-	log_command($cmdline);
+	if ($main::debug) {
+		log_command($cmdline);
+	} else {
+		log_command($command);
+	}
 
 	return $cmdline;
 }
@@ -1830,7 +1834,11 @@
 	my $chroot = shift;  # Run in chroot?
 	my $cmdline = get_command_internal($command, $user, $chroot);
 
-	log_command($cmdline);
+	if ($main::debug) {
+		log_command($cmdline);
+	} else {
+		log_command($command);
+	}
 
 	return system($cmdline);
 }
@@ -1841,7 +1849,11 @@
 	my $chroot = shift;  # Run in chroot?
 	my $cmdline = get_command_internal($command, $user, $chroot);
 
-	log_command($cmdline);
+	if ($main::debug) {
+		log_command($cmdline);
+	} else {
+		log_command($command);
+	}
 
 	exec $cmdline;
 }
Index: debian/changelog
===================================================================
RCS file: /cvsroot/buildd-tools/sbuild/debian/changelog,v
retrieving revision 1.97
diff -u -r1.97 changelog
--- debian/changelog	27 Feb 2006 19:09:10 -0000	1.97
+++ debian/changelog	6 Mar 2006 21:50:37 -0000
@@ -1,6 +1,9 @@
 sbuild (0.41) unstable; urgency=low
 
   * sbuild:
+    - get_command(), run_command() and exec_command() only log the full
+      command when debugging is enabled, otherwise only the short form is
+      logged (Closes: #355043).
     - setup_options(): Set $main::chroot_apt_options in the same
       manner as upstream.
     - setup_options(): Correct usage of a scalar reference rather than

Attachment: pgpBOI1E9bK3O.pgp
Description: PGP signature

Reply via email to