X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=sync-all;h=09130c0e52010a3f000f887f586bea1c3c22a34f;hp=0d0af6767f80c020efbcddd089cc5440b671c27d;hb=b1001917414ef857acaf864150f8b8fdec8bbfbe;hpb=b61c52db76972676b7ba112d8cb723ce18504024 diff --git a/sync-all b/sync-all index 0d0af67..09130c0 100755 --- a/sync-all +++ b/sync-all @@ -228,6 +228,8 @@ sub scmall { my ($repo_base, $checked_out_tree) = getrepo(); + my $is_github_repo = $repo_base =~ m/(git@|git:\/\/|https:\/\/)github.com/; + parsePackages; @args = (); @@ -260,7 +262,6 @@ sub scmall { } push(@args, @_); - print "args: @args\n"; for $line (@packages) { @@ -270,6 +271,12 @@ sub scmall { $scm = $$line{"vcs"}; $upstream = $$line{"upstream"}; + # We can't create directories on GitHub, so we translate + # "package/foo" into "package-foo". + if ($is_github_repo) { + $remotepath =~ s/\//-/; + } + # Check the SCM is OK as early as possible die "Unknown SCM: $scm" if (($scm ne "darcs") and ($scm ne "git")); @@ -282,20 +289,23 @@ sub scmall { } # Work out the arguments we should give to the SCM - if ($command =~ /^(?:w|wh|wha|what|whats|whatsn|whatsne|whatsnew)$/) { + if ($command =~ /^(?:w|wh|wha|what|whats|whatsn|whatsne|whatsnew|status)$/) { @scm_args = (($scm eq "darcs" and "whatsnew") or ($scm eq "git" and "status")); # Hack around 'darcs whatsnew' failing if there are no changes $ignore_failure = 1; } + elsif ($command =~ /^commit$/) { + @scm_args = ("commit"); + # git fails if there is nothing to commit, so ignore failures + $ignore_failure = 1; + } elsif ($command =~ /^(?:pus|push)$/) { @scm_args = "push"; - $want_remote_repo = 1; } elsif ($command =~ /^(?:pul|pull)$/) { @scm_args = "pull"; - $want_remote_repo = 1; # Q: should we append the -a argument for darcs repos? } elsif ($command =~ /^(?:g|ge|get)$/) { @@ -346,6 +356,14 @@ sub scmall { @scm_args = ("remote", "set-url", $branch_name, $path); } } + elsif ($command =~ /^grep$/) { + @scm_args = ("grep"); + # Hack around 'git grep' failing if there are no matches + $ignore_failure = 1; + } + elsif ($command =~ /^config$/) { + @scm_args = "config"; + } else { die "Unknown command: $command"; } @@ -387,6 +405,7 @@ What do you want to do? Supported commands: * whatsnew + * commit * push * pull * get, with options: @@ -399,6 +418,8 @@ Supported commands: * remote add * remote rm * remote set-url [--push] + * grep + * config Available package-tags are: END