Skip to content
Permalink
1139b72d5e
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
76 lines (66 sloc) 1.04 KB
#!/usr/bin/perl -w
@files = ();
$print_ct = 0;
if ($#ARGV < 0)
{
die "usage: <cmd> <filename> ...";
}
#
# why did i do this?
#
foreach $arg (@ARGV)
{
$files[$#files+1] = $arg;
}
foreach $file (@files)
{
open (FD, "<$file") || die "error opening $file";
$have_last_cmd = 0;
$printed_last_cmd = 0;
$last_cmd = "";
while (<>)
{
if (/^\.. /)
{
# pull off odd characters generated by statecomp hack
$_ =~ s/\..//g;
}
if (/^ CC/ ||
/^ SMC/ ||
/^ BUILD_CC/ ||
/^ BUILD_LD/ ||
/^ DEP/ ||
/^ RANLIB/ ||
/^ LD/ ||
/^ BISON/ ||
/^ FLEX/ ||
/^ GENCONFIG/ ||
/^ GEN/ ||
/^ MODPOST/ ||
/^make: Nothing to be done for/ ||
/^ Building modules, stage 2/)
{
$last_cmd = $_;
$have_last_cmd = 1;
$printed_last_cmd = 0;
}
else {
if ($have_last_cmd == 0 && $printed_last_cmd == 0)
{
print $last_cmd;
$printed_last_cmd = 1;
}
print $_;
$print_ct++;
}
}
close FD;
}
if ($print_ct == 0)
{
exit 0;
}
else
{
exit 1;
}