cvsuser 04/10/03 22:06:26
Modified: tools/dev install_files.pl
Log:
Handle comments and blank lines, and make it a little harder to make the
mistakes that I just did. Make your own damn mistakes.
Revision Changes Path
1.8 +14 -1 parrot/tools/dev/install_files.pl
Index: install_files.pl
===================================================================
RCS file: /cvs/public/parrot/tools/dev/install_files.pl,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -r1.7 -r1.8
--- install_files.pl 4 Oct 2004 04:50:21 -0000 1.7
+++ install_files.pl 4 Oct 2004 05:06:26 -0000 1.8
@@ -1,7 +1,7 @@
#! perl -w
################################################################################
# Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-# $Id: install_files.pl,v 1.7 2004/10/04 04:50:21 sfink Exp $
+# $Id: install_files.pl,v 1.8 2004/10/04 05:06:26 sfink Exp $
################################################################################
=head1 TITLE
@@ -134,14 +134,25 @@
}
}
+# We'll report multiple occurrences of the same file
+my %seen;
+
my @files;
my %directories;
@ARGV = @manifests;
while(<>) {
chomp;
+
+ s/\#.*//; # Ignore comments
+ next if /^\s*$/; # Skip blank lines
+
my ($src, $meta, $dest) = split(/\s+/, $_);
$dest ||= $src;
+ if ($seen{$src}++) {
+ print STDERR "$ARGV:$.: Duplicate entry $src\n";
+ }
+
# Parse out metadata
my $generated = $meta =~ s/^\*//;
my ($package) = $meta =~ /^\[(.*?)\]/;
@@ -166,6 +177,8 @@
$directories{dirname($dest)} = 1;
push(@files, [ $src => $dest ]);
+} continue {
+ close ARGV if eof; # Reset line numbering for each input file
}
for my $dir (keys %directories) {