Bug#399178: [Buildd-tools-devel] Bug#399178: noisy warnings: Unable to locate package...

2007-02-11 Thread Martin Michlmayr
* Roger Leigh [EMAIL PROTECTED] [2007-02-10 14:41]:
 Please could you try the attached patch?
 
 This should do the above, preventing apt-cache errors and warnings
 From going to stderr; they go to the package log instead.

This works, thanks a lot!
-- 
Martin Michlmayr
http://www.cyrius.com/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#399178: [Buildd-tools-devel] Bug#399178: noisy warnings: Unable to locate package...

2007-02-10 Thread Roger Leigh
Martin Michlmayr [EMAIL PROTECTED] writes:

 * Roger Leigh [EMAIL PROTECTED] [2007-02-04 23:00]:
 While it would be possible to send all stderr output to /dev/null, I
 don't feel that this is appropriate, because it will discard all error
 reporting when running apt-cache.  One solution I am now looking at is
 sending stderr to the package log (rather than the main log) for just
 apt-cache invokations.  Errors and warnings will still be logged, but
 they will then not get mailed to you separately.  Does that sound OK.

 Sounds good to me.

Please could you try the attached patch?

This should do the above, preventing apt-cache errors and warnings
From going to stderr; they go to the package log instead.


Thanks,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?   http://gutenprint.sourceforge.net/
   `-GPG Public Key: 0x25BFB848   Please GPG sign your mail.
Index: sbuild
===
--- sbuild	(revision 1082)
+++ sbuild	(working copy)
@@ -29,6 +29,7 @@
 use POSIX;
 use File::Basename qw(basename dirname);
 use IO::Handle;
+use IPC::Open3;
 use FileHandle;
 use Sbuild qw(binNMU_version version_compare);
 
@@ -51,6 +52,10 @@
 # in case the terminal disappears, the build should continue
 $SIG{'HUP'} = 'IGNORE';
 
+if (!open(main::DEVNULL, '+', '/dev/null')) {
+	die Cannot open /dev/null: $!\n;;
+}
+
 umask(022);
 
 $main::distribution = unstable;
@@ -414,9 +419,10 @@
 
 		  retry:
 			print PLOG Checking available source versions...\n;
-			my $command = get_apt_command($conf::apt_cache, -q showsrc $pkg 21 /dev/null, $main::username, 0);
-			if (!open( PIPE, $command | )) {
-print PLOG Can't open pipe to apt-cache: $!\n;
+			my $command = get_apt_command($conf::apt_cache, -q showsrc $pkg, $main::username, 0);
+			my $pid = open3(\*main::DEVNULL, \*PIPE, 'PLOG', $command );
+			if (!$pid) {
+print PLOG Can't open pipe to $conf::apt_cache: $!\n;
 return (ERROR);
 			}
 			{ local($/) = ;
@@ -430,12 +436,13 @@
   @{$entries{$ver}} = map { (split( /\s+/, $_ ))[3] }
 	  split( \n, $tfile );
 			  } else {
-  print PLOG apt-cache returned no information about $pkg source\n;
+  print PLOG $conf::apt_cache returned no information about $pkg source\n;
   print PLOG Are there any deb-src lines in your /etc/apt/sources.list?\n;
   return (ERROR);
 			  }
 		  }
-			close( PIPE );
+			close(PIPE);
+			waitpid $pid, 0;
 			if ($?) {
 print PLOG $conf::apt_cache failed\n;
 return (ERROR);
@@ -1745,14 +1752,18 @@
 
 	my $command = get_apt_command($conf::apt_cache, policy @interest, $main::username, 0);
 
-	open(APTCACHE, $command | )
-		or die Cannot start $conf::apt_cache $!\n;
+	my $pid = open3(\*main::DEVNULL, \*APTCACHE, 'PLOG', $command );
+	if (!$pid) {
+		die Cannot start $conf::apt_cache $!\n;
+	}
 	while(APTCACHE) {
 		$package=$1 if /^([0-9a-z+.-]+):$/;
 		$packages{$package}-{curversion}=$1 if /^ {2}Installed: ([0-9a-zA-Z-.:~+]*)$/;
 		$packages{$package}-{defversion}=$1 if /^ {2}Candidate: ([0-9a-zA-Z-.:~+]*)$/;
 		push @{$packages{$package}-{versions}}, $2 if /^ (\*{3}| {3}) ([0-9a-zA-Z-.:~+]*) 0$/;
 	}
+	close(APTCACHE);
+	waitpid $pid, 0;
 	die $conf::apt_cache exit status $?\n if $?;
 
 	return %packages;
@@ -2252,9 +2263,11 @@
 	local(*PIPE);
 	my %deps;
 	
-	my $command = get_apt_command($conf::apt_cache, show @_ 21, $main::username, 0);
-	open( PIPE, $command | )
-		or die Cannot start $conf::apt_cache $!\n;
+	my $command = get_apt_command($conf::apt_cache, show @_, $main::username, 0);
+	my $pid = open3(\*main::DEVNULL, \*PIPE, 'PLOG', $command );
+	if (!$pid) {
+		die Cannot start $conf::apt_cache $!\n;
+	}
 	local($/) = ;
 	while( PIPE ) {
 		my ($name, $dep, $predep);
@@ -2267,6 +2280,7 @@
 		$deps{$name} = $dep;
 	}
 	close( PIPE );
+	waitpid $pid, 0;
 	die $conf::apt_cache exit status $?\n if $?;
 
 	return \%deps;
@@ -2275,9 +2289,11 @@
 sub get_virtuals {
 	local(*PIPE);
 
-	my $command = get_apt_command($conf::apt_cache, showpkg @_ 21, $main::username, 0);
-	open( PIPE, $command | )
-		or die Cannot start $conf::apt_cache: $!\n;
+	my $command = get_apt_command($conf::apt_cache, showpkg @_, $main::username, 0);
+	my $pid = open3(\*main::DEVNULL, \*PIPE, 'PLOG', $command );
+	if (!$pid) {
+		die Cannot start $conf::apt_cache $!\n;
+	}
 	my $name;
 	my $in_rprov = 0;
 	my %provided_by;
@@ -2296,6 +2312,7 @@
 		}
 	}
 	close( PIPE );
+	waitpid $pid, 0;
 	die $conf::apt_cache exit status $?\n if $?;
 
 	return \%provided_by;


pgp4Ej6ZX2ge5.pgp
Description: PGP signature


Bug#399178: [Buildd-tools-devel] Bug#399178: noisy warnings: Unable to locate package...

2007-02-10 Thread Roger Leigh
tags 399178 + confirmed patch fixed-upstream pending
thanks

Roger Leigh [EMAIL PROTECTED] writes:

 Martin Michlmayr [EMAIL PROTECTED] writes:

 * Roger Leigh [EMAIL PROTECTED] [2007-02-04 23:00]:
 While it would be possible to send all stderr output to /dev/null, I
 don't feel that this is appropriate, because it will discard all error
 reporting when running apt-cache.  One solution I am now looking at is
 sending stderr to the package log (rather than the main log) for just
 apt-cache invokations.  Errors and warnings will still be logged, but
 they will then not get mailed to you separately.  Does that sound OK.

 Sounds good to me.

 Please could you try the attached patch?

 This should do the above, preventing apt-cache errors and warnings
 From going to stderr; they go to the package log instead.

Attached patch tested and committed upstream.  Unless you find a
problem with it, I'll upload in a day or so.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?   http://gutenprint.sourceforge.net/
   `-GPG Public Key: 0x25BFB848   Please GPG sign your mail.
