The attached diff offers a possible way to deal with folks who are behind
firewalls and must use the http or https URLs to clone parrot from.

Testing done: provided alternate URL in an environment with no access to the
git port, and download/build worked fine.
diff --git a/Configure.pl b/Configure.pl
index 4b8932b..f7f580c 100644
--- a/Configure.pl
+++ b/Configure.pl
@@ -12,7 +12,8 @@ use Rakudo::CompareRevisions qw(compare_parrot_revs);
 MAIN: {
     my %options;
     GetOptions(\%options, 'help!', 'parrot-config=s', 'makefile-timing!',
-               'gen-parrot!', 'gen-parrot-prefix=s', 'gen-parrot-option=s@');
+               'gen-parrot!', 'gen-parrot-prefix=s', 'gen-parrot-option=s@',
+	       'parrot-git-url=s');
 
     # Print help if it's requested
     if ($options{'help'}) {
@@ -32,7 +33,10 @@ MAIN: {
         my $prefix  = $options{'gen-parrot-prefix'} || cwd()."/parrot_install";
         # parrot's Configure.pl mishandles win32 backslashes in --prefix
         $prefix =~ s{\\}{/}g;
-        my @command = ($^X, "build/gen_parrot.pl", "--prefix=$prefix", ($^O !~ /win32/i ? "--optimize" : ()), @opts);
+	my $giturl = $options{'parrot-git-url'};
+        my @command = ($^X, "build/gen_parrot.pl", "--prefix=$prefix",
+		       ($giturl ? "--parrot-git-url=$giturl" : ()),
+		       ($^O !~ /win32/i ? "--optimize" : ()), @opts);
 
         print "Generating Parrot ...\n";
         print "@command\n\n";
@@ -217,6 +221,9 @@ General Options:
     --gen-parrot       Download and build a copy of Parrot to use
     --gen-parrot-option='--option=value'
                        Set parrot config option when using --gen-parrot
+    --parrot-git-url=URL
+                       Use URL instead of the default git repository.
+                       Note a checked out git tree will always be used as-is.
     --parrot-config=/path/to/parrot_config
                        Use config information from parrot_config executable
 Experimental developer's options:
diff --git a/build/gen_parrot.pl b/build/gen_parrot.pl
index d2344c4..9f8a6b5 100644
--- a/build/gen_parrot.pl
+++ b/build/gen_parrot.pl
@@ -27,6 +27,30 @@ use Rakudo::CompareRevisions qw(compare_parrot_revs);
 #  Work out slash character to use.
 my $slash = $^O eq 'MSWin32' ? '\\' : '/';
 
+# Default place to clone parrot from
+my $giturl = 'git://github.com/parrot/parrot.git';
+
+# Pull out --partot-git-url and leave all other args alone
+# can Getopt::Long be forced into doing this without pulling
+# apart and re-building the arglist?
+my $gitarg = '--parrot-git-url';
+for(my $i = 0; $i < @ARGV; $i++) {
+    my $arg = $ARGV[$i];
+    if ($arg =~ /^\Q$gitarg\E(?:\=(.*))/i) {
+	if (defined $1) {
+	    $giturl = $1;
+	    splice(@ARGV, $i, 1);
+	} else {
+	    if (@ARGV == $i+1) {
+		die "$0: Option list: $gitarg requires an argument.\n";
+	    }
+	    $giturl = $ARGV[$i+1];
+	    splice(@ARGV, $i, 2);
+	}
+	$i--;
+    }
+}
+
 ##  determine what revision of Parrot we require
 open my $REQ, "build/PARROT_REVISION"
   || die "cannot open build/PARROT_REVISION\n";
@@ -60,7 +84,7 @@ if (-d 'parrot') {
            ."this error message\n";
     }
 } else {
-    system_or_die(qw(git clone git://github.com/parrot/parrot.git parrot));
+    system_or_die('git', 'clone', $giturl, 'parrot');
     $fetched = 1;
 }
 

Reply via email to