ditch register_built, no longer serves any purpose.
switch junk to counting depends and count depends correctly
This commit is contained in:
parent
8a5daed60e
commit
560aa0bc8c
@ -1,5 +1,5 @@
|
|||||||
# ex:ts=8 sw=4:
|
# ex:ts=8 sw=4:
|
||||||
# $OpenBSD: Port.pm,v 1.91 2013/01/21 15:08:25 espie Exp $
|
# $OpenBSD: Port.pm,v 1.92 2013/01/27 23:15:12 espie Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2010 Marc Espie <espie@openbsd.org>
|
# Copyright (c) 2010 Marc Espie <espie@openbsd.org>
|
||||||
#
|
#
|
||||||
@ -429,7 +429,7 @@ sub setup
|
|||||||
{
|
{
|
||||||
my ($task, $core) = @_;
|
my ($task, $core) = @_;
|
||||||
# zap things HERE
|
# zap things HERE
|
||||||
if ($core->prop->{junk_count} < $core->prop->{junk}) {
|
if ($core->prop->{depends_count} < $core->prop->{junk}) {
|
||||||
$task->junk_unlock($core);
|
$task->junk_unlock($core);
|
||||||
return $core->job->next_task($core);
|
return $core->job->next_task($core);
|
||||||
}
|
}
|
||||||
@ -468,7 +468,7 @@ sub run
|
|||||||
|
|
||||||
$self->handle_output($job);
|
$self->handle_output($job);
|
||||||
# we got pre-empted
|
# we got pre-empted
|
||||||
if ($core->prop->{junk_count} < $core->prop->{junk}) {
|
if ($core->prop->{depends_count} < $core->prop->{junk}) {
|
||||||
exit(2);
|
exit(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -490,6 +490,8 @@ sub finalize
|
|||||||
my ($self, $core) = @_;
|
my ($self, $core) = @_;
|
||||||
if ($core->{status} == 0) {
|
if ($core->{status} == 0) {
|
||||||
$core->prop->{junk_count} = 0;
|
$core->prop->{junk_count} = 0;
|
||||||
|
$core->prop->{ports_count} = 0;
|
||||||
|
$core->prop->{depends_count} = 0;
|
||||||
}
|
}
|
||||||
$core->{status} = 0;
|
$core->{status} = 0;
|
||||||
$self->SUPER::finalize($core);
|
$self->SUPER::finalize($core);
|
||||||
@ -712,7 +714,6 @@ sub new
|
|||||||
|
|
||||||
$job->{endcode} = sub {
|
$job->{endcode} = sub {
|
||||||
close($job->{logfh});
|
close($job->{logfh});
|
||||||
$builder->register_built($v);
|
|
||||||
&$endcode; };
|
&$endcode; };
|
||||||
|
|
||||||
my $prop = $core->prop;
|
my $prop = $core->prop;
|
||||||
@ -783,7 +784,7 @@ sub has_depends
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
my $c = scalar(%deps2);
|
my $c = scalar(keys %deps2);
|
||||||
if (!$c) {
|
if (!$c) {
|
||||||
$self->save_depends(\@live);
|
$self->save_depends(\@live);
|
||||||
print {$self->{logfh}} "Avoided depends for ",
|
print {$self->{logfh}} "Avoided depends for ",
|
||||||
@ -816,23 +817,28 @@ sub add_normal_tasks
|
|||||||
$times->{$self->{v}} < $hostprop->{small_timeout}) {
|
$times->{$self->{v}} < $hostprop->{small_timeout}) {
|
||||||
$small = 1;
|
$small = 1;
|
||||||
}
|
}
|
||||||
# if (defined $times->{$self->{v}} &&
|
|
||||||
# $times->{$self->{v}} < 4800) {
|
|
||||||
# $self->{special} = 1;
|
|
||||||
# print {$self->{logfh}} "Building in RAM\n";
|
|
||||||
# }
|
|
||||||
if ($builder->{clean}) {
|
if ($builder->{clean}) {
|
||||||
$self->insert_tasks(DPB::Task::Port::BaseClean->new('clean'));
|
$self->insert_tasks(DPB::Task::Port::BaseClean->new('clean'));
|
||||||
}
|
}
|
||||||
$hostprop->{junk_count} //= 0;
|
$hostprop->{junk_count} //= 0;
|
||||||
if ($self->has_depends($core)) {
|
$hostprop->{depends_count} //= 0;
|
||||||
|
$hostprop->{ports_count} //= 0;
|
||||||
|
my $c = $self->has_depends($core);
|
||||||
|
$hostprop->{ports_count}++;
|
||||||
|
$hostprop->{depends_count} += $c;
|
||||||
|
if ($c) {
|
||||||
$hostprop->{junk_count}++;
|
$hostprop->{junk_count}++;
|
||||||
push(@todo, qw(depends show-prepare-results));
|
push(@todo, qw(depends show-prepare-results));
|
||||||
}
|
}
|
||||||
# gc stuff we will no longer need
|
# gc stuff we will no longer need
|
||||||
delete $self->{v}{info}{solved};
|
delete $self->{v}{info}{solved};
|
||||||
if ($hostprop->{junk}) {
|
if ($hostprop->{junk}) {
|
||||||
if ($hostprop->{junk_count} >= $hostprop->{junk}) {
|
if ($hostprop->{depends_count} >= $hostprop->{junk}) {
|
||||||
|
my $fh = $self->{builder}->logger->open("junk");
|
||||||
|
print $fh time(), ": ", $core->hostname,
|
||||||
|
": depends=$hostprop->{depends_count} ",
|
||||||
|
" ports=$hostprop->{ports_count} ",
|
||||||
|
" junk=$hostprop->{junk_count} \n";
|
||||||
push(@todo, 'junk');
|
push(@todo, 'junk');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# ex:ts=8 sw=4:
|
# ex:ts=8 sw=4:
|
||||||
# $OpenBSD: PortBuilder.pm,v 1.35 2013/01/21 14:56:29 espie Exp $
|
# $OpenBSD: PortBuilder.pm,v 1.36 2013/01/27 23:15:12 espie Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2010 Marc Espie <espie@openbsd.org>
|
# Copyright (c) 2010 Marc Espie <espie@openbsd.org>
|
||||||
#
|
#
|
||||||
@ -118,10 +118,6 @@ sub check
|
|||||||
return -f $self->pkgfile($v);
|
return -f $self->pkgfile($v);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub register_built
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
sub checks_rebuild
|
sub checks_rebuild
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -282,6 +278,9 @@ sub check
|
|||||||
{
|
{
|
||||||
my ($self, $v) = @_;
|
my ($self, $v) = @_;
|
||||||
return 0 unless $self->SUPER::check($v);
|
return 0 unless $self->SUPER::check($v);
|
||||||
|
|
||||||
|
my $name = $v->fullpkgname;
|
||||||
|
print {$self->{logrebuild}} "$name uptodate (cached): $uptodate->{$name}\n";
|
||||||
return $uptodate->{$v->fullpkgname};
|
return $uptodate->{$v->fullpkgname};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -291,12 +290,3 @@ sub checks_rebuild
|
|||||||
return 1 unless $uptodate->{$v->fullpkgname};
|
return 1 unless $uptodate->{$v->fullpkgname};
|
||||||
}
|
}
|
||||||
|
|
||||||
sub register_built
|
|
||||||
{
|
|
||||||
my ($self, $v) = @_;
|
|
||||||
for my $w ($v->build_path_list) {
|
|
||||||
$uptodate->{$w->fullpkgname} = -f $self->pkgfile($w);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
1;
|
|
||||||
|
Loading…
Reference in New Issue
Block a user