diff options
author | joe <joe@FreeBSD.org> | 2001-09-02 21:49:25 +0800 |
---|---|---|
committer | joe <joe@FreeBSD.org> | 2001-09-02 21:49:25 +0800 |
commit | 04b79e8e3895e4e879c24bc9c8579f4db487712d (patch) | |
tree | 7892768b0c9251abee451c14beb5c13de4261d96 /CVSROOT/commit_prep.pl | |
parent | aa4cdc8603ced605b8293bf9851468fe4a0865b4 (diff) | |
download | freebsd-ports-gnome-04b79e8e3895e4e879c24bc9c8579f4db487712d.tar.gz freebsd-ports-gnome-04b79e8e3895e4e879c24bc9c8579f4db487712d.tar.zst freebsd-ports-gnome-04b79e8e3895e4e879c24bc9c8579f4db487712d.zip |
General code tidy up.
Diffstat (limited to 'CVSROOT/commit_prep.pl')
-rwxr-xr-x | CVSROOT/commit_prep.pl | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/CVSROOT/commit_prep.pl b/CVSROOT/commit_prep.pl index 5967d7b42645..059d358d2265 100755 --- a/CVSROOT/commit_prep.pl +++ b/CVSROOT/commit_prep.pl @@ -104,30 +104,29 @@ sub check_version { my $lastversion = shift; my $bareid; - my $exclude; my $id; - my $path; my $rname; my $version; # not present - either removed or let cvs deal with it. return 0 unless -f $filename; - open FILE, $filename or die "Cannot open $filename, stopped\n"; - # requiring the header within the first 'n' lines isn't useful. + # Search the file for a $$HEADER$. my $pos; my $line; - while (1) { + open FILE, $filename or die "Cannot open $filename, stopped\n"; + while ($line = <FILE>) { $pos = -1; - last if eof(FILE); - $line = <FILE>; - $pos = index($line, "\$$HEADER"); + $pos = index($line, "\$$HEADER"); # XXX \$$HEADER(:[^\$]*)?\$ ? last if ($pos >= 0); } + close FILE; + # A $HEADER wasn't found. Look in the exclude + # file to see whether this is ok. if ($pos == -1) { - $exclude = $cvsroot . "/CVSROOT/exclude"; - $path = $directory . "/" . $filename; + my $exclude = $cvsroot . "/CVSROOT/exclude"; + my $path = $directory . "/" . $filename; open(EX, "<$exclude") || die("cannot open $exclude: $!"); while (<EX>) { chomp; |