From 9efee931edbba9441b0f4d28dfe560ea9ef91c8b Mon Sep 17 00:00:00 2001 From: espie Date: Wed, 9 Nov 2011 08:28:55 +0000 Subject: [PATCH] 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 --- infrastructure/bin/dpb | 6 +++--- infrastructure/lib/DPB/Engine.pm | 24 ++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/infrastructure/bin/dpb b/infrastructure/bin/dpb index f1c9660b86c..9c0a3818a4a 100755 --- a/infrastructure/bin/dpb +++ b/infrastructure/bin/dpb @@ -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 # @@ -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')); diff --git a/infrastructure/lib/DPB/Engine.pm b/infrastructure/lib/DPB/Engine.pm index b83b2ffb902..43dd051279b 100644 --- a/infrastructure/lib/DPB/Engine.pm +++ b/infrastructure/lib/DPB/Engine.pm @@ -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 # @@ -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) = @_;