prompted by jasper: reintroduce -S, but as a rw option, to override

the rolling journal location for size log.

make it possible to share dpb -s output from a given architecture with
similar architectures
This commit is contained in:
espie 2013-01-21 14:50:30 +00:00
parent a49dfdab82
commit 0a438fe138

View File

@ -1,7 +1,7 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
# $OpenBSD: dpb,v 1.76 2013/01/21 12:03:32 espie Exp $
# $OpenBSD: dpb,v 1.77 2013/01/21 14:50:30 espie Exp $
#
# Copyright (c) 2010 Marc Espie <espie@openbsd.org>
#
@ -175,7 +175,7 @@ sub handle_options
},
};
$state->SUPER::handle_options('acemqrRsuUvh:xX:A:C:f:F:I:j:J:M:p:P:b:l:L:',
$state->SUPER::handle_options('acemqrRsuUvh:S:xX:A:C:f:F:I:j:J:M:p:P:b:l:L:',
"[-acemrRsuUvx] [-A arch] [-C plist] [-f N] [-F N] [-I plist] [-J p] [-j N]",
"[-p parallel] [-P plist] [-h hosts] [-L logdir] [-l lockdir] [-b log]",
"[-M threshold] [-X plist] [path ...]");
@ -235,8 +235,14 @@ sub handle_options
$f = $state->expand_path($f);
}
}
if ($state->opt('S')) {
$state->{size_log} = $state->opt('S');
} else {
$state->{size_log} = "%f/build-stats/%a-size";
}
$state->{permanent_log} = $state->{build_files}[-1];
$state->{size_log} = $state->expand_path("%f/build-stats/%a-size");
$state->{size_log} = $state->expand_path($state->{size_log});
$state->parse_size_file;
$state->{logger} = DPB::Logger->new($state->logdir, $state->opt('c'));