diff options
author | peter <peter@FreeBSD.org> | 2000-02-13 12:14:21 +0800 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2000-02-13 12:14:21 +0800 |
commit | e4f895fee6b97a188220bf31f656ece782222948 (patch) | |
tree | a829636873c0ff2b074ec92b8ff8709cf0840c1f /CVSROOT | |
parent | 5c0a2c54aeaa8af6ff0a9d4d84e6890c8e9de82e (diff) | |
download | freebsd-ports-gnome-e4f895fee6b97a188220bf31f656ece782222948.tar.gz freebsd-ports-gnome-e4f895fee6b97a188220bf31f656ece782222948.tar.zst freebsd-ports-gnome-e4f895fee6b97a188220bf31f656ece782222948.zip |
Remove this, it lives on in logcheck.
Diffstat (limited to 'CVSROOT')
-rwxr-xr-x | CVSROOT/cvsedit | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/CVSROOT/cvsedit b/CVSROOT/cvsedit deleted file mode 100755 index 8cc396110a1b..000000000000 --- a/CVSROOT/cvsedit +++ /dev/null @@ -1,100 +0,0 @@ -#! /usr/bin/perl -w -# -# $FreeBSD$ -# -# This crude hack is to sanitise the results of what the user may have -# "done" while editing the commit log message.. :-) Peter Wemm. -# -# To use this, make it executable, and set your editinfo DEFAULT line: -# DEFAULT /path/to/this/program -# - -# same rules as CVS -$editor="vi"; -if (defined $ENV{'EDITOR'}) { # $EDITOR overrides default - $editor = $ENV{'EDITOR'}; -} -if (defined $ENV{'CVSEDITOR'}) { # $CVSEDITOR overrises $EDITOR - $editor = $ENV{'CVSEDITOR'}; -} - -if (!@ARGV) { - die "Usage: cvsedit filename\n"; -} -$filename = $ARGV[0]; -$tmpfile = $filename . "tmp"; - -$retcode = system("$editor $filename"); -$retcode /= 256; - -if ($retcode) { - # Kaboom! - exit($retcode); -} - -open(IN, "< $filename") || - die "cvsedit: Cannot open for reading: $filename: $!\n"; - -open(OUT, "> $tmpfile") || - die "cvsedit: Cannot open for writing: $tmpfile: $!\n"; - -# In-place edit the result of the user's edit on the file. -$blank = 0; # true if the last line was blank -$first = 0; # true if we have seen the first real text -while(<IN>) { - - # Dont let CVS: lines upset things, but maintain them in case - # the editor is re-entered. NO CHANGES!! - if (/^CVS:/) { - print OUT; - next; - } - - chop; # strip trailing newline - s/[\s]+$//; # strip trailing whitespace - - # collapse multiple blank lines, and trailing blank lines. - if (/^$/) { - # Blank line. Remember in case more text follows. - $blank = 1; - next; - } else { - # Delete if they only have whitespace after them. - if (/^PR:$/i || - /^Reviewed by:$/i || - /^Submitted by:$/i || - /^Obtained from:$/i || - /^CC:$/i) { - next; - } - if ($blank && $first) { - # Previous line(s) was blank, this isn't. Close the - # collapsed section. - print OUT "\n"; - } - $blank = 0; # record non-blank - $first = 1; # record first line - print OUT "$_\n"; - } -} -close(IN); -close(OUT); - -unlink($filename . "~"); # Nuke likely editor backups.. -unlink($filename . ".bak"); # Nuke likely editor backups.. - -# Check to see if any differences. -$different = system("cmp -s $tmpfile $filename"); - -# Make a clean exit if there are no changes, or there is no 'text' -# - for example, a user quit the editor without saving. -# preserve stat() info if appropriate. -if (!$different || !$first) { - unlink($tmpfile); - exit(0); -} - -rename("$tmpfile", "$filename") || - die("cvsedit: Could not rename $tmpfile to $filename: $!"); - -exit(0); |