my ($repo_base, $checked_out_tree) = getrepo();
+ my $is_github_repo = $repo_base =~ m/(git@|git:\/\/|https:\/\/)github.com/;
+
parsePackages;
@args = ();
}
push(@args, @_);
- print "args: @args\n";
for $line (@packages) {
$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"));
}
# 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)$/) {
# Skip any repositories we have not included the tag for
if (not defined($tags{$tag})) {
+ $tags{$tag} = 0;
+ }
+ if ($tags{$tag} == 0) {
next;
}
@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 =~ /^reset$/) {
+ @scm_args = "reset";
+ }
+ elsif ($command =~ /^config$/) {
+ @scm_args = "config";
+ }
else {
die "Unknown command: $command";
}
Supported commands:
* whatsnew
+ * commit
* push
* pull
* get, with options:
* remote add <branch-name>
* remote rm <branch-name>
* remote set-url [--push] <branch-name>
+ * grep
+ * reset
+ * config
Available package-tags are:
END
}
# --<tag> says we grab the libs tagged 'tag' with
# 'get'. It has no effect on the other commands.
- elsif ($arg =~ m/^--/) {
- $arg =~ s/^--//;
- $tags{$arg} = 1;
+ elsif ($arg =~ m/^--no-(.*)$/) {
+ $tags{$1} = 0;
+ }
+ elsif ($arg =~ m/^--(.*)$/) {
+ $tags{$1} = 1;
}
else {
unshift @_, $arg;