From eef793741e31a9551534f0bb9989967a01c4c0de Mon Sep 17 00:00:00 2001 From: espie Date: Mon, 4 Feb 2013 09:43:57 +0000 Subject: [PATCH] some of args seen in trace might be undef'd. avoid triggering the WARN handler while handling SIG{INFO}. Also, have parse_size_info be verbose about what's going on. --- infrastructure/bin/dpb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/infrastructure/bin/dpb b/infrastructure/bin/dpb index b1535502982..eb75b70d875 100755 --- a/infrastructure/bin/dpb +++ b/infrastructure/bin/dpb @@ -1,7 +1,7 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: dpb,v 1.84 2013/02/02 13:35:17 espie Exp $ +# $OpenBSD: dpb,v 1.85 2013/02/04 09:43:57 espie Exp $ # # Copyright (c) 2010 Marc Espie # @@ -482,6 +482,7 @@ sub parse_size_file return if $state->{fetch_only}; open my $fh, '<', $state->opt('S') // $state->{size_log} or return; + print "Reading size stats..."; File::Path::mkpath(File::Basename::dirname($state->{size_log})); my $rewrite = {}; @@ -508,11 +509,13 @@ sub parse_size_file DPB::Heuristics->add_size_info($o, $pkgname, $sz); } close $fh; + print "zapping old stuff..."; open $fh, '>', $state->{size_log}.'.part' or return; for my $p (sort keys %$rewrite) { print $fh "$p$rewrite->{$p}\n"; } close $fh; + print "Done\n"; rename $state->{size_log}.'.part', $state->{size_log}; } @@ -579,7 +582,9 @@ $SIG{INFO} = sub { @c = caller($x); } last if !@c; - print "#$x: $c[3]( ", join(', ', @DB::args), " )\n\tat line $c[2] of $c[1]\n"; + print "#$x: $c[3]( ", + join(', ', map { defined $_ ? $_ : "" } @DB::args), + " )\n\tat line $c[2] of $c[1]\n"; $x++; } sleep 5;