X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=darcs-all;h=5e7872946835ce2b1a3c540c24cb2f6fd31f4a50;hb=a999a72ed635ca95806b4fe3e15fa2b1a6fea967;hp=0272df55f1746aea8b585afd888b4c8d2e50b4db;hpb=99daef874ab8f0c3b1d1ec1888d6bb6d368a4b79;p=ghc-hetmet.git diff --git a/darcs-all b/darcs-all index 0272df5..5e78729 100644 --- a/darcs-all +++ b/darcs-all @@ -55,9 +55,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 +81,6 @@ sub darcsall { die "Bad line: $_"; } } - close IN; } sub darcsget { @@ -86,6 +89,7 @@ sub darcsget { my $remotepath; my $path; my $tag; + my @repos; if (! grep /(?:--complete|--partial)/, @_) { warning("adding --partial, to override use --complete"); @@ -96,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; @@ -107,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})) { @@ -119,11 +131,10 @@ sub darcsget { } } } - elsif (! /^$/) { + elsif (! /^(#.*)?$/) { die "Bad line: $_"; } } - close IN; } sub main {