From frank.loeffler at aei.mpg.de Tue Sep 11 03:09:33 2007 From: frank.loeffler at aei.mpg.de (Frank Loeffler) Date: Tue, 11 Sep 2007 10:09:33 +0200 Subject: [Patches] ADMMacros, C version fixes Message-ID: <20070911080933.GN2275@peterpan.ap.op.sissa.it> Hi, this patch fixes some compile problems with the C version of the macros. Obviously nobody used this code before. Now at least it compiles. Frank From frank.loeffler at aei.mpg.de Tue Sep 11 03:10:20 2007 From: frank.loeffler at aei.mpg.de (Frank Loeffler) Date: Tue, 11 Sep 2007 10:10:20 +0200 Subject: [Patches] ADMMacros, C version fixes Message-ID: <20070911081020.GO2275@peterpan.ap.op.sissa.it> Hi, this patch fixes some compile problems with the C version of the macros. Obviously nobody used this code before. Now at least it compiles. Frank -------------- next part -------------- Index: src/macro/CDXCDK_guts.h =================================================================== RCS file: /cactusdevcvs/CactusEinstein/ADMMacros/src/macro/CDXCDK_guts.h,v retrieving revision 1.4 diff -r1.4 CDXCDK_guts.h 40c40 < CDXCDK_CDXCDKXX = DXDK_DXDKXX - 2D0*(CHR2_XXX*CDXCDK_KXX --- > CDXCDK_CDXCDKXX = DXDK_DXDKXX - 2.*(CHR2_XXX*CDXCDK_KXX 42c42 < CDXCDK_CDXCDKYY = DXDK_DXDKYY - 2D0*(CHR2_XXY*CDXCDK_KXY --- > CDXCDK_CDXCDKYY = DXDK_DXDKYY - 2.*(CHR2_XXY*CDXCDK_KXY 44c44 < CDXCDK_CDXCDKZZ = DXDK_DXDKZZ - 2D0*(CHR2_XXZ*CDXCDK_KXZ --- > CDXCDK_CDXCDKZZ = DXDK_DXDKZZ - 2.*(CHR2_XXZ*CDXCDK_KXZ Index: src/macro/CDYCDK_guts.h =================================================================== RCS file: /cactusdevcvs/CactusEinstein/ADMMacros/src/macro/CDYCDK_guts.h,v retrieving revision 1.4 diff -r1.4 CDYCDK_guts.h 44c44 < CDYCDK_CDYCDKXX = DYDK_DYDKXX - 2D0*(CHR2_XXY*CDYCDK_KXX + --- > CDYCDK_CDYCDKXX = DYDK_DYDKXX - 2.*(CHR2_XXY*CDYCDK_KXX + 47c47 < CDYCDK_CDYCDKYY = DYDK_DYDKYY - 2D0*(CHR2_XYY*CDYCDK_KXY + --- > CDYCDK_CDYCDKYY = DYDK_DYDKYY - 2.*(CHR2_XYY*CDYCDK_KXY + 50c50 < CDYCDK_CDYCDKZZ = DYDK_DYDKZZ - 2D0*(CHR2_XYZ*CDYCDK_KXZ + --- > CDYCDK_CDYCDKZZ = DYDK_DYDKZZ - 2.*(CHR2_XYZ*CDYCDK_KXZ + Index: src/macro/CDZCDK_guts.h =================================================================== RCS file: /cactusdevcvs/CactusEinstein/ADMMacros/src/macro/CDZCDK_guts.h,v retrieving revision 1.4 diff -r1.4 CDZCDK_guts.h 44c44 < CDZCDK_CDZCDKXX = DZDK_DZDKXX - 2D0*(CHR2_XXZ*CDZCDK_KXX + --- > CDZCDK_CDZCDKXX = DZDK_DZDKXX - 2.*(CHR2_XXZ*CDZCDK_KXX + 47c47 < CDZCDK_CDZCDKYY = DZDK_DZDKYY - 2D0*(CHR2_XYZ*CDZCDK_KXY + --- > CDZCDK_CDZCDKYY = DZDK_DZDKYY - 2.*(CHR2_XYZ*CDZCDK_KXY + 50c50 < CDZCDK_CDZCDKZZ = DZDK_DZDKZZ - 2D0*(CHR2_XZZ*CDZCDK_KXZ + --- > CDZCDK_CDZCDKZZ = DZDK_DZDKZZ - 2.*(CHR2_XZZ*CDZCDK_KXZ + From frank.loeffler at aei.mpg.de Fri Sep 28 16:43:49 2007 From: frank.loeffler at aei.mpg.de (Frank Loeffler) Date: Fri, 28 Sep 2007 23:43:49 +0200 Subject: [Patches] Subversion support for GetCactus Message-ID: <20070928214349.GI7408@peterpan.ap.op.sissa.it> Hi, this patch adds Subversion support for GetCactus. I tried this for some thorns using https as transport method, but it should work for anything that Subversion can handle. I tried not to change anything related to CVS and to keep the structure of the file as it was as much as possible. However, in this patch I also fix a obvious typo ($foundit instead of elsewhere unused $foundif) in the CVS code and I added a comment to what I think is another mistake in the CVS code, but I did not change the actual code (search for 'mistake' and feel free to fix it, which would be trivial). Frank From frank.loeffler at aei.mpg.de Fri Sep 28 16:44:56 2007 From: frank.loeffler at aei.mpg.de (Frank Loeffler) Date: Fri, 28 Sep 2007 23:44:56 +0200 Subject: [Patches] Subversion support for GetCactus Message-ID: <20070928214456.GJ7408@peterpan.ap.op.sissa.it> Hi, this patch adds Subversion support for GetCactus. I tried this for some thorns using https as transport method, but it should work for anything that Subversion can handle. I tried not to change anything related to CVS and to keep the structure of the file as it was as much as possible. However, in this patch I also fix a obvious typo ($foundit instead of elsewhere unused $foundif) in the CVS code and I added a comment to what I think is another mistake in the CVS code, but I did not change the actual code (search for 'mistake' and feel free to fix it, which would be trivial). Frank -------------- next part -------------- Index: GetCactus =================================================================== RCS file: /cactus/Utilities/Scripts/GetCactus,v retrieving revision 1.58 diff -u -r1.58 GetCactus --- GetCactus 12 May 2004 16:33:33 -0000 1.58 +++ GetCactus 28 Sep 2007 21:35:25 -0000 @@ -48,6 +48,7 @@ print "\t-install=\"\" : (default: ./Cactus)\n"; print "\t-anonymous=\"\" : [yes/no] (default: yes)\n"; print "\t-cvs=\"\" : [] (default: cvs)\n"; + print "\t-svn=\"\" : [] (default: svn)\n"; print "\t-repository=\"\" : [stable/development] (default: stable)\n"; print "\t-verbose=\"\" : [yes/no] (default: no)\n"; print "\t-defaults : instruct program to use defaults when unsure\n"; @@ -69,6 +70,8 @@ # Check that CVS is on the system $cvs = &CVSFound if (!defined $cvs); DIE("cvs not found") if (!$cvs); +# Check if SVN is on the system +$svn = &SVNFound if (!defined $svn); # Look for ThornList @@ -194,8 +197,9 @@ next if ($key !~ /REPOSITORY/); if ($rep !~ $thorns{$key}) { $thorns{$key} =~ /(.*:)(.*?)(\/.*)/; - if ($2 eq "") { - my $temprepos = "${1}2401${3}"; + my $tmp = $3; + if (($2 eq "") && ($1 =~ /:pserver.*/)) { + my $temprepos = "${1}2401${tmp}"; if ($rep !~ $temprepos) { $unknownreps{$thorns{$key}} = 1; } @@ -214,8 +218,8 @@ chdir $installdir; $thorns{"THORNS"} = &ShouldWeUpdate("$cactusdir/arrangements/", $thorns{"THORNS"}); -# Get CVS options -$cvs_options = &CVSOptions; +# Get client options +($cvs_options,$svn_options) = &CheckoutOptions; # Checkout the flesh # (if already checked out, get the checked out repository) @@ -311,10 +315,11 @@ { $cvs = "cvs "; } - $foundif = 0; + $foundit = 0; open(MODULES,"$cvs -v | "); while () { + # Frank Loeffler: Isn't this '!' in the next line a mistake? if (!/Concurrent Versions System/) { $foundit = $cvs; @@ -327,6 +332,63 @@ } +#/*@@ +# @routine SVNFound +# @date Sep 2007 +# @author Frank Loeffler +# @desc +# See if svn is installed on the machine +# @enddesc +# @calls +# @calledby +# @history copy of CVSFound with small changes +# +# @endhistory +# +#@@*/ + +sub SVNFound +{ + + my($foundit); + + # here we do thing differently than cvs, because I (Frank Loeffler) think + # that way is wrong. This script should by default choose the version of + # Subversion which is first in the user's path, if there is one. + $svn = "svn "; + $foundit = 0; + open(MODULES,"$svn --version | "); + while () + { + if (/Subversion/) + { + $foundit = $svn; + } + } + close(MODULES); + if ($foundit eq 0) + { + if (-e "/usr/local/bin/svn") + { + $svn = "/usr/local/bin/svn "; + } + elsif (-e "/usr/ncsa/bin/svn") + { + $svn = "/usr/ncsa/bin/svn "; + } + } + open(MODULES,"$svn --version | "); + while () + { + if (/Subversion/) + { + $foundit = $svn; + } + } + + return $foundit; + +} #/*@@ # @routine GetLoginName @@ -818,7 +880,7 @@ if ($debug != 1) { - &RunCVSCommand($command, 1); + &RunCommand($command, 1); #open(CVSCO,$command); #while () #{ @@ -849,7 +911,7 @@ if ($debug != 1) { - &RunCVSCommand($command, 1); + &RunCommand($command, 1); #open(CVSCO,$command); #while () #{ @@ -954,6 +1016,7 @@ #################################### sub GetOneThorn { my ($fleshrep, $options, $tag, $th, %thorns) = @_; + my $client, $svn_repository; $answer = ""; @@ -1032,6 +1095,33 @@ } # rep !~ $thorns{$th.... } # ... =~ /pserver... + if ($thorns{"$th REPOSITORY"} =~ /svn/) + { + if ($svn eq 0) + { + DIE("Did not find Subversion binary 'svn', but Subversion repository ". + "checkout/update was requested."); + } + $client = "svn"; + $svn_repository = $thorns{"$th REPOSITORY"}; + if ($svn_repository =~ /svn:(.+)/) + { + $svn_repository = $1; + } + else + { + $svn_repository = "svn://"; + } + } + else + { + $client = "cvs"; + } + if ($svn eq 0) + { + DIE("Did not find Subversion binary 'svn', but Subversion repository ". + "checkout/update was requested."); + } $th =~ /(.*?)\//; my $cur_arrangement = $1; @@ -1045,10 +1135,10 @@ $arrangement_dirs{$cur_arrangement} = 1; my $command = "$cvs $cvs_options checkout -l $cur_arrangement $tag 2>&1 |"; - &RunCVSCommand($command, 0); + &RunCommand($command, 0); $command = "$cvs $cvs_options checkout ${cur_arrangement}/doc $tag 2>&1 |"; - &RunCVSCommand($command, 0); + &RunCommand($command, 0); } # Checkout or update @@ -1067,9 +1157,33 @@ } if ($answer =~ /^y/i) { - open(REP,"<$th/CVS/Root") || DIE("No CVS files for $th"); - $installedrep = ; - close(REP); + if ($client =~ /cvs/) + { + open(REP,"<$th/CVS/Root") || DIE("No CVS files for $th"); + $installedrep = ; + close(REP); + } + if ($client =~ /svn/) + { + $installedrep = 0; + open(REP,"$svn info $th | "); + while () + { + if (!/URL: (.*)$/) + { + my $tmp = quotemeta($th); + if ($1 =~ /(.*)\/$tmp/) + { + $installedrep = $1 + } + } + } + close(REP); + if ($installedrep eq 0) + { + DIE("Could not figure out Subversion URL for $th"); + } + } chomp $installedrep; my $tp = $thorns{"$th REPOSITORY"}; @@ -1079,16 +1193,23 @@ # if (($thorns{"$th REPOSITORY"} !~ m:^$installedrep$:)) if ($tp ne $installedrep) { - print "\n WARNING: GetCactus is refusing to update $th\n Thorn installed from different repository\n ($installedrep)\n"; + print "\n WARNING: GetCactus is refusing to update $th\n Thorn installed from different repository\n ($installedrep!=$tp)\n"; } else { print " Updating $th\n"; - $command_up = "$cvs $cvs_options -d $thorns{\"$th REPOSITORY\"} update -d $tag $th 2>&1|"; - print " (CVS repository: $thorns{\"$th REPOSITORY\"})\n"; + if ($client =~ /cvs/) + { + $command_up = "$cvs $cvs_options -d $thorns{\"$th REPOSITORY\"} update -d $tag $th 2>&1|"; + } + if ($client =~ /svn/) + { + $command_up = "$svn $svn_options update $th 2>&1|"; + } + print " (Repository: $thorns{\"$th REPOSITORY\"})\n"; if ($debug != 1) { - &RunCVSCommand($command_up, 1); + &RunCommand($command_up, 1); #open(CVSCO,$command_up); #while () #{ @@ -1107,12 +1228,19 @@ { - print " Checking out thorn $th\n CVS repository: $thorns{\"$th REPOSITORY\"}\n CVS module: $thorns{\"$th MODULE\"}\n\n"; + print " Checking out thorn $th\n repository: $thorns{\"$th REPOSITORY\"}\n module: $thorns{\"$th MODULE\"}\n\n"; if ($th eq $thorns{"$th MODULE"}) { - $command_co = "$cvs $cvs_options -d $thorns{\"$th REPOSITORY\"} co $CHECKOUT_OPTIONS $tag $th 2>&1|"; + if ($client =~ /cvs/) + { + $command_co = "$cvs $cvs_options -d $thorns{\"$th REPOSITORY\"} co $CHECKOUT_OPTIONS $tag $th 2>&1|"; + } + if ($client =~ /svn/) + { + $command_co = "$svn $svn_options co $CHECKOUT_OPTIONS $tag $svn_repository/$th $th 2>&1|"; + } $check_dir = ""; } else @@ -1120,7 +1248,14 @@ $th =~ m:^(.*)/(.*):; $check_dir = $1; $call_thorn = $2; - $command_co = "$cvs $cvs_options -d $thorns{\"$th REPOSITORY\"} co -d $call_thorn $tag $thorns{\"$th MODULE\"} 2>&1|"; + if ($client =~ /cvs/) + { + $command_co = "$cvs $cvs_options -d $thorns{\"$th REPOSITORY\"} co -d $call_thorn $tag $thorns{\"$th MODULE\"} 2>&1|"; + } + if ($client =~ /svn/) + { + $command_co = "$svn $svn_options co $CHECKOUT_OPTIONS $tag $svn_repository/$thorns{\"$th MODULE\"} $thorns{\"$th MODULE\"} 2>&1|"; + } } if ($debug != 1) @@ -1141,7 +1276,7 @@ chdir $check_dir; } - &RunCVSCommand($command_co, 1); + &RunCommand($command_co, 1); #open(CVSCO,$command_co); #while () #{ @@ -1162,7 +1297,7 @@ } } -sub RunCVSCommand +sub RunCommand { my $command = shift; my $display_results = shift; @@ -1182,19 +1317,19 @@ # @date Sat Mar 11 15:31:55 CET 2000 # @author Gabrielle Allen # @desc -# Get options to be passed to CVS +# Get options to be passed to CVS/Subversion # @enddesc # @calls # @calledby -# @history +# @history Sep 2007, Frank Loeffler, modified to include subversion options # # @endhistory # #@@*/ -sub CVSOptions +sub CheckoutOptions { - my($answer,$cvs_options); + my($answer,$cvs_options,$svn_options); # Chose information or not do @@ -1219,29 +1354,32 @@ elsif ($answer =~ /^y/i) { $cvs_options = " -z9 "; + $svn_options = ""; } else { $cvs_options = " -Q -z9 "; + $svn_options = " -q"; } } while ($answer =~ /^h/i); - return $cvs_options; + return ($cvs_options, $svn_options); } sub VerboseCheckoutHelp { print "\n\n"; - print " CactusCode CVS checkout options\n"; + print " CactusCode checkout options\n"; print " -------------------------------\n\n"; print " By default, all checkouts using this script use the option -z9\n"; - print " which transfers a compressed version of each file across the \n"; + print " for CVS which transfers a compressed version of each file across the \n"; print " network\n\n"; print " Choosing verbose checkout provides a report of all the files\n"; - print " as they are checked out from the chosen CVS repository, by using \n"; - print " the option -Q\n\n"; - print " cvs -z9 [-Q] -d checkout \n\n"; + print " as they are checked out from the chosen repository, by using \n"; + print " the option -Q for CVS and -q fuer Subversion\n\n"; + print " cvs -z9 [-Q] -d checkout \n"; + print " svn [-q] method:// co \n\n"; } @@ -1490,8 +1628,16 @@ } elsif ($directive =~ "REPOSITORY_PORT") { - if ($value ne "2401") { - $repository_port = $value; + if ( $repository_type =~ /svn/ ) + { + $repository_port = $value; + } + else + { + if ($value ne "2401") + { + $repository_port = $value; + } } next; } @@ -1513,7 +1659,18 @@ $name = &StripSpaces($1); # Thorn repository - $rep = ":$repository_type:$repository_user\@$repository_location:${repository_port}${repository_name}"; + if ( $repository_type =~ /svn$/ ) + { + $rep = "$repository_type://$repository_user\@$repository_location:${repository_port}${repository_name}"; + } + elsif ( $repository_type =~ /svn:/ ) + { + $rep = "$repository_type$repository_user\@$repository_location:${repository_port}${repository_name}"; + } + else + { + $rep = ":$repository_type:$repository_user\@$repository_location:${repository_port}${repository_name}"; + } if ($name && $rep) { @@ -1660,6 +1817,13 @@ print " /.\n\n"; print " Sample thorn lists are provided on the Cactus Code web pages at \n\n"; print " www.cactuscode.org/Download/ThornLists/index.html\n\n"; + print " This script also supports thorns in Subversion rather than CVS. In order\n"; + print " to use this, Subversion has to be properly installed on your machine. You\n"; + print " can check that by typing\n\n"; + print " svn --version\n\n"; + print " This should give you information about the version of Subversion which is\n"; + print " installed. If it is not installed, you can freely obtain it from\n\n"; + print " http://subversion.tigris.org/\n\n"; print " The latest release of the Cactus Code (flesh and thorns) can also\n"; print " be obtained as a tar file from our web site at \n\n"; @@ -1746,18 +1910,19 @@ print " DESCRIPTION \n"; print " Description of the thornlist\n"; print " REPOSITORY_TYPE \n"; - print " pserver\n"; + print " e.g. pserver, svn, svn:http://, svn:https://\n"; print " REPOSITORY_TAG \n"; print " tag to use when checking out\n"; print " REPOSITORY_USER \n"; print " user name for checking out\n"; print " REPOSITORY_NAME \n"; - print " name of CVS repository (location in filesystem)\n"; + print " name of repository (location in filesystem)\n"; print " REPOSITORY_LOCATION \n"; - print " CVS server machine\n"; + print " server machine\n"; print " REPOSITORY_PORT\n"; - print " CVS server port number, defaults to 2401\n\n"; - + print " server port number, defaults to 2401 for CVS. For Subversion\n"; + print " you can enter the port directly into REPOSITORY_LOCATION. Use\n"; + print " REPOSITORY_PORT after REPOSITORY_TYPE.\n\n"; } @@ -1826,7 +1991,7 @@ print " Using Non Cactus Repositories\n"; print " -----------------------------\n\n"; print " Thorn lists can also be used to checkout thorns from\n"; - print " other CVS repositories. These repositories may, or may not,\n"; + print " other CVS or Subversion repositories. These repositories may, or may not,\n"; print " require you to give a username and password depending on their\n"; print " access mechanism.\n\n"; } From frank.loeffler at aei.mpg.de Fri Sep 28 18:26:15 2007 From: frank.loeffler at aei.mpg.de (Frank Loeffler) Date: Sat, 29 Sep 2007 01:26:15 +0200 Subject: [Patches] Subversion support for 'make update' Message-ID: <20070928232615.GK7408@peterpan.ap.op.sissa.it> Hi, this patch adds Subversion support for the Makefile in the following way: make cvsupdate will continue to do what it did in the past: updating Cactus and thorns which are in CVS new: make svnupdate will update thorns which are in Subversion make update will update thorns that are either in CVS or Subversion Frank -------------- next part -------------- ? arrangements/Whisky Index: Makefile =================================================================== RCS file: /cactusdevcvs/Cactus/Makefile,v retrieving revision 1.175 diff -u -r1.175 Makefile --- Makefile 21 May 2007 20:58:15 -0000 1.175 +++ Makefile 28 Sep 2007 23:24:24 -0000 @@ -1195,17 +1195,41 @@ .PHONY: cvsupdate cvsupdate: + $(PERL) -s $(CCTK_HOME)/lib/sbin/CVSUpdate.pl only_CVS:arrangements +svnupdate: + $(PERL) -s $(CCTK_HOME)/lib/sbin/CVSUpdate.pl only_SVN:arrangements +update: $(PERL) -s $(CCTK_HOME)/lib/sbin/CVSUpdate.pl arrangements ifneq ($strip($(CONFIGURATIONS)),) .PHONY $(addsuffix -cvsupdate,$(CONFIGURATIONS)): +.PHONY $(addsuffix -svnupdate,$(CONFIGURATIONS)): +.PHONY $(addsuffix -update,$(CONFIGURATIONS)): $(addsuffix -cvsupdate,$(CONFIGURATIONS)): @echo $(DIVIDER) @echo Updating files for configuration $(@:%-cvsupdate=%) if test -r $(CONFIGS_DIR)/$(@:%-cvsupdate=%)/ThornList ; then \ - $(PERL) -s lib/sbin/CVSUpdate.pl arrangements $(CONFIGS_DIR)/$(@:%-cvsupdate=%)/ThornList; \ + $(PERL) -s lib/sbin/CVSUpdate.pl only_CVS:arrangements $(CONFIGS_DIR)/$(@:%-cvsupdate=%)/ThornList; \ + cd $(CCTK_HOME); \ + fi + @echo " Done." + +$(addsuffix -svnupdate,$(CONFIGURATIONS)): + @echo $(DIVIDER) + @echo Updating files for configuration $(@:%-svnupdate=%) + if test -r $(CONFIGS_DIR)/$(@:%-svnupdate=%)/ThornList ; then \ + $(PERL) -s lib/sbin/CVSUpdate.pl only_SVN:arrangements $(CONFIGS_DIR)/$(@:%-svnupdate=%)/ThornList; \ + cd $(CCTK_HOME); \ + fi + @echo " Done." + +$(addsuffix -update,$(CONFIGURATIONS)): + @echo $(DIVIDER) + @echo Updating files for configuration $(@:%-update=%) + if test -r $(CONFIGS_DIR)/$(@:%-update=%)/ThornList ; then \ + $(PERL) -s lib/sbin/CVSUpdate.pl arrangements $(CONFIGS_DIR)/$(@:%-update=%)/ThornList; \ cd $(CCTK_HOME); \ fi @echo " Done." @@ -1216,6 +1240,16 @@ @echo Configuration $(@:%-cvsupdate=%) does not exist. @echo CVS Update aborted. +%-svnupdate: + @echo $(DIVIDER) + @echo Configuration $(@:%-svnupdate=%) does not exist. + @echo Subversion Update aborted. + +%-update: + @echo $(DIVIDER) + @echo Configuration $(@:%-update=%) does not exist. + @echo Update aborted. + .PHONY: cvsdiff cvsdiff: Index: lib/sbin/CVSUpdate.pl =================================================================== RCS file: /cactusdevcvs/Cactus/lib/sbin/CVSUpdate.pl,v retrieving revision 1.14 diff -u -r1.14 CVSUpdate.pl --- lib/sbin/CVSUpdate.pl 11 May 2004 00:11:25 -0000 1.14 +++ lib/sbin/CVSUpdate.pl 28 Sep 2007 23:24:24 -0000 @@ -11,15 +11,17 @@ my $cvs_ops="-z6 -q"; my $cvs_update_ops="-d -P"; +my $svn_ops="-q"; # Set this to eg -r TAGNAME checkout from a TAG my $cvs_symbolic_name=""; +my $svn_symbolic_name=""; require "lib/sbin/MakeUtils.pl"; $debug = 0; if ($debug) { - print "DEBUG mode: cvs commands not issued\n\n"; + print "DEBUG mode: cvs/svn commands not issued\n\n"; } print("\nUpdating Flesh\n"); @@ -56,6 +58,17 @@ ($arrangement_dir, $thornlist) = @ARGV; +if ($arrangement_dir =~ /only_CVS:(.*)/) +{ + $only_CVS = "yes"; + $arrangement_dir = $1; +} +if ($arrangement_dir =~ /only_SVN:(.*)/) +{ + $only_SVN = "yes"; + $arrangement_dir = $1; +} + $arrangement_dir = "$home/$arrangement_dir"; if ($thornlist =~ /^$/) { @@ -108,28 +121,61 @@ if( ! -d "$arrangement_dir/$thorn/CVS") { - print "Ignoring $thorn - no CVS directory\n"; + if ($only_CVS =~ /yes/) + { + print "Ignoring $thorn - no CVS directory\n"; + next; + } + } + else + { + $command = "cvs $cvs_ops update $cvs_update_ops $cvs_symbolic_name"; + } + if( ! -d "$arrangement_dir/$thorn/.svn") + { + if ($only_SVN =~ /yes/) + { + print "Ignoring $thorn - no .svn directory\n"; + next; + } + } + else + { + $command = "svn $svn_ops update $svn_symbolic_name"; + } + if ( ! -d "$arrangement_dir/$thorn/CVS" && + ! -d "$arrangement_dir/$thorn/.svn" ) + { + print "Ignoring $thorn - no CVS or .svn directory\n"; + next; + } + if ( -d "$arrangement_dir/$thorn/CVS" && + -d "$arrangement_dir/$thorn/.svn" ) + { + print "Ignoring $thorn - both CVS and .svn directory\n"; next; } chdir ("$arrangement_dir/$thorn") || die "Cannot change to thorn directory '$arrangement_dir/$thorn'\n"; print("\nUpdating $thorn\n"); - $command = "cvs $cvs_ops update $cvs_update_ops $cvs_symbolic_name"; if($debug) { $this_dir = `pwd`; chop($this_dir); print "In directory $this_dir\n"; print "Issuing command\n $command\n"; - foreach $file (`ls CVS`) + if ( -d "$arrangement_dir/$thorn/CVS" ) { - chop($file); - print "Contents of $file\n"; - open (FILE, ") + foreach $file (`ls CVS`) { - print; + chop($file); + print "Contents of $file\n"; + open (FILE, ") + { + print; + } } } }