X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=darcs-all;h=5e7872946835ce2b1a3c540c24cb2f6fd31f4a50;hb=7cc35327fd1acde88f3474d4e4727f8d8185ff67;hp=d53ed3630fd58f29fef90bf66ece34611b090819;hpb=50f0cffb836ab1a075339b21322d1b9c39603d28;p=ghc-hetmet.git diff --git a/darcs-all b/darcs-all index d53ed36..5e78729 100644 --- a/darcs-all +++ b/darcs-all @@ -55,13 +55,15 @@ sub darcsall { my $localpath; my $path; my $tag; - - darcs @_; + my @repos; open IN, "< packages" or die "Can't open packages file"; - while () { + @repos = ; + close IN; + + foreach (@repos) { chomp; - if (/^([^ ]+) +(?:([^ ]+) +)?([^ ]+)/) { + if (/^([^# ]+) +(?:([^ ]+) +)?([^ ]+) +([^ ]+)$/) { $localpath = $1; $tag = defined($2) ? $2 : ""; @@ -75,11 +77,10 @@ sub darcsall { message "== $localpath repo not present; skipping"; } } - elsif (! /^$/) { + elsif (! /^(#.*)?$/) { die "Bad line: $_"; } } - close IN; } sub darcsget { @@ -88,6 +89,7 @@ sub darcsget { my $remotepath; my $path; my $tag; + my @repos; if (! grep /(?:--complete|--partial)/, @_) { warning("adding --partial, to override use --complete"); @@ -98,9 +100,12 @@ sub darcsget { } open IN, "< packages" or die "Can't open packages file"; - while () { + @repos = ; + close IN; + + foreach (@repos) { chomp; - if (/^([^ ]+) +(?:([^ ]+) +)?([^ ]+)/) { + if (/^([^ ]+) +(?:([^ ]+) +)?([^ ]+) +([^ ]+)$/) { $localpath = $1; $tag = defined($2) ? $2 : ""; $remotepath = $3; @@ -109,7 +114,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})) { @@ -121,11 +131,10 @@ sub darcsget { } } } - elsif (! /^$/) { + elsif (! /^(#.*)?$/) { die "Bad line: $_"; } } - close IN; } sub main {