Index: sbuild
===
--- sbuild	(revision 1082)
+++ sbuild	(working copy)
@@ -29,6 +29,7 @@
 use POSIX;
 use File::Basename qw(basename dirname);
 use IO::Handle;
+use IPC::Open3;
 use FileHandle;
 use Sbuild qw(binNMU_version version_compare);
 
@@ -51,6 +52,10 @@
 # in case the terminal disappears, the build should continue
 $SIG{'HUP'} = 'IGNORE';
 
+if (!open(main::DEVNULL, '+', '/dev/null')) {
+	die Cannot open /dev/null: $!\n;;
+}
+
 umask(022);
 
 $main::distribution = unstable;
@@ -414,9 +419,10 @@
 
 		  retry:
 			print PLOG Checking available source versions...\n;
-			my $command = get_apt_command($conf::apt_cache, -q showsrc $pkg 21 /dev/null, $main::username, 0);
-			if (!open( PIPE, $command | )) {
-print PLOG Can't open pipe to apt-cache: $!\n;
+			my $command = get_apt_command($conf::apt_cache, -q showsrc $pkg, $main::username, 0);
+			my $pid = open3(\*main::DEVNULL, \*PIPE, 'PLOG', $command );
+			if (!$pid) {
+print PLOG Can't open pipe to $conf::apt_cache: $!\n;
 return (ERROR);
 			}
 			{ local($/) = ;
@@ -430,12 +436,13 @@
   @{$entries{$ver}} = map { (split( /\s+/, $_ ))[3] }
 	  split( \n, $tfile );
 			  } else {
-  print PLOG apt-cache returned no information about $pkg source\n;
+  print PLOG $conf::apt_cache returned no information about $pkg source\n;
   print PLOG Are there any deb-src lines in your /etc/apt/sources.list?\n;
   return (ERROR);
 			  }
 		  }
