[buildd-tools-devel] Bug#553301: Bug#553301: Bug#553301: Bug#553301: sbuild: should display version from packages already installed on the chroot

Roger Leigh rleigh at codelibre.net
Sun Dec 13 12:43:24 UTC 2009


tags 553301 + patch fixed-upstream pending
thanks

On Fri, Nov 06, 2009 at 09:11:55PM +0000, Roger Leigh wrote:
> On Fri, Oct 30, 2009 at 10:18:20AM -0300, Felipe Sateler wrote:
> > On Thu, 2009-10-29 at 23:12 -0400, Andres Mejia wrote:
> > > On Thursday 29 October 2009 21:00:00 Felipe Sateler wrote:
> > > > Package: sbuild
> > > > Version: 0.59.0-1
> > > > Severity: wishlist
> > > > 
> > > > Sometimes, a build failure is caused by a change introduced in one of
> > > > the build-dependencies. It would help to see which versions of the
> > > > packages are already installed in the chroot to identify these (and
> > > > maybe build-conflicts). I think a simple dpkg -l before installing
> > > > build-deps woud suffice.
> > > 
> > > This sounds better as an external command you would run at this part of a 
> > > build run (in the chroot before any build dependencies are installed). I would 
> > > be willing to work on something like this. See the last two messages of bug 
> > > #551311 for something related.
> > 
> > Well, I don't really care how this is implemented, except that it is run
> > by default. The main point of this is to see what packages were
> > installed in the buildds.
> 
> lib/Sbuild/ChrootSetup.pm already contains a list_packages function;
> it just needs calling by sbuild at the appropriate point.  We already
> print out the toolchain package versions; it might be appropriate to
> make this listing configurable to avoid unnecessary noise for those
> that don't want it.

Now fixed in git.

Regards,
Roger

diff --git a/lib/Sbuild/Build.pm b/lib/Sbuild/Build.pm
index b9d0d88..8a0a086 100644
--- a/lib/Sbuild/Build.pm
+++ b/lib/Sbuild/Build.pm
@@ -1582,7 +1582,15 @@ sub check_dependencies {
 		$self->log(' ' . $name . '_' . $status->{$name}->{'Version'});
 	    } else {
 		$self->log(' ' . $name . '_' . ' =*=NOT INSTALLED=*=');
+	    }
+	}
+	$self->log("\n");
 
+	$self->log("Package versions:");
+	my $pkg_status = $self->get_dpkg_status();
+	foreach $name (sort keys %{$pkg_status}) {
+	    if (defined($pkg_status->{$name}->{'Version'})) {
+		$self->log(' ' . $name . '_' . $pkg_status->{$name}->{'Version'});
 	    }
 	}
 	$self->log("\n");
@@ -1647,7 +1655,6 @@ sub get_dpkg_status {
     my %result;
     local( *STATUS );
 
-    return () if !@_;
     debug("Requesting dpkg status for packages: @interest\n");
     if (!open( STATUS, "<$self->{'Chroot Dir'}/var/lib/dpkg/status" )) {
 	$self->log("Can't open $self->{'Chroot Dir'}/var/lib/dpkg/status: $!\n");
@@ -1684,7 +1691,7 @@ sub get_dpkg_status {
 	    next;
 	}
 	$result{$pkg} = { Installed => 1, Version => $version }
-	if isin( $pkg, @interest );
+	if (isin( $pkg, @interest) || !@interest);
 	if ($provides) {
 	    foreach (split( /\s*,\s*/, $provides )) {
 		$result{$_} = { Installed => 1, Version => '~*=PROVIDED=*=' }

-- 
  .''`.  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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20091213/f63216e9/attachment.pgp>


More information about the Buildd-tools-devel mailing list