diff options
author | Simon Marlow <marlowsd@gmail.com> | 2009-08-27 13:57:17 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2009-08-27 13:57:17 +0000 |
commit | 87787d75998c8864109b76c34d55e36e55c26e74 (patch) | |
tree | b14783e9102695caa70c7698351aa636afaca8a3 /push-all | |
parent | f58f4328bc68c86f97b34f99a41234c938cc4731 (diff) | |
download | haskell-87787d75998c8864109b76c34d55e36e55c26e74.tar.gz |
REDO: Add -r option to darcs-all, and remove push-all (#3375)
rolling back:
Mon Aug 3 11:44:13 BST 2009 Simon Marlow <marlowsd@gmail.com>
UNDO: Add -r option to darcs-all, and remove push-all (#3375)
Contributed by: seliopou@gmail.com
This patch modifies darcs-all to have feature parity with push-all by
recognizing two new options.
* -i, equivalent to --ignore-failure in push-all
* -r <repo>, specifies the remote repository darcs commands will use
Some example commands:
Get the libraries from a repository of your choosing. This is useful
when working with a git mirror:
$ ./darcs-all -r http://darcs.haskell.org get
Pull changes. Used to be:
$ ./push-all --pull http://darcs.haskell.org
Is now:
$ ./darcs-all -r http://darcs.haskell.org pull
Or to use the default remote of the ghc repository:
$ ./darcs-all pull
M ./darcs-all -79 +33
A ./push-all
Diffstat (limited to 'push-all')
-rw-r--r-- | push-all | 129 |
1 files changed, 0 insertions, 129 deletions
diff --git a/push-all b/push-all deleted file mode 100644 index ef4dbc8d53..0000000000 --- a/push-all +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/perl -w - -use strict; - -my $reporoot; - -my $verbose = 1; -my $ignore_failure = 0; - -# --checked-out says we are pushing to a checked out tree -my $checked_out = 0; -# --push or --pull or --send? -my $push_pull_send = "push"; - -sub message { - if ($verbose) { - print "@_\n"; - } -} - -sub warning { - print "warning: @_\n"; -} - -sub darcs { - message "== running darcs @_"; - system ("darcs", @_) == 0 - or $ignore_failure - or die "darcs failed: $?"; -} - -sub darcs_push { - darcs ($push_pull_send, "--no-set-default", @_); -} - -sub pushall { - my $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"; - } - } - elsif (! /^(#.*)?$/) { - die "Bad line: $_"; - } - } -} - -sub main { - if (! -d "_darcs" || ! -d "compiler") { - die "error: darcs-all must be run from the top level of the ghc tree." - } - - if ($#_ ne -1) { - while ($#_ ne -1) { - my $arg = shift; - # We handle -q here as well as lower down as we need to skip - # over it if it comes before the darcs command - if ($arg eq "-q") { - $verbose = 0; - } - elsif ($arg eq "--ignore-failure") { - $ignore_failure = 1; - } - elsif ($arg eq "--checked-out") { - $checked_out = 1; - } - elsif ($arg eq "--push") { - $push_pull_send = "push"; - } - elsif ($arg eq "--pull") { - $push_pull_send = "pull"; - } - elsif ($arg eq "--send") { - $push_pull_send = "send"; - } - else { - $reporoot = $arg; - if (grep /^-q$/, @_) { - $verbose = 0; - } - last; - } - } - } - else { - die "Where do you want to push to?"; - } - - pushall (@_); -} - -main(@ARGV); - |