-			close( PIPE );
+			close(PIPE);
+			waitpid $pid, 0;
 			if ($?) {
 print PLOG $conf::apt_cache failed\n;
 return (ERROR);
@@ -1745,14 +1752,18 @@
 
 	my $command = get_apt_command($conf::apt_cache, policy @interest, $main::username, 0);
 
-	open(APTCACHE, $command | )
-		or die Cannot start $conf::apt_cache $!\n;
+	my $pid = open3(\*main::DEVNULL, \*APTCACHE, 'PLOG', $command );
+	if (!$pid) {
+		die Cannot start $conf::apt_cache $!\n;
+	}
 	while(APTCACHE) {
 		$package=$1 if /^([0-9a-z+.-]+):$/;
 		$packages{$package}-{curversion}=$1 if /^ {2}Installed: ([0-9a-zA-Z-.:~+]*)$/;
 		$packages{$package}-{defversion}=$1 if /^ {2}Candidate: ([0-9a-zA-Z-.:~+]*)$/;
 		push @{$packages{$package}-{versions}}, $2 if /^ (\*{3}| {3}) ([0-9a-zA-Z-.:~+]*) 0$/;
 	}
+	close(APTCACHE);
+	waitpid $pid, 0;
 	die $conf::apt_cache exit status $?\n if $?;
 
 	return %packages;
@@ -2252,9 +2263,11 @@
 	local(*PIPE);
 	my %deps;
 	
-	my $command = get_apt_command($conf::apt_cache, show @_ 21, $main::username, 0);
-	open( PIPE, $command | )
-		or die Cannot start $conf::apt_cache $!\n;
+	my $command = get_apt_command($conf::apt_cache, show @_, $main::username, 0);
+	my $pid = open3(\*main::DEVNULL, \*PIPE, 'PLOG', $command );
+	if (!$pid) {
+		die Cannot start $conf::apt_cache $!\n;
+	}
 	local($/) = ;
 	while( PIPE ) {
 		my ($name, $dep, $predep);
@@ -2267,6 +2280,7 @@
 		$deps{$name} = $dep;
 	}
 	close( PIPE );
+	waitpid $pid, 0;
 	die $conf::apt_cache exit status $?\n if $?;
 
 	return \%deps;
@@ -2275,9 +2289,11 @@
 sub get_virtuals {
 	local(*PIPE);
 
-	my $command = get_apt_command($conf::apt_cache, showpkg @_ 21, $main::username, 0);
-	open( PIPE, $command | )
-		or die Cannot start $conf::apt_cache: $!\n;
+	my $command = get_apt_command($conf::apt_cache, showpkg @_, $main::username, 0);
+	my $pid = open3(\*main::DEVNULL, \*PIPE, 'PLOG', $command );
+	if (!$pid) {
+		die Cannot start $conf::apt_cache $!\n;
+	}
 	my $name;
 	my $in_rprov = 0;
 	my %provided_by;
@@ -2296,6 +2312,7 @@
 		}
 	}
 	close( PIPE );
+	waitpid $pid, 0;
 	die $conf::apt_cache exit status $?\n if $?;
 
 	return \%provided_by;
Index: debian/changelog
===
--- debian/changelog	(revision 1082)
+++ debian/changelog	(working copy)
@@ -8,6 

Bug#399178: [Buildd-tools-devel] Bug#399178: noisy warnings: Unable to locate package...

2007-02-05 Thread Martin Michlmayr
* Roger Leigh [EMAIL PROTECTED] [2007-02-04 23:00]:
 While it would be possible to send all stderr output to /dev/null, I
 don't feel that this is appropriate, because it will discard all error
 reporting when running apt-cache.  One solution I am now looking at is
 sending stderr to the package log (rather than the main log) for just
 apt-cache invokations.  Errors and warnings will still be logged, but
 they will then not get mailed to you separately.  Does that sound OK.

Sounds good to me.
-- 
Martin Michlmayr
http://www.cyrius.com/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#399178: [Buildd-tools-devel] Bug#399178: noisy warnings: Unable to locate package...

2007-02-04 Thread Martin Michlmayr
A current example is arpack++_2.2-9 which will give you:

** Using build dependencies supplied by package:
Build-Depends: debhelper ( 4.1.0 ), g++ ( 2.95), libg2c0-dev, refblas3-dev 
| libblas-3.so, lapack3-dev | lapack-3.so, libarpack2-dev, chrpath
Checking for already installed source dependencies...
W: Unable to locate package lapack-3.so

-- 
Martin Michlmayr
http://www.cyrius.com/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#399178: [Buildd-tools-devel] Bug#399178: noisy warnings: Unable to locate package...

2007-02-04 Thread Roger Leigh
Martin Michlmayr [EMAIL PROTECTED] writes:

 A current example is arpack++_2.2-9 which will give you:

 ** Using build dependencies supplied by package:
 Build-Depends: debhelper ( 4.1.0 ), g++ ( 2.95), libg2c0-dev, 
 refblas3-dev | libblas-3.so, lapack3-dev | lapack-3.so, libarpack2-dev, 
 chrpath
 Checking for already installed source dependencies...
 W: Unable to locate package lapack-3.so

This is from apt-cache:

% apt-cache show lapack-3.so
W: Unable to locate package lapack-3.so
E: No packages found

I can't find a warning suppression option on the command-line or in
the APT configuration options.

While it would be possible to send all stderr output to /dev/null, I
don't feel that this is appropriate, because it will discard all error
reporting when running apt-cache.  One solution I am now looking at is
sending stderr to the package log (rather than the main log) for just
apt-cache invokations.  Errors and warnings will still be logged, but
they will then not get mailed to you separately.  Does that sound OK.

Note to self: Use Perl IPC::Open3 to do the stream redirects.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?   http://gutenprint.sourceforge.net/
   `-GPG Public Key: 0x25BFB848   Please GPG sign your mail.


pgpeWi0a374SX.pgp
Description: PGP signature


Bug#399178: [Buildd-tools-devel] Bug#399178: noisy warnings: Unable to locate package...

2007-02-01 Thread Martin Michlmayr
Even though this bug is quite minor it's really quite annoying.  Any
chance getting a fix soon? :)

Thanks.
-- 
Martin Michlmayr
http://www.cyrius.com/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#399178: [Buildd-tools-devel] Bug#399178: noisy warnings: Unable to locate package...

2007-02-01 Thread Roger Leigh
Martin Michlmayr [EMAIL PROTECTED] writes:

 Even though this bug is quite minor it's really quite annoying.  Any
 chance getting a fix soon? :)

Sure.  I have an exam tomorrow, which is the reason for my recent lack
of visibility, but I have already set aside some time on Saturday to
look through sbuild issues.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?   http://gutenprint.sourceforge.net/
   `-GPG Public Key: 0x25BFB848   Please GPG sign your mail.


pgpswjTDGxYtd.pgp
Description: PGP signature


Bug#399178: [Buildd-tools-devel] Bug#399178: noisy warnings: Unable to locate package...

2006-11-18 Thread Roger Leigh
Martin Michlmayr [EMAIL PROTECTED] writes:

 With the current version of sbuild, I regularly get Log from sbuild
 emails which tell me Unable to locate package..., e.g.

 W: Unable to locate package libgdchart-gd2-noxpm-dev
 W: Unable to locate package libgdchart-gd2-dev

 or

 W: Unable to locate package tk8.2-dev
 W: Unable to locate package tcl8.0-dev
 W: Unable to locate package tcl8.2-dev
 W: Unable to locate package tk8.0-dev

 I find these emails quite annoying and I don't see what they add.
 Would you mind removing them?

Sure, if I can find what generates them--they aren't generated by
sbuild itself.

They are being sent to stderr by some child process such as apt-get or
apt-cache.  If you use script to catch the entire build log, does this
show which commands are responsible?


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?   http://gutenprint.sourceforge.net/
   `-GPG Public Key: 0x25BFB848   Please GPG sign your mail.


pgpuMqAnYn6Yg.pgp
Description: PGP signature


Bug#399178: [Buildd-tools-devel] Bug#399178: noisy warnings: Unable to locate package...

2006-11-18 Thread Martin Michlmayr
* Roger Leigh [EMAIL PROTECTED] [2006-11-18 12:23]:
 Sure, if I can find what generates them--they aren't generated by
 sbuild itself.
 
 They are being sent to stderr by some child process such as apt-get or
 apt-cache.  If you use script to catch the entire build log, does this
 show which commands are responsible?

Here:

Requesting dpkg status for packages: linux-headers-2.6.18-1-all debhelper 
linux-source-2.6.18
/bin/sh -c '/usr/bin/apt-cache CHROOT_APT_OPTIONS policy 
linux-headers-2.6.18-1-all debhelper linux-source-2.6.18'
W: Unable to locate package linux-headers-2.6.18-1-all
linux-source-2.6.18: pos dep, not installed
linux-source-2.6.18: missing
using linux-source-2.6.18 for install
linux-headers-2.6.18-1-all: pos dep, not installed

-- 
Martin Michlmayr
http://www.cyrius.com/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]