diff --git a/infrastructure/lib/DPB/Grabber.pm b/infrastructure/lib/DPB/Grabber.pm index 00e35e86604..7ede8396f09 100644 --- a/infrastructure/lib/DPB/Grabber.pm +++ b/infrastructure/lib/DPB/Grabber.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Grabber.pm,v 1.25 2013/01/04 19:34:10 espie Exp $ +# $OpenBSD: Grabber.pm,v 1.26 2013/01/07 10:59:41 espie Exp $ # # Copyright (c) 2010 Marc Espie # @@ -29,6 +29,7 @@ sub new my $o = bless { loglist => DPB::Util->make_hot($state->logger->open("vars")), engine => $state->engine, + builder => $state->builder, state => $state, keep_going => 1, errors => 0, @@ -62,9 +63,14 @@ sub finish delete $v->{info}; $self->{engine}->add_fatal($v, $v->{broken}); delete $v->{broken}; - } elsif ($v->{wantbuild}) { - delete $v->{wantbuild}; - $self->{engine}->new_path($v); + } else { + if ($v->{wantbuild}) { + delete $v->{wantbuild}; + $self->{engine}->new_path($v); + } + if ($v->{dontjunk}) { + $self->{builder}->dontjunk($v); + } } } $self->{engine}->flush; @@ -135,6 +141,9 @@ sub complete_subdirs delete $v->{wantbuild}; $self->{engine}->new_path($v); } + if (defined $v->{dontjunk}) { + $self->{builder}->dontjunk($v); + } next; } next if defined $v->{category}; diff --git a/infrastructure/lib/DPB/Job/Port.pm b/infrastructure/lib/DPB/Job/Port.pm index 7a69f392f4e..a33d9d60ea7 100644 --- a/infrastructure/lib/DPB/Job/Port.pm +++ b/infrastructure/lib/DPB/Job/Port.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Port.pm,v 1.59 2013/01/05 23:38:08 espie Exp $ +# $OpenBSD: Port.pm,v 1.60 2013/01/07 10:59:41 espie Exp $ # # Copyright (c) 2010 Marc Espie # @@ -340,6 +340,14 @@ our @ISA=qw(DPB::Task::Port::Serialized); sub notime { 1 } +sub add_dontjunk +{ + my ($self, $job, $h) = @_; + return if !defined $job->{builder}{dontjunk}; + for my $pkgname (keys %{$job->{builder}{dontjunk}}) { + $h->{$pkgname} = 1; + } +} sub add_live_depends { my ($self, $h, $host) = @_; @@ -372,6 +380,7 @@ sub run my $h = $job->{builder}->locker->find_dependencies( $core->hostname); if (defined $h && $self->add_live_depends($h, $core->hostname)) { + $self->add_dontjunk($job, $h); my @cmd = ('/usr/sbin/pkg_delete', '-aIX', sort keys %$h); print join(' ', @cmd, "\n"); $core->shell->exec(OpenBSD::Paths->sudo, @cmd); diff --git a/infrastructure/lib/DPB/PortBuilder.pm b/infrastructure/lib/DPB/PortBuilder.pm index d1de9bb5717..16830b55395 100644 --- a/infrastructure/lib/DPB/PortBuilder.pm +++ b/infrastructure/lib/DPB/PortBuilder.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PortBuilder.pm,v 1.27 2012/12/25 10:43:36 espie Exp $ +# $OpenBSD: PortBuilder.pm,v 1.28 2013/01/07 10:59:41 espie Exp $ # # Copyright (c) 2010 Marc Espie # @@ -70,6 +70,12 @@ sub locker return $self->{state}->locker; } +sub dontjunk +{ + my ($self, $v) = @_; + $self->{dontjunk}{$v->fullpkgname} = 1; +} + sub make { my $self = shift;