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 : "";
message "== $localpath repo not present; skipping";
}
}
- elsif (! /^$/) {
+ elsif (! /^(#.*)?$/) {
die "Bad line: $_";
}
}
- close IN;
}
sub darcsget {
my $remotepath;
my $path;
my $tag;
+ my @repos;
if (! grep /(?:--complete|--partial)/, @_) {
warning("adding --partial, to override use --complete");
}
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;
$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})) {
}
}
}
- elsif (! /^$/) {
+ elsif (! /^(#.*)?$/) {
die "Bad line: $_";
}
}
- close IN;
}
sub main {