aboutsummaryrefslogtreecommitdiff
path: root/Configure.pl
diff options
context:
space:
mode:
authorpmichaud <pmichaud@pobox.com>2012-08-28 03:37:40 -0500
committerpmichaud <pmichaud@pobox.com>2012-08-28 03:37:40 -0500
commitb9187e6ca4a85674a12dabfee448909a4b41a29d (patch)
treedcfa3c3fd007e62b5441afc211075f988e05cd5b /Configure.pl
parentbba776e246901384bbd11c57552781809e5cab01 (diff)
Add --force option to Configure.pl to force configuration even
if in a .git repository.
Diffstat (limited to 'Configure.pl')
-rw-r--r--Configure.pl25
1 files changed, 17 insertions, 8 deletions
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