- my $ghcrepo = $checked_out ? $reporoot : "$reporoot/ghc";
- darcs_push ($ghcrepo, @_);
- for $dir (@top_dirs) {
- if (-d $dir && -d "$dir/_darcs") {
- darcs_push ("$reporoot/$dir", @_, "--repodir", $dir);
- }
- else {
- message "== $dir not present or not a repository; skipping";
- }
- }
- my $library_lists = $boot_only
- ? "libraries/boot-packages"
- : "libraries/boot-packages libraries/extra-packages";
- for my $pkg (`cat $library_lists`) {
- chomp $pkg;
- $dir = "libraries/$pkg";
- if (-d "$dir") {
- darcs_push ("$reporoot/$dir", @_, "--repodir", "$dir");
+ my $localpath;
+ my $remotepath;
+ my $path;
+ my $tag;
+ my @repos;
+
+ open IN, "< packages" or die "Can't open packages file";
+ @repos = <IN>;
+ close IN;
+
+ REPO: foreach (@repos) {
+ chomp;
+ if (/^([^# ]+) +(?:([^ ]+) +)?([^ ]+) +([^ ]+)$/) {
+ $localpath = $1;
+ $tag = defined($2) ? $2 : "";
+ $remotepath = $3;
+
+ if ($checked_out) {
+ $path = "$reporoot/$localpath";
+ }
+ else {
+ if ($remotepath =~ /^http:/) {
+ message "Ignoring $localpath; remote is http URL";
+ next REPO;
+ }
+ else {
+ $path = "$reporoot/$remotepath";
+ }
+ }
+
+ if (-d "$localpath/_darcs") {
+ darcs_push ($path, @_, "--repodir", $localpath);
+ }
+ elsif ($tag eq "") {
+ message "== Required repo $localpath is missing! Skipping";
+ }
+ else {
+ message "== $localpath repo not present; skipping";
+ }