manifest-filter.pl from gzz at Krugle
Show manifest-filter.pl syntax highlighted
#!/usr/bin/perl -w
#
# Copyright (c) 2003, Antti-Juhani Kaijanaho
#
# This file is part of Gzz.
#
# Gzz is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Gzz is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
# Public License for more details.
#
# You should have received a copy of the GNU Lesser General
# Public License along with Gzz; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
#
#
# Read in the filter list.
# Print out lines starting with + directly.
# Save the lines starting with - in the array @del for deleting
# the files from input later
#
open FILTER, "<manifest-filter.lst";
while (<FILTER>) {
/^\+ *(.*)$/ and print "$1\n";
/^- *(.*)$/ and push @del, $1;
}
# Loop through the standard input, deleting lines that match regexes
# in @del.
LINE: while (<>) {
for $f (@del) {
/$f/ and next LINE;
}
print;
}
See more files for this project here