On Thu, 22 Jun 2000, Tony Finch wrote:

> A few months ago someone posted a script that summarizes make
> buildworld as it progresses. I've searched the ports and the mailing
> lists but I can't find it any more :-( so I'd be grateful if someone
> would tell me. Thanks.
> 
> Tony.
> -- 
> f.a.n.finch    [EMAIL PROTECTED]    [EMAIL PROTECTED]
> 356 pungent unguent for stump-itch
> 
> 
> 
> To Unsubscribe: send mail to [EMAIL PROTECTED]
> with "unsubscribe freebsd-hackers" in the body of the message


I think you are referring to the attached Perl script by Bill Fenner.

- Matt

--
Matt Loschert                           [EMAIL PROTECTED]
Software Engineer                       voice (703) 847-1381
ServInt Internet Services               fax   (703) 847-1383


#!/usr/bin/perl
#
# whereintheworld
# Parses "make world" output and summarize where it's been so far.
#
# Bill Fenner <[EMAIL PROTECTED]> 11 January 2000
#
# $Id: whereintheworld,v 1.2 2000/01/11 21:18:37 fenner Exp $
#
use strict;

my $lastarrow = undef;
my $inside = 0;
my @lines = ();
my $thresh = 5;
my $lastwasdash = 0;
my $file = $ARGV[0] || (-f "/usr/src/world.out" ? "/usr/src/world.out" : "-");
open(LOG, $file) || die "$file: $!\n";
while (<LOG>) {
        if (/^------------/) {
                $inside = !$inside;
                print unless ($lastwasdash);
                $lastwasdash = 1;
                next;
        }
        if ($inside && /^>>>/) {
                print;
                $lastwasdash = 0;
                next;
        }
        push(@lines, $_);
        if ($#lines > $thresh) {
                my $line = shift(@lines);
                $lastarrow = $line if ($line =~ /^===>/);
        }
}
exit if ($lastwasdash);
if ($lines[0] !~ /^===>/ && $lastarrow) {
        print $lastarrow, "...\n";
}
print @lines;

Reply via email to