aboutsummaryrefslogtreecommitdiffstats
path: root/CVSROOT
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1995-08-05 21:13:50 +0800
committerpeter <peter@FreeBSD.org>1995-08-05 21:13:50 +0800
commit537b4832694caa573bef8e2c7dd08f57dd82a34a (patch)
treee0a62f617548cc4d1d9d52c8679b00ed4e8eb0ba /CVSROOT
parente0752062598626fdb7bca600ba59ddf267e27d1c (diff)
downloadfreebsd-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-xCVSROOT/cvsedit19
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);