From b9187e6ca4a85674a12dabfee448909a4b41a29d Mon Sep 17 00:00:00 2001 From: pmichaud Date: Tue, 28 Aug 2012 03:37:40 -0500 Subject: Add --force option to Configure.pl to force configuration even if in a .git repository. --- Configure.pl | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'Configure.pl') diff --git a/Configure.pl b/Configure.pl index 2814888..a7db473 100644 --- a/Configure.pl +++ b/Configure.pl @@ -16,14 +16,6 @@ my $lang = 'Rakudo'; my $lclang = lc $lang; my $uclang = uc $lang; -if (-d '.git') { - sorry("I see a .git directory here -- you appear to be trying", - "to run Configure.pl from a clone of the Rakudo Star git", - "repository.", - "", - download_text()); -} - MAIN: { if (-r "config.default") { unshift @ARGV, shellwords(slurp('config.default')); @@ -40,6 +32,7 @@ MAIN: { 'with-nqp=s', 'gen-nqp:s', 'with-parrot=s', 'gen-parrot:s', 'parrot-option=s@', 'make-install!', 'makefile-timing!', + 'force!' ); # Print help if it's requested @@ -48,6 +41,16 @@ MAIN: { exit(0); } + if (-d '.git') { + worry( $options{'force'}, + "I see a .git directory here -- you appear to be trying", + "to run Configure.pl from a clone of the Rakudo Star git", + "repository.", + $options{'force'} + ? '--force specified, continuing' + : download_text() + ); + } my $prefix = $options{'prefix'} || cwd().'/install'; my $with_parrot = $options{'with-parrot'}; @@ -190,6 +193,12 @@ sub download_text { "download a .tar.gz file from https://github.com/rakudo/star/downloads .") } +sub worry { + my ($force, @text) = @_; + sorry(@text) unless $force; + print join "\n", @text, ''; +} + # Local Variables: # mode: cperl # cperl-indent-level: 4 -- cgit v1.1