cvsparser.pl from gzz at Krugle
Show cvsparser.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
#
#
#
# Written by Antti-Juhani Kaijanaho for the GZigZag project
use strict 'vars';
sub main {
my @dirs = ();
my $dn = "";
push @dirs, ".";
DIRS : while ($#dirs >= 0) {
$dn = pop @dirs;
print STDERR "Finding files in `$dn'...";
open(ENTRIES, "<$dn/CVS/Entries") || next DIRS;
while (<ENTRIES>) {
if (m|^(D?)/([^/]+)/-?([0-9]+(\.[0-9]+)*)?/(dummy timestamp)?|) {
my $dir = ($1 eq "D");
my $name = $2;
if (defined $5) {
print STDERR "Ignoring $name\n";
} elsif ($dir) {
push @dirs, "$dn/$name";
} else {
print "$dn/$name\n";
}
} elsif (/^D$/) {
# ignore
} else {
print STDERR "###$_###";
die "syntax error"
}
}
close(ENTRIES);
print STDERR "done.\n";
}
}
main();
See more files for this project here