rollinglog must be reopened each time, comment why

(commented snippet that shows how to prime -s heuristics based on time
dangerous but useful)
This commit is contained in:
espie 2013-01-21 14:56:29 +00:00
parent db86e467b7
commit 3ec5148eaa
2 changed files with 14 additions and 6 deletions

View File

@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
# $OpenBSD: Port.pm,v 1.89 2013/01/21 12:29:52 espie Exp $
# $OpenBSD: Port.pm,v 1.90 2013/01/21 14:56:29 espie Exp $
#
# Copyright (c) 2010 Marc Espie <espie@openbsd.org>
#
@ -542,8 +542,13 @@ sub finalize
my $job = $core->job;
print {$job->{builder}{logsize}}
$job->{path}, " $job->{wrkdir} $sz\n";
print {$job->{builder}{rollinglog}}
$job->{path}, " $job->{wrkdir} $sz\n";
# XXX the rolling log might be shared with other dpb
# so it can be rewritten and sorted
# don't keep a handle on it, so that we always
# append new information to the correct filename
open(my $fh2, '>>', $job->{builder}{state}{size_log});
print $fh2 $job->{path}, " $job->{wrkdir} $sz\n";
last;
}
}
close($fh);
@ -812,6 +817,11 @@ sub add_normal_tasks
$times->{$self->{v}} < $hostprop->{small_timeout}) {
$small = 1;
}
# if (defined $times->{$self->{v}} &&
# $times->{$self->{v}} < 4800) {
# $self->{special} = 1;
# print {$self->{logfh}} "Building in RAM\n";
# }
if ($builder->{clean}) {
$self->insert_tasks(DPB::Task::Port::BaseClean->new('clean'));
}

View File

@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
# $OpenBSD: PortBuilder.pm,v 1.34 2013/01/21 12:29:52 espie Exp $
# $OpenBSD: PortBuilder.pm,v 1.35 2013/01/21 14:56:29 espie Exp $
#
# Copyright (c) 2010 Marc Espie <espie@openbsd.org>
#
@ -98,8 +98,6 @@ sub init
if ($self->{size}) {
$self->{logsize} =
DPB::Util->make_hot($self->logger->open("size"));
open($self->{rollinglog}, '>>', $self->{state}{size_log});
DPB::Util->make_hot($self->{rollinglog});
}
if ($self->{state}->defines("WRAP_MAKE")) {
$self->{rsslog} = $self->logger->logfile("rss");