summaryrefslogtreecommitdiff
path: root/sync-all
diff options
context:
space:
mode:
Diffstat (limited to 'sync-all')
-rwxr-xr-xsync-all23
1 files changed, 18 insertions, 5 deletions
diff --git a/sync-all b/sync-all
index 741e22b2cb..5d7e313536 100755
--- a/sync-all
+++ b/sync-all
@@ -2,6 +2,7 @@
use strict;
use Cwd;
+use English;
$| = 1; # autoflush stdout after each print, to avoid output after die
@@ -55,6 +56,8 @@ sub parsePackages {
$line{"tag"} = $2;
$line{"remotepath"} = $3;
push @packages, \%line;
+
+ $tags{$2} = 0;
}
elsif (! /^(#.*)?$/) {
die "Bad content on line $lineNum of packages file: $_";
@@ -244,8 +247,6 @@ sub gitall {
my $is_github_repo = $repo_base =~ m/(git@|git:\/\/|https:\/\/)github.com/;
- parsePackages;
-
@args = ();
if ($command =~ /^remote$/) {
@@ -554,14 +555,18 @@ sub help
{
my $exit = shift;
+ my $tags = join ' ', sort (grep !/^-$/, keys %tags);
+
# Get the built in help
my $help = <<END;
Usage:
./sync-all [-q] [-s] [--ignore-failure] [-r repo] [--checked-out] [--bare]
- [--nofib] [--extra] [--testsuite] [--no-dph] [--resume]
+ [--<tag>] [--no-<tag>] [--resume]
cmd [git flags]
+ where <tag> is one of: $tags
+
Applies the command "cmd" to each repository in the tree.
A full repository tree is obtained by first cloning the ghc
@@ -752,8 +757,13 @@ END
sub main {
+ &parsePackages();
+
$tags{"-"} = 1;
$tags{"dph"} = 1;
+ if ($OSNAME =~ /^(MSWin32|Cygwin)$/) {
+ $tags{"windows"} = 1;
+ }
while ($#_ ne -1) {
my $arg = shift;
@@ -792,12 +802,15 @@ sub main {
}
# --<tag> says we grab the libs tagged 'tag' with
# 'get'. It has no effect on the other commands.
- elsif ($arg =~ m/^--no-(.*)$/) {
+ elsif ($arg =~ m/^--no-(.*)$/ && defined($tags{$1})) {
$tags{$1} = 0;
}
- elsif ($arg =~ m/^--(.*)$/) {
+ elsif ($arg =~ m/^--(.*)$/ && defined($tags{$1})) {
$tags{$1} = 1;
}
+ elsif ($arg =~ m/^-/) {
+ die "Unrecognised flag: $arg";
+ }
else {
unshift @_, $arg;
if (grep /^-q$/, @_) {