Skip to content
This repository
Browse code

[configure] automatically configure push urls

when cloning NQP or Parrot, automatically add an ssh-based pushurl,
to make contributions easier for those with commit bits
  • Loading branch information...
commit 0dde8f3dd0ed3665023f2715cee9e7666fe33a30 1 parent edd14da
Moritz Lenz moritz authored

Showing 1 changed file with 10 additions and 4 deletions. Show diff stats Hide diff stats

  1. +10 4 tools/lib/NQP/Configure.pm
14 tools/lib/NQP/Configure.pm
@@ -30,6 +30,9 @@ our @required_nqp_files = qw(
30 30 our $nqp_git = 'git://github.com/perl6/nqp.git';
31 31 our $par_git = 'git://github.com/parrot/parrot.git';
32 32
  33 +our $nqp_push = 'git@github.com:perl6/nqp.git';
  34 +our $par_push = 'git@github.com:parrot/parrot.git';
  35 +
33 36 sub sorry {
34 37 my @msg = @_;
35 38 die join("\n", '', '===SORRY!===', @msg, "\n");
@@ -188,12 +191,15 @@ sub git_checkout {
188 191 my $repo = shift;
189 192 my $dir = shift;
190 193 my $checkout = shift;
  194 + my $pushurl = shift;
191 195 my $pwd = cwd();
192 196
193 197 # get an up-to-date repository
194 198 if (! -d $dir) {
195 199 system_or_die('git', 'clone', $repo, $dir);
196 200 chdir($dir);
  201 + system('git', 'config', 'remote.origin.pushurl', $pushurl)
  202 + if defined $pushurl;
197 203 }
198 204 else {
199 205 chdir($dir);
@@ -262,11 +268,11 @@ sub gen_nqp {
262 268 my $nqp_have = $config{'nqp::version'} || '';
263 269 my $nqp_ok = $nqp_have && cmp_rev($nqp_have, $nqp_want) >= 0;
264 270 if ($gen_nqp) {
265   - my $nqp_repo = git_checkout($nqp_git, 'nqp', $gen_nqp);
  271 + my $nqp_repo = git_checkout($nqp_git, 'nqp', $gen_nqp, $nqp_push);
266 272 $nqp_ok = $nqp_have eq $nqp_repo;
267 273 }
268 274 elsif (!$nqp_ok || defined $gen_parrot && !-f $PARROT_REVISION) {
269   - git_checkout($nqp_git, 'nqp', $nqp_want);
  275 + git_checkout($nqp_git, 'nqp', $nqp_want, $nqp_push);
270 276 }
271 277
272 278 if (defined $gen_parrot) {
@@ -311,11 +317,11 @@ sub gen_parrot {
311 317 my $par_have = $config{'parrot::git_describe'} || '';
312 318 my $par_ok = $par_have && cmp_rev($par_have, $par_want) >= 0;
313 319 if ($gen_parrot) {
314   - my $par_repo = git_checkout($par_git, 'parrot', $gen_parrot);
  320 + my $par_repo = git_checkout($par_git, 'parrot', $gen_parrot, $par_push);
315 321 $par_ok = $par_have eq $par_repo;
316 322 }
317 323 elsif (!$par_ok) {
318   - git_checkout($par_git, 'parrot', $par_want);
  324 + git_checkout($par_git, 'parrot', $par_want, $par_push);
319 325 }
320 326
321 327 if ($par_ok) {

0 comments on commit 0dde8f3

Please sign in to comment.
Something went wrong with that request. Please try again.