diff options
author | des <des@FreeBSD.org> | 2003-01-09 12:23:29 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2003-01-09 12:23:29 +0000 |
commit | ff67b7492654ebe8d03b9e28e74bab5be4baa957 (patch) | |
tree | 2bbd505deb436dd4f5c023332b6da454b44b931b /tools | |
parent | d8b3e07d3303d85cc24c2a1ec1f93b43f578962d (diff) | |
download | FreeBSD-src-ff67b7492654ebe8d03b9e28e74bab5be4baa957.zip FreeBSD-src-ff67b7492654ebe8d03b9e28e74bab5be4baa957.tar.gz |
My version of fenner's "make world" log summarizer.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/tools/whereintheworld/Makefile | 5 | ||||
-rw-r--r-- | tools/tools/whereintheworld/whereintheworld.pl | 59 |
2 files changed, 64 insertions, 0 deletions
diff --git a/tools/tools/whereintheworld/Makefile b/tools/tools/whereintheworld/Makefile new file mode 100644 index 0000000..876a318 --- /dev/null +++ b/tools/tools/whereintheworld/Makefile @@ -0,0 +1,5 @@ +# $FreeBSD$ + +SCRIPTS= whereintheworld.pl + +.include <bsd.prog.mk> diff --git a/tools/tools/whereintheworld/whereintheworld.pl b/tools/tools/whereintheworld/whereintheworld.pl new file mode 100644 index 0000000..349c0d9 --- /dev/null +++ b/tools/tools/whereintheworld/whereintheworld.pl @@ -0,0 +1,59 @@ +#!/usr/bin/perl -w +# +# whereintheworld +# Parses "make world" output and summarize where it's been so far. +# +# Bill Fenner <fenner@freebsd.org> 11 January 2000 +# Dag-Erling Smørgrav <des@freebsd.org> 09 January 2003 +# +# $Id: whereintheworld,v 1.3 2000/01/28 00:42:32 fenner Exp $ +# $FreeBSD$ +# +use strict; + +my $line; +my $inside = 0; +my @lines = (); +my $thresh = 10; +my $lastwasdash = 0; +my $width = $ENV{COLUMNS} || 80; +my $elided = 0; + +while ($line = <>) { + if ($line =~ /^------------/) { + $inside = !$inside; + print $line unless ($lastwasdash); + $lastwasdash = 1; + @lines = (); + next; + } + if ($inside && $line =~ /^>>>/) { + print $line; + $lastwasdash = 0; + next; + } + if ($line =~ /^=+>/) { + @lines = (); + } + if (length($line) >= $width) { + substr($line, $width - 7) = " [...]\n"; + } + push(@lines, $line); + if ($line =~ /^\*\*\* Error/ && $line !~ /\(ignored\)/) { + print @lines; + while ($line = <>) { + print $line; + } + exit; + } +} + +print shift(@lines); +while (@lines > $thresh) { + shift(@lines); + ++$elided; +} +if ($elided > 0) { + print "[$elided lines elided]\n"; +} +print @lines; |