diff options
author | tradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2008-06-17 17:13:10 +0000 |
---|---|---|
committer | tradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2008-06-17 17:13:10 +0000 |
commit | 586899149cca71a9df5c268e230211b2a7684501 (patch) | |
tree | e6414f306c696118e90f88120c9551d817db508f /lib/sbin | |
parent | d4b9c262a443b834dd43055a56a2445fb277e436 (diff) |
Frank Loeffler's patch "Support for svn in 'make update' (2)"
(http://www.cactuscode.org/old/pipermail/patches/2008-June/000242.html)
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4494 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin')
-rw-r--r-- | lib/sbin/CVSUpdate.pl | 47 | ||||
-rw-r--r-- | lib/sbin/MakeUtils.pl | 10 |
2 files changed, 42 insertions, 15 deletions
diff --git a/lib/sbin/CVSUpdate.pl b/lib/sbin/CVSUpdate.pl index 7ea82481..3341f6cd 100644 --- a/lib/sbin/CVSUpdate.pl +++ b/lib/sbin/CVSUpdate.pl @@ -11,18 +11,20 @@ my $cvs_ops="-z6 -q"; my $cvs_update_ops="-d -P"; +my $svn_ops=""; # 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"); +print("Updating Flesh\n"); $command = "cvs $cvs_ops update $cvs_update_ops $cvs_symbolic_name CONTRIBUTORS COPYRIGHT Makefile lib doc src arrangements/README"; if ($debug) { @@ -59,7 +61,7 @@ chomp ($home); $arrangement_dir = "$home/$arrangement_dir"; if ($thornlist =~ /^$/) { - %info = &buildthorns($arrangement_dir,"thorns"); + %info = &buildthorns($arrangement_dir,"thorns-to-update"); } else { %info = &ReadThornlist($thornlist); } @@ -76,7 +78,7 @@ foreach $thorn (sort keys %info) { chdir ("$arrangement_dir/$arrangement/doc") || die "Cannot change to arrangement directory '$arrangement_dir/$arrangement'\n"; - print("\nUpdating $arrangement\n"); + print("Updating arrangement $arrangement\n"); $command = "cvs $cvs_ops update $cvs_update_ops $cvs_symbolic_name"; if($debug) { @@ -106,30 +108,47 @@ foreach $thorn (sort keys %info) } } - 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"; + print("Updating thorn $thorn\n"); 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, "<CVS/$file") || die "Could not open CVS file"; - while (<FILE>) + foreach $file (`ls CVS`) { - print; + chop($file); + print "Contents of $file\n"; + open (FILE, "<CVS/$file") || die "Could not open CVS file"; + while (<FILE>) + { + print; + } } } } diff --git a/lib/sbin/MakeUtils.pl b/lib/sbin/MakeUtils.pl index 6dd9fdd6..905fb210 100644 --- a/lib/sbin/MakeUtils.pl +++ b/lib/sbin/MakeUtils.pl @@ -102,7 +102,15 @@ sub buildthorns { foreach $thorn (@total_list) { - if( -r "$thorn/interface.ccl" && -r "$thorn/param.ccl") + # don't check for {interface,param}.ccl files + # when compiling a list of thorns to be updated + if( $choice eq 'thorns-to-update' ) + { + # include this thorn with no further thorn info + # (only the keys are needed by the calling routine) + $info{$thorn} = 1; + } + elsif ( -r "$thorn/interface.ccl" && -r "$thorn/param.ccl") { $info{$thorn} = &ThornInfo($thorn); } |