[interchange] * Don't make the archaic .~* file copies if we detect any kind

Mike Heins interchange-cvs at icdevgroup.org
Sun Jan 22 13:47:05 UTC 2017


commit 07552f9ea6803ed4ae211bbad428b3dd6f44c9f8
Author: Mike Heins <mikeh at endpoint.com>
Date:   Sun Jan 22 08:39:16 2017 -0500

    * Don't make the archaic .~* file copies if we detect any kind
      of SCSS (i.e. git, CVS, RCS) in the root of the folder. (Subversion
      not detected due to lack of knowledge of reliable indicator).
    
      TODO: Will not detect repositories in parent folders, obviously, but
      we could add a configuration to force from command line.

 Makefile.PL   |   23 +++++++++++++++--------
 WHATSNEW-5.11 |    8 ++++++++
 2 files changed, 23 insertions(+), 8 deletions(-)
---
diff --git a/Makefile.PL b/Makefile.PL
index 19733f3..aa49e1b 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -23,6 +23,7 @@ use strict;
 use vars (qw($VERSION $DOWARN));
 
 my $TermRead;
+my $HaveSCCS;
 my $Prompt_sub;
 my @mods_to_get;
 my @remove_old;
@@ -121,6 +122,7 @@ sub install_file {
 		$perms = (stat(_))[2] & 0777;
 	}
 
+
 	if( -f $targfile and ! compare_file($srcfile, $targfile) ) {
 		open (GETVER, $targfile)
 			or die "Couldn't read $targfile for version update: $!\n";
@@ -130,16 +132,20 @@ sub install_file {
 			$extra =~ tr/0-9//cd;
 			last;
 		}
-		$extra = '~' unless $extra;
-		my $rename = get_rename($targfile, $extra);
-		while (-f $rename ) {
+		
+		## Assume we don't need to make these archaic copies if a SCCS is in play
+		unless($HaveSCCS) {
+			$extra = '~' unless $extra;
+			my $rename = get_rename($targfile, $extra);
+			while (-f $rename ) {
+				push @remove_old, $rename;
+				$extra .= '~';
+				$rename = get_rename($targfile, $extra);
+			}
 			push @remove_old, $rename;
-			$extra .= '~';
-			$rename = get_rename($targfile, $extra);
+			rename $targfile, $rename
+				or die "Couldn't rename $targfile to $rename: $!\n";
 		}
-		push @remove_old, $rename;
-		rename $targfile, $rename
-			or die "Couldn't rename $targfile to $rename: $!\n";
 	}
 
 	File::Copy::copy($srcfile, $targfile)
@@ -443,6 +449,7 @@ EOF
 
 		# install share/ files from MANIFEST
 		chomp(my @sharefiles = grep m:^share/:, @files);
+		$HaveSCCS = (-d "$realdir/.git" or -d "$realdir/CVS" or -d "$realdir/RCS") ? 1 : 0;
 		install_file('.', $realdir, $_) for @sharefiles;
 		# install code/ files from MANIFEST
 		chomp(my @codefiles = grep m:^code/:, @files);
diff --git a/WHATSNEW-5.11 b/WHATSNEW-5.11
index 1c02f11..8097817 100644
--- a/WHATSNEW-5.11
+++ b/WHATSNEW-5.11
@@ -10,6 +10,14 @@
 
 Interchange 5.11 not yet released
 
+Installation
+----
+
+* Assume that if a source code control repository is present in
+  the installation directory, we don't need to do the archaic .~*
+  file copies.
+
+
 Core
 ----
 



More information about the interchange-cvs mailing list