smarter dump at end of build:

- try resolving RDEPENDS on tobuild, so that known dependencie are zapped.
- use equivalence info to not reprint same thing twice.
- dump tobuild AND built, since both are usually relevant in case lots of
stuff didn't build
This commit is contained in:
espie 2011-11-09 08:28:55 +00:00
parent 82238b4e19
commit 9efee931ed
2 changed files with 25 additions and 5 deletions

View File

@ -1,7 +1,7 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
# $OpenBSD: dpb,v 1.27 2011/10/11 09:50:35 espie Exp $
# $OpenBSD: dpb,v 1.28 2011/11/09 08:28:55 espie Exp $
#
# Copyright (c) 2010 Marc Espie <espie@openbsd.org>
#
@ -432,5 +432,5 @@ while (1) {
$reporter->reset;
DPB::Core->cleanup;
print $state->engine->report;
$state->engine->dump_category('tobuild', $state->logger->open('dump'));
$state->engine->end_dump($state->logger->open('dump'));
#$state->engine->dump_category('tobuild', $state->logger->open('dump'));

View File

@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
# $OpenBSD: Engine.pm,v 1.32 2011/11/08 10:26:38 espie Exp $
# $OpenBSD: Engine.pm,v 1.33 2011/11/09 08:28:55 espie Exp $
#
# Copyright (c) 2010 Marc Espie <espie@openbsd.org>
#
@ -634,13 +634,33 @@ sub dump_category
$k =~ m/^./;
my $q = "\u$&: ";
my $cache = {};
for my $v (sort {$a->fullpkgpath cmp $b->fullpkgpath}
values %{$self->{$k}}) {
print $fh $q;
$v->quick_dump($fh);
if (defined $cache->{$v->{info}}) {
print $fh $v->fullpkgpath, " same as ",
$cache->{$v->{info}}, "\n";
} else {
$v->quick_dump($fh);
$cache->{$v->{info}} = $v->fullpkgpath;
}
}
}
sub end_dump
{
my ($self, $fh) = @_;
$fh //= \*STDOUT;
for my $v (values %{$self->{built}}) {
$self->adjust($v, 'RDEPENDS');
}
for my $k (qw(tobuild built)) {
$self->dump_category($k, $fh);
}
print $fh "\n";
}
sub dump
{
my ($self, $fh) = @_;