X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=darcs-all;h=e8a113915ab5d15a88112df7d19c9d69cd4b2d2f;hp=6c8b406cf3816d9cec4e254233f5063fc8b54205;hb=1d141bd52e6eea321e90cd11059f726094dd50be;hpb=4260f0c9b38d9b8b5851eae021d0a45a90719ef0 diff --git a/darcs-all b/darcs-all index 6c8b406..e8a1139 100644 --- a/darcs-all +++ b/darcs-all @@ -2,6 +2,24 @@ use strict; +# Usage: +# +# ./darcs-all [-q] [-s] [--nofib] [--testsuite] get [darcs get flags] +# This gets the GHC core repos, if they do not already exist. +# -q says to be quite, and -s to be silent. +# --nofib, --testsuite also get the nofib and testsuite repos respectively +# The darcs get flag you are most likely to want is --complete. By +# default we pass darcs the --partial flag. +# +# ./darcs-all [-q] [-s] cmd [darcs cmd flags] +# This runs the darcs "cmd" command, with any flags you give, in all +# of the repos you have checked out. e.g. +# ./darcs-all pull +# ./darcs-all -q send --dry-run +# -q says to be quite, and -s to be silent. + +$| = 1; # autoflush stdout after each print, to avoid output after die + # Figure out where to get the other repositories from, # based on where this GHC repo came from. my $defaultrepo = `cat _darcs/prefs/defaultrepo`; @@ -55,9 +73,13 @@ sub darcsall { my $localpath; my $path; my $tag; + my @repos; open IN, "< packages" or die "Can't open packages file"; - while () { + @repos = ; + close IN; + + foreach (@repos) { chomp; if (/^([^# ]+) +(?:([^ ]+) +)?([^ ]+) +([^ ]+)$/) { $localpath = $1; @@ -77,7 +99,6 @@ sub darcsall { die "Bad line: $_"; } } - close IN; } sub darcsget { @@ -86,6 +107,7 @@ sub darcsget { my $remotepath; my $path; my $tag; + my @repos; if (! grep /(?:--complete|--partial)/, @_) { warning("adding --partial, to override use --complete"); @@ -96,7 +118,10 @@ sub darcsget { } open IN, "< packages" or die "Can't open packages file"; - while () { + @repos = ; + close IN; + + foreach (@repos) { chomp; if (/^([^ ]+) +(?:([^ ]+) +)?([^ ]+) +([^ ]+)$/) { $localpath = $1; @@ -107,7 +132,12 @@ sub darcsget { $path = "$defaultrepo_base/$localpath"; } else { - $path = "$defaultrepo_base/$remotepath"; + if ($remotepath =~ /^http:/) { + $path = $remotepath; + } + else { + $path = "$defaultrepo_base/$remotepath"; + } } if (($tag eq "") || defined($tags{$tag})) { @@ -123,7 +153,6 @@ sub darcsget { die "Bad line: $_"; } } - close IN; } sub main { @@ -141,16 +170,6 @@ sub main { elsif ($arg eq "-s") { $verbose = 0; } - # --dph says we grab the dph libs with 'get'. - # It has no effect on the other commands. - elsif ($arg eq "--dph") { - $tags{"dph"} = 1; - } - # --extra says we grab the extra libs with 'get'. - # It has no effect on the other commands. - elsif ($arg eq "--extra") { - $tags{"extralibs"} = 1; - } # --nofib tells get to also grab the nofib repo. # It has no effect on the other commands. elsif ($arg eq "--nofib") {