diff options
author | peter <peter@FreeBSD.org> | 1995-08-05 21:13:50 +0800 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1995-08-05 21:13:50 +0800 |
commit | 537b4832694caa573bef8e2c7dd08f57dd82a34a (patch) | |
tree | e0a62f617548cc4d1d9d52c8679b00ed4e8eb0ba /CVSROOT | |
parent | e0752062598626fdb7bca600ba59ddf267e27d1c (diff) | |
download | freebsd-ports-gnome-537b4832694caa573bef8e2c7dd08f57dd82a34a.tar.gz freebsd-ports-gnome-537b4832694caa573bef8e2c7dd08f57dd82a34a.tar.zst freebsd-ports-gnome-537b4832694caa573bef8e2c7dd08f57dd82a34a.zip |
get cvsedit to drop likely editor backup files
Diffstat (limited to 'CVSROOT')
-rwxr-xr-x | CVSROOT/cvsedit | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/CVSROOT/cvsedit b/CVSROOT/cvsedit index d94e1a8e9b18..687131c6cbe0 100755 --- a/CVSROOT/cvsedit +++ b/CVSROOT/cvsedit @@ -6,7 +6,7 @@ # To use this, make it executable, and set your editinfo DEFAULT line: # DEFAULT /path/to/this/program # -# $Id: cvsedit,v 1.2 1995/08/05 09:00:19 peter Exp $ +# $Id: cvsedit,v 1.3 1995/08/05 10:58:54 peter Exp $ # # same rules as CVS @@ -77,11 +77,22 @@ while(<IN>) { close(IN); close(OUT); -rename("$tmpfile", "$filename") || - die("cvsedit: Could not rename $tmpfile to $filename: $!"); - # sanity check... if (!$first) { die("cvsedit: Empty log message not permitted!\n"); } + +unlink($filename . "~"); # Nuke likely editor backups.. +unlink($filename . ".bak"); # Nuke likely editor backups.. + +# Check to see if any differences. preserve stat() info if not. +$different = system("cmp -s $tmpfile $filename"); +if (!$different) { + unlink($tmpfile); + exit(0); +} + +rename("$tmpfile", "$filename") || + die("cvsedit: Could not rename $tmpfile to $filename: $!"); + exit(0); |