fix -R for real... what check_signatures does is nice, but needs to be

partly redone in the main dpb process. Obviously, children's changes to
uptodate don't affect the main process.

thanks to fgs@ for being the crash-test bunny.
This commit is contained in:
espie 2013-01-28 13:25:59 +00:00
parent f9d05fde34
commit a2a420d6a5
2 changed files with 28 additions and 3 deletions

View File

@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
# $OpenBSD: Port.pm,v 1.92 2013/01/27 23:15:12 espie Exp $
# $OpenBSD: Port.pm,v 1.93 2013/01/28 13:25:59 espie Exp $
#
# Copyright (c) 2010 Marc Espie <espie@openbsd.org>
#
@ -126,7 +126,10 @@ sub make_sure_we_have_packages
print {$job->{logfh}} ">>> Missing $f\n";
}
}
return if $check;
if ($check) {
$job->{builder}->register_packages($job->{v});
return;
}
if (!defined $job->{waiting}) {
$job->{waiting} = 0;
}
@ -169,6 +172,7 @@ sub run
{
my ($self, $core) = @_;
my $job = $core->job;
$self->handle_output($job);
exit($job->{builder}->check_signature($core, $job->{v}));
}
@ -184,6 +188,7 @@ sub finalize
$core);
} else {
$job->{signature_only} = 1;
$job->{builder}->register_packages($job->{v});
}
return 1;
}

View File

@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
# $OpenBSD: PortBuilder.pm,v 1.37 2013/01/27 23:17:00 espie Exp $
# $OpenBSD: PortBuilder.pm,v 1.38 2013/01/28 13:25:59 espie Exp $
#
# Copyright (c) 2010 Marc Espie <espie@openbsd.org>
#
@ -122,6 +122,10 @@ sub checks_rebuild
{
}
sub register_packages
{
}
sub report
{
my ($self, $v, $job, $core) = @_;
@ -251,11 +255,13 @@ sub check_signature
if (-f "$self->{fullrepo}/$name.tgz" &&
$self->equal_signatures($core, $v)) {
$uptodate->{$name} = 1;
print "$name: uptodate\n";
print {$self->{logrebuild}} "$name: uptodate\n";
return 1;
} else {
# XXX clean this first, so we skip over it in the loop
$self->{state}->grabber->clean_packages($core, $v->fullpkgpath);
print "$name: rebuild\n";
print {$self->{logrebuild}} "$name: rebuild\n";
for my $w ($v->build_path_list) {
$name = $w->fullpkgname;
@ -263,9 +269,11 @@ sub check_signature
next if $uptodate->{$name};
if ($self->equal_signatures($core, $w)) {
$uptodate->{$name} = 1;
print "$name: uptodate\n";
print {$self->{logrebuild}} "$name: uptodate\n";
next;
}
print "$name: rebuild\n";
print {$self->{logrebuild}} "$name: rebuild\n";
$self->{state}->grabber->clean_packages($core,
$w->fullpkgpath);
@ -274,6 +282,18 @@ sub check_signature
}
}
# this is due to the fact check_signature is within a child
sub register_packages
{
my ($self, $v) = @_;
for my $w ($v->build_path_list) {
my $name = $w->fullpkgname;
if (-f "$self->{fullrepo}/$name.tgz") {
$uptodate->{$name} = 1;
}
}
}
sub check
{
my ($self, $v) = @_;