Fix Trac #2529: derived read for prefix constructor operators
[ghc-hetmet.git] / darcs-all
index bb41706..483cd9d 100644 (file)
--- a/darcs-all
+++ b/darcs-all
@@ -17,7 +17,7 @@ if ($defaultrepo =~ /^...*:/) {
     $defaultrepo_base =~ s#/[^/]+/?$##;
     $checked_out_tree = 0;
 }
-elsif ($defaultrepo =~ /^(\.\.)?\//) {
+elsif ($defaultrepo =~ /^\/|\.\.\/|.:(\/|\\)/) {
     # Local filesystem, either absolute or relative path
     # (assumes a checked-out tree):
     $defaultrepo_base = $defaultrepo;
@@ -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 (<IN>) {
+    @repos = <IN>;
+    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 (<IN>) {
+    @repos = <IN>;
+    close IN;
+
+    foreach (@repos) {
         chomp;
-        if (/^([^ ]+) +(?:([^ ]+) +)?([^ ]+)/) {
+        if (/^([^ ]+) +(?:([^ ]+) +)?([^ ]+) +([^ ]+)$/) {
             $localpath = $1;
             $tag = defined($2) ? $2 : "";
             $remotepath = $3;
@@ -121,11 +126,10 @@ sub darcsget {
                 }
             }
         }
-        elsif (! /^$/) {
+        elsif (! /^(#.*)?$/) {
             die "Bad line: $_";
         }
     }
-    close IN;
 }
 
 sub main {
@@ -143,11 +147,10 @@ sub main {
         elsif ($arg eq "-s") {
             $verbose = 0;
         }
-        # --ci says we grab cabal-install repo, and the libraries it needs
-        # with 'get'.
+        # --dph says we grab the dph libs with 'get'.
         # It has no effect on the other commands.
-        elsif ($arg eq "--ci") {
-            $tags{"ci"} = 1;
+        elsif ($arg eq "--dph") {
+            $tags{"dph"} = 1;
         }
         # --extra says we grab the extra libs with 'get'.
         # It has no effect on the other commands.