generated from coulomb/repo-seed
Added prior art yawex perl wiki
This commit is contained in:
44
history/priorart/yawex-0.7.4/tools/striptests
Executable file
44
history/priorart/yawex-0.7.4/tools/striptests
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/perl -w
|
||||
#
|
||||
# comments out package inclusion of Test::Unit from perl sources
|
||||
#
|
||||
# $Header: /var/local/cvs/yawex/tools/striptests,v 1.1.1.1 2004/07/15 18:37:24 bernd Exp $
|
||||
#
|
||||
|
||||
$pattern = "use Test::Unit";
|
||||
|
||||
$usage =<<EOT;
|
||||
usage:
|
||||
striptests <file>
|
||||
EOT
|
||||
|
||||
unless ($ARGV[0]) {
|
||||
print $usage;
|
||||
exit 0;
|
||||
}
|
||||
|
||||
foreach $filename (@ARGV) {
|
||||
|
||||
unless (-f $filename) {
|
||||
print "skipping $filename - file not found\n";
|
||||
next
|
||||
}
|
||||
|
||||
if ($filename =~ /\.pm/ || $filename =~ /\.pl/) {
|
||||
print "processing $filename\n";
|
||||
} else {
|
||||
print "skipping $filename - not a perl file\n";
|
||||
next
|
||||
}
|
||||
|
||||
open INFILE, "<$filename";
|
||||
open OUTFILE, ">$filename.mod";
|
||||
while (<INFILE>) {
|
||||
s/$pattern/\#$pattern/g;
|
||||
print OUTFILE;
|
||||
}
|
||||
close INFILE;
|
||||
close OUTFILE;
|
||||
system "mv $filename.mod $filename";
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user