From knarf at cct.lsu.edu Mon Jun 9 14:21:39 2008 From: knarf at cct.lsu.edu (Frank Loeffler) Date: Mon, 9 Jun 2008 14:21:39 -0500 Subject: [Patches] Subversion support for GetCactus, version 2 Message-ID: <20080609192139.GQ10555@numrel07.cct.lsu.edu> Hi, Cactus provides a script which can obtain the Cactus flesh and thorns which are stored in CVS repositories: the GetCactus script. It can be obtained by http://www.cactuscode.org/download/GetCactus and is stored in :pserver:cvs.cactuscode.org/cactus Utilities/Scripts/GetCactus This patch adds subversion support to this script similar to the cvs support. An example for this would be !REPOSITORY_TYPE svn:https:// !REPOSITORY_LOCATION svn.aei.mpg.de !REPOSITORY_NAME T:/numrelcvs/*/trunk !REPOSITORY_USER cvs_anon AEIThorns/A1JobChaining An older version of this patch has already been posted to this list, but was not yet commited to the Cactus repository. This newer version makes the older patch obsolete, which had problems with specifying branches. thanks for commiting this to the Cactus repositories, Frank Loeffler PS: This email actually has the patch attached. :=/ -------------- next part -------------- --- GetCactus.orig 2008-06-09 09:14:51.000000000 -0500 +++ GetCactus 2008-02-12 10:11:07.000000000 -0600 @@ -1,5 +1,5 @@ eval 'exec perl -sS $0 ${1+"$@"}' if 0; -#!/usr/local/bin/perl -s +#!/usr/local/bin/perl -sw # remove "if 0" from the command line $#ARGV -= 2; @@ -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 @@ -812,13 +874,13 @@ print "\n Updating Cactus Flesh \n"; print " (CVS repository: $repository)\n\n"; chdir ($cactusdir); - $command = "$cvs $cvs_options update -d -P CONTRIBUTORS COPYRIGHT Makefile lib doc src 2>&1|"; + $command = "$cvs $cvs_options update -d -P CONTRIBUTORS COPYRIGHT Makefile lib doc src 2>&1"; - # $command = "$cvs -d $repository $cvs_options update -d $cactusdir |"; + # $command = "$cvs -d $repository $cvs_options update -d $cactusdir "; if ($debug != 1) { - &RunCVSCommand($command, 1); + &RunCommand($command, 1); #open(CVSCO,$command); #while () #{ @@ -845,11 +907,11 @@ print "\n--------------------------------------------------------------------\n"; print "\n Checking out Cactus Flesh \n"; print " (CVS repository: $repository)\n"; - $command = "$cvs $cvs_options -d $repository co $CHECKOUT_OPTIONS -d $cactusdir Cactus 2>&1|"; + $command = "$cvs $cvs_options -d $repository co $CHECKOUT_OPTIONS -d $cactusdir Cactus 2>&1"; 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,34 @@ } # 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"}; + # remove the possible 'svn:' from the repository name for the URL + 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; @@ -1044,11 +1135,11 @@ { $arrangement_dirs{$cur_arrangement} = 1; - my $command = "$cvs $cvs_options checkout -l $cur_arrangement $tag 2>&1 |"; - &RunCVSCommand($command, 0); + my $command = "$cvs $cvs_options checkout -l $cur_arrangement $tag 2>&1 "; + &RunCommand($command, 0); - $command = "$cvs $cvs_options checkout ${cur_arrangement}/doc $tag 2>&1 |"; - &RunCVSCommand($command, 0); + $command = "$cvs $cvs_options checkout ${cur_arrangement}/doc $tag 2>&1 "; + &RunCommand($command, 0); } # Checkout or update @@ -1067,28 +1158,78 @@ } 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 $url = $1; + my $thorn_name = $th; + $th =~ /([^\/]+)\/(.+)/; + if ($2) + { + $thorn_name = $2; + } + # For the special case of one-thorn repositories: + if ($thorns{"$th MODULE"} eq " ") + { + $thorn_name = $th; + } + my $tmp = quotemeta($thorn_name); + if ($url =~ /(.*)\/$tmp/) + { + $installedrep = $1; + } + } + } + close(REP); + if ($installedrep eq 0) + { + DIE("Could not figure out Subversion URL for $th ($svn info $th)"); + } + } chomp $installedrep; my $tp = $thorns{"$th REPOSITORY"}; $tp =~ s/.*\@//; + $tp =~ s/ *--username +\w+ +//; + $tp =~ s/^( *svn:)//; $installedrep =~ s/.*\@//; + $installedrep =~ s/ *--username +\w+ +//; + $installedrep =~ s/^( *svn:)//; # if (($thorns{"$th REPOSITORY"} !~ m:^$installedrep$:)) - if ($tp ne $installedrep) + my $tmp = quotemeta($installedrep); + if ($tp !~ /^$tmp/) { - 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"; + # Give a bit of formatted info during the process + my $rep = $thorns{"$th REPOSITORY"}; + $rep =~ s/--username ([^ ]*) /$1@/g; + print " Updating thorn $th\n repository: $rep\n module: $thorns{\"$th MODULE\"}\n\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"; + } if ($debug != 1) { - &RunCVSCommand($command_up, 1); + &RunCommand($command_up, 1); #open(CVSCO,$command_up); #while () #{ @@ -1105,22 +1246,55 @@ } else { + # Give a bit of formatted info during the process + my $rep = $thorns{"$th REPOSITORY"}; + $rep =~ s/--username ([^ ]*) /$1@/g; + print " Checking out thorn $th\n repository: $rep\n module: $thorns{\"$th MODULE\"}\n\n"; - print " Checking out thorn $th\n CVS repository: $thorns{\"$th REPOSITORY\"}\n CVS module: $thorns{\"$th MODULE\"}\n\n"; - - + my $check_dir = ""; + if ($client =~ /svn/) + { + # If the given thorn name consists of "arrangement_name/thorn_name", + # parse for the two parts + if ($th =~ /^([^\/]*)\/(.*)/) + { + $check_dir = $1."/"; + $call_thorn= $2; + } + # For the special case of one-thorn repositories: + if ($thorns{"$th MODULE"} eq " ") + { + $call_thorn = $th; + } + } + # If the checkout should have another name than the repository suggests, users can set + # the Module name. Note, that it can also be " " (a single space) for one-thorn + # repositories if ($th eq $thorns{"$th MODULE"}) { - $command_co = "$cvs $cvs_options -d $thorns{\"$th REPOSITORY\"} co $CHECKOUT_OPTIONS $tag $th 2>&1|"; - $check_dir = ""; + 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/$call_thorn $call_thorn 2>&1"; + } } else { $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\"} $call_thorn 2>&1"; + } } if ($debug != 1) @@ -1141,7 +1315,7 @@ chdir $check_dir; } - &RunCVSCommand($command_co, 1); + &RunCommand($command_co, 1); #open(CVSCO,$command_co); #while () #{ @@ -1162,19 +1336,19 @@ } } -sub RunCVSCommand +sub RunCommand { my $command = shift; my $display_results = shift; - open (CVSCO, $command) || DIE("Could not run command: $command, because of $!"); - while () { - if ($display_results) { - print $_; - } + if ($display_results) { + (system($command) == 0 )|| DIE("Could not run command: $command, because of $!"); + } + else { + $command.=" |"; + open (CVSCO, $command) || DIE("Could not run command: $command, because of $!"); + close CVSCO; } - - close CVSCO; } #/*@@ @@ -1182,19 +1356,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 +1393,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"; } @@ -1405,6 +1582,7 @@ my($directive,$value); my($parfile); my($repository_user,$repository_location,$repository_name,$repository_port); + my $saved_repositoryr_name = ""; $parfile = 0; @@ -1490,8 +1668,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; } @@ -1512,8 +1698,35 @@ m:^([^#]*):; $name = &StripSpaces($1); + # To maintain the old lists of thorns, create a special rule for thorns as repositories: + # If the name starts with "T:" and contains a "*", the "*" is replaced by the thorn name + # and this thorn is checked out. + if ( $repository_name =~ /T:([^\*]*)\*(.*)/ ) + { + $saved_repository_name = $repository_name; + $repository_name = "$1$name$2"; + $repository_module = " "; + } + # Thorn repository - $rep = ":$repository_type:$repository_user\@$repository_location:${repository_port}${repository_name}"; + if ( $repository_type =~ /svn$/ ) + { + $rep = " --username $repository_user $repository_type://$repository_location:${repository_port}${repository_name}"; + } + elsif ( $repository_type =~ /svn:/ ) + { + $rep = " --username $repository_user $repository_type$repository_location:${repository_port}${repository_name}"; + } + else + { + $rep = ":$repository_type:$repository_user\@$repository_location:${repository_port}${repository_name}"; + } + # Set the repository name back in case we changed it temporarily + if ($saved_repository_name !~ /^$/) + { + $repository_name = $saved_repository_name; + $saved_repository_name = ""; + } if ($name && $rep) { @@ -1660,6 +1873,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 +1966,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 +2047,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 schnetter at cct.lsu.edu Tue Jun 10 16:41:33 2008 From: schnetter at cct.lsu.edu (Erik Schnetter) Date: Tue, 10 Jun 2008 14:41:33 -0700 Subject: [Patches] fix bash warning In-Reply-To: <20080228210755.GE3224@numrel07.cct.lsu.edu> References: <20080228210755.GE3224@numrel07.cct.lsu.edu> Message-ID: <95EFE250-0266-4E6F-9AB2-6C5E7AC98725@cct.lsu.edu> On Feb 28, 2008, at 14:07:55, Frank Loeffler wrote: > Hi, > > this patch fixes a bash warning about -ge being used as a unary > operator > because one of the arguments is undefined. Frank, thanks for the patch. I have applied it. -erik -- Erik Schnetter http://www.cct.lsu.edu/~eschnett/ My email is as private as my paper mail. I therefore support encrypting and signing email messages. Get my PGP key from www.keyserver.net. From knarf at cct.lsu.edu Fri Jun 13 12:04:48 2008 From: knarf at cct.lsu.edu (Frank Loeffler) Date: Fri, 13 Jun 2008 12:04:48 -0500 Subject: [Patches] Support for svn in 'make update' (2) Message-ID: <20080613170448.GG10555@numrel07.cct.lsu.edu> Hi, this patch adds Subversion support for the Makefile in the following way: make cvsupdate should be considered to be deprecated and will be redirected to 'make update' as suggested in http://www.cactuscode.org/old/pipermail/developers/2007-October/005437.html new: make update will update thorns that are either in CVS or Subversion Frank -------------- next part -------------- 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 13 Jun 2008 16:57:55 -0000 @@ -373,7 +373,7 @@ @echo " -testsuite : run the test suites." @echo " -thornlist : regenerate the ThornList file." @echo " -ThornGuide : create the thorn manual for a specific configuration." - @echo " -cvsupdate : update the files for a specific configuration." + @echo " -update : update the files for a specific configuration." @echo " -examples : copy thorn parameter files to examples directory." endif @echo $(DIVIDER) @@ -392,7 +392,7 @@ @echo " cvsdiff - show differences between installed Cactus and" @echo " version in CVS repository." @echo " cvsstatus - report on status of Cactus (when installed from CVS)." - @echo " cvsupdate - update flesh and arrangements from CVS." + @echo " update - update flesh and arrangements from CVS." @echo " default - create a new configuration with a default name." @echo " distclean - delete all existing configurations." @echo " downsize - remove non-essential files." @@ -1192,20 +1192,32 @@ # run cvsudpate on a configuration -.PHONY: cvsupdate +.PHONY: update cvsupdate: $(PERL) -s $(CCTK_HOME)/lib/sbin/CVSUpdate.pl arrangements +update: + $(PERL) -s $(CCTK_HOME)/lib/sbin/CVSUpdate.pl arrangements ifneq ($strip($(CONFIGURATIONS)),) .PHONY $(addsuffix -cvsupdate,$(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; \ + @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." + +$(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." @@ -1213,9 +1225,14 @@ %-cvsupdate: @echo $(DIVIDER) - @echo Configuration $(@:%-cvsupdate=%) does not exist. + @echo Configuration $(@:%-update=%) does not exist. @echo CVS 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 13 Jun 2008 16:57:55 -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"); @@ -106,30 +108,47 @@ } } - if( ! -d "$arrangement_dir/$thorn/CVS") + if( -d "$arrangement_dir/$thorn/CVS") { - print "Ignoring $thorn - no CVS directory\n"; + $command = "cvs $cvs_ops update $cvs_update_ops $cvs_symbolic_name"; + } + if( -d "$arrangement_dir/$thorn/.svn") + { + $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; + } } } } From schnetter at cct.lsu.edu Sun Jun 15 20:09:08 2008 From: schnetter at cct.lsu.edu (Erik Schnetter) Date: Sun, 15 Jun 2008 20:09:08 -0500 Subject: [Patches] Correct error in parameter checking Message-ID: <9535CBF4-C589-4A30-AD8A-3834DCF5DB41@cct.lsu.edu> Cactus has currently an error in its parameter checking. It interprets ranges consisting of single numbers as allowing this number and all larger numbers. For example, the specification INT spatial_order "Order of spatial differencing" { 2 :: "second order" 4 :: "fourth order" } 2 allows all numbers not less than 2. The enclosed patch correct this. Since this involves regular expressions which are often difficult to read, I have broken up the regular expressions into macros containing sub-expressions. I have also replaced calls to atoi and atof with calls to strtol and strtod, since these allow error checking which also was not present before. -erik -- Erik Schnetter http://www.cct.lsu.edu/~eschnett/ My email is as private as my paper mail. I therefore support encrypting and signing email messages. Get my PGP key from www.keyserver.net. -------------- next part -------------- A non-text attachment was scrubbed... Name: Misc.c.diff Type: application/octet-stream Size: 10519 bytes Desc: not available Url : http://www.cactuscode.org/pipermail/patches/attachments/20080615/95451cf8/attachment.obj From tradke at aei.mpg.de Tue Jun 17 05:32:20 2008 From: tradke at aei.mpg.de (Thomas Radke) Date: Tue, 17 Jun 2008 12:32:20 +0200 Subject: [Patches] [Developers] Subversion support for GetCactus, version 2 In-Reply-To: <20080609192139.GQ10555@numrel07.cct.lsu.edu> References: <20080609192139.GQ10555@numrel07.cct.lsu.edu> Message-ID: <485792B4.8040303@aei.mpg.de> Frank Loeffler wrote: > Hi, > > Cactus provides a script which can obtain the Cactus flesh and thorns > which are stored in CVS repositories: the GetCactus script. It can be > obtained by > > http://www.cactuscode.org/download/GetCactus > > and is stored in > > :pserver:cvs.cactuscode.org/cactus Utilities/Scripts/GetCactus > > This patch adds subversion support to this script similar to the cvs > support. Hi Frank, thanks for your patch http://www.cactuscode.org/old/pipermail/patches/2008-June/000240.html ! I have successfully applied and tested it. I have also just committed it. -- Cheers, Thomas. From tradke at aei.mpg.de Tue Jun 17 12:12:04 2008 From: tradke at aei.mpg.de (Thomas Radke) Date: Tue, 17 Jun 2008 19:12:04 +0200 Subject: [Patches] [Developers] Support for svn in 'make update' (2) In-Reply-To: <20080613170448.GG10555@numrel07.cct.lsu.edu> References: <20080613170448.GG10555@numrel07.cct.lsu.edu> Message-ID: <4857F064.9080206@aei.mpg.de> Frank Loeffler wrote: > Hi, > > this patch adds Subversion support for the Makefile in the following > way: > > make cvsupdate > should be considered to be deprecated and will be redirected > to 'make update' as suggested in > http://www.cactuscode.org/old/pipermail/developers/2007-October/005437.html > > new: > > make update > will update thorns that are either in CVS or Subversion Hi Frank, thanks for your patch http://www.cactuscode.org/old/pipermail/patches/2008-June/000242.html ! I applied two minor changes: * slightly changed the wording in the Makefile's help messages * disable the '-q[iet]' option for svn in the CVSUpdate.pl script so that one can follow what files are being modified during an update. I have also extended the patch by another bugfix to solve Bruno's problem with the general 'make update' command having no effect: he had removed the interface.ccl file in one thorn and expected it to be recovered from the repository but it wasn't. It turned out that thorns with no {interface,param}.ccl files (regardless of whether they come from CVS or SNV) were simply ignored as such. This was a bug in the lib/sbin/MakeUtils.pl script. Now everything should work fine. I have committed the patch. -- Cheers, Thomas. From knarf at cct.lsu.edu Fri Jun 27 09:52:29 2008 From: knarf at cct.lsu.edu (Frank Loeffler) Date: Fri, 27 Jun 2008 09:52:29 -0500 Subject: [Patches] bugfix GetCactus Message-ID: <20080627145229.GC3363@numrel07.cct.lsu.edu> Hi, this is a small bugfix for GetCactus when specifying usernames in thornlists of Subversion repositories. GetCactus can be found by cvs -d :pserver:cvs.cactuscode.org/cactus co Utilities/Scripts/GetCactus thanks for applying, Frank -------------- next part -------------- Index: GetCactus =================================================================== RCS file: /cactus/Utilities/Scripts/GetCactus,v retrieving revision 1.59 diff -u -r1.59 GetCactus --- GetCactus 17 Jun 2008 10:31:26 -0000 1.59 +++ GetCactus 27 Jun 2008 14:49:11 -0000 @@ -15,7 +15,7 @@ # ./GetCactus # # @enddesc -# @version $Header: /cactus/Utilities/Scripts/GetCactus,v 1.59 2008/06/17 10:31:26 tradke Exp $ +# @version $Header: /cactus/Utilities/Scripts/GetCactus,v 1.58 2004/05/12 16:33:33 tradke Exp $ # @@*/ # Add something here to checkout from a given date or tag, for example @@ -1105,13 +1105,13 @@ $client = "svn"; $svn_repository = $thorns{"$th REPOSITORY"}; # remove the possible 'svn:' from the repository name for the URL - if ($svn_repository =~ /svn:(.+)/) + if ($svn_repository =~ /(.+) svn:(.+)/) { - $svn_repository = $1; + $svn_repository = "$1 $2"; } else { - $svn_repository = "svn://"; + $svn_repository = "$1 svn://$2"; } } else