Permalink
Browse files

Allow Parrot VERSION to be used in cases when the svn revision

information isn't available (e.g., Parrot built from tarball
or non-svn checkout).
  • Loading branch information...
1 parent 6765def commit 5948c11826b66b8b31e2d0b8027b1c33c74f8100 @pmichaud pmichaud committed Jun 18, 2009
Showing with 17 additions and 10 deletions.
  1. +10 −4 Configure.pl
  2. +1 −1 build/PARROT_REVISION
  3. +6 −5 build/gen_parrot.pl
View
@@ -20,7 +20,8 @@
# Determine the revision of Parrot we require
open my $REQ, "build/PARROT_REVISION"
|| die "cannot open build/PARROT_REVISION\n";
- my $required = 0+<$REQ>;
+ my ($reqsvn, $reqpar) = split(' ', <$REQ>);
+ $reqsvn += 0;
close $REQ;
# Update/generate parrot build if needed
@@ -51,14 +52,15 @@
if (!%config) {
$parrot_errors .= "Unable to locate parrot_config\n";
}
- elsif ($required > $config{'revision'}) {
- $parrot_errors .= "Parrot revision r$required required (currently r$config{'revision'})\n";
+ elsif ($reqsvn > $config{'revision'} &&
+ ($reqpar eq '' || version_int($reqpar) > version_int($config{'VERSION'}))) {
+ $parrot_errors .= "Parrot revision r$reqsvn required (currently r$config{'revision'})\n";
}
if ($parrot_errors) {
die <<"END";
$parrot_errors
-To automatically checkout (svn) and build a copy of parrot r$required,
+To automatically checkout (svn) and build a copy of parrot r$reqsvn,
try re-running Configure.pl with the '--gen-parrot' option.
Or, use the '--parrot-config' option to explicitly specify
the location of parrot_config to be used to build Rakudo Perl.
@@ -144,6 +146,10 @@ sub slurp {
return $maketext;
}
+sub version_int {
+ sprintf('%d%03d%03d', split(/\./, $_[0]))
+}
+
# Print some help text.
sub print_help {
View
@@ -1 +1 @@
-39599
+39599 1.3.0
View
@@ -27,23 +27,24 @@ =head2 DESCRIPTION
## determine what revision of Parrot we require
open my $REQ, "build/PARROT_REVISION"
|| die "cannot open build/PARROT_REVISION\n";
-my $required = 0+<$REQ>;
+my ($reqsvn, $reqpar) = split(' ', <$REQ>);
+$reqsvn += 0;
close $REQ;
{
no warnings;
if (open my $REV, '-|', "parrot${slash}parrot_config revision") {
my $revision = 0+<$REV>;
close $REV;
- if ($revision >= $required) {
- print "Parrot r$revision already available (r$required required)\n";
+ if ($revision >= $reqsvn) {
+ print "Parrot r$revision already available (r$reqsvn required)\n";
exit(0);
}
}
}
-print "Checking out Parrot r$required via svn...\n";
-system(qw(svn checkout -r), $required , qw(https://svn.parrot.org/parrot/trunk parrot));
+print "Checking out Parrot r$reqsvn via svn...\n";
+system(qw(svn checkout -r), $reqsvn , qw(https://svn.parrot.org/parrot/trunk parrot));
chdir('parrot');

0 comments on commit 5948c11

Please sign in to comment.