diff options
author | joe <joe@FreeBSD.org> | 2001-12-12 09:32:36 +0800 |
---|---|---|
committer | joe <joe@FreeBSD.org> | 2001-12-12 09:32:36 +0800 |
commit | fed79026a0d6ec875f1ff4ed00018a2193945a5c (patch) | |
tree | 240e661c040425e6777d86c7a236ad9c281771de /CVSROOT | |
parent | e0d834b8b6205b0e8329ebab61b38f1ada4d373c (diff) | |
download | freebsd-ports-gnome-fed79026a0d6ec875f1ff4ed00018a2193945a5c.tar.gz freebsd-ports-gnome-fed79026a0d6ec875f1ff4ed00018a2193945a5c.tar.zst freebsd-ports-gnome-fed79026a0d6ec875f1ff4ed00018a2193945a5c.zip |
Make sure that we only match our own $FreeBSD$ ident, and ignore
other similar ones.
Diffstat (limited to 'CVSROOT')
-rwxr-xr-x | CVSROOT/commit_prep.pl | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/CVSROOT/commit_prep.pl b/CVSROOT/commit_prep.pl index fdd3b2ca41d7..b10a89c32db9 100755 --- a/CVSROOT/commit_prep.pl +++ b/CVSROOT/commit_prep.pl @@ -48,7 +48,7 @@ my $HEADER = $cfg::IDHEADER; # ############################################################ my $NoId = " -%s - Needs to contain a line with the keyword \"\$$HEADER\$\".\n"; +%s - \"\$$HEADER\$\" keyword is either missing or corrupt.\n"; # Protect string from substitution by RCS. my $NoName = " @@ -57,9 +57,6 @@ my $NoName = " #$DelPath = " #%s - The old path and version has been deleted from \$$HEADER\$.\n"; -my $BadId = " -%s - The \$$HEADER\$ is mangled.\n"; - my $BadName = " %s - The pathname '%s' in the \$$HEADER\$ line does not match the actual filename.\n"; @@ -136,15 +133,16 @@ sub check_version { return 0 unless -f $filename; # Search the file for our rcsid. - # NOTE: We stop after finding the first potential match. open FILE, $filename or die "Cannot open $filename, stopped\n"; $found_rcsid = 0; $dos_line_brk_found = 0; $line_number = 0; + $rcsid_info = ""; while (<FILE>) { $line_number++; - if ( /^.*(\$$HEADER.*)/ ) { + if ( /^.*(\$$HEADER(: ([^\$]* )?)?\$)/) { $rcsid = $1; + $rcsid_info = $3 || ""; $found_rcsid = 1; } elsif ( $cfg::NO_DOS_LINEBREAKS and /\r/ ) { # Found a DOS linebreak @@ -154,8 +152,9 @@ sub check_version { } } close FILE; + ($rname, $version) = split /\s/, $rcsid_info; - # The file must NOT contain DOS linebreaks + # The file must not contain DOS linebreaks. if ($dos_line_brk_found) { print $DOSLineErr; return(1); @@ -167,14 +166,6 @@ sub check_version { return(1); } - # Is the rcsid corrupt? - unless ($rcsid =~ /\$$HEADER(: ([^\$]* )?)?\$/) { - printf($BadId, "$directory/$filename"); - return(1); - } - $rcsid_info = $2 || ""; - ($rname, $version) = split /\s/, $rcsid_info; - # Ignore version mismatches (MFC spamming etc) on branches. if ($hastag) { return (0); |