Skip to content

Commit

Permalink
Start to convert build system to work with Parrot on git
Browse files Browse the repository at this point in the history
  • Loading branch information
leto committed Sep 7, 2010
1 parent 19a8b71 commit db25963
Showing 1 changed file with 11 additions and 19 deletions.
30 changes: 11 additions & 19 deletions build/gen_parrot.pl
Expand Up @@ -12,8 +12,8 @@ =head2 SYNOPSIS
=head2 DESCRIPTION =head2 DESCRIPTION
Maintains an appropriate copy of Parrot in the parrot/ subdirectory. Maintains an appropriate copy of Parrot in the parrot/ subdirectory.
The revision of Parrot to be used in the build is given by the The SHA1 of Parrot to be used in the build is given by the
build/PARROT_REVISION file. build/PARROT_SHA1 file.
=cut =cut


Expand All @@ -25,29 +25,21 @@ =head2 DESCRIPTION
my $slash = $^O eq 'MSWin32' ? '\\' : '/'; my $slash = $^O eq 'MSWin32' ? '\\' : '/';


## determine what revision of Parrot we require ## determine what revision of Parrot we require
open my $REQ, "build/PARROT_REVISION" open my $REQ, "build/PARROT_SHA1"
|| die "cannot open build/PARROT_REVISION\n"; || die "cannot open build/PARROT_SHA1\n";
my ($reqsvn, $reqpar) = split(' ', <$REQ>); my ($reqsha1) = <$REQ>;
$reqsvn += 0;
close $REQ; close $REQ;


{ # TODO: Check if we already have the neccessary Parrot
no warnings;
if (open my $REV, '-|', "parrot_install${slash}bin${slash}parrot_config revision") {
my $revision = 0+<$REV>;
close $REV;
if ($revision >= $reqsvn) {
print "Parrot r$revision already available (r$reqsvn required)\n";
exit(0);
}
}
}


print "Checking out Parrot r$reqsvn via svn...\n"; print "Cloning Parrot repo via git...\n";
system_or_die(qw(svn checkout -r), $reqsvn , qw(https://svn.parrot.org/parrot/trunk parrot)); system_or_die(qw(git clone), qw(git://github.com/parrot/parrot.git));


chdir('parrot') || die "Can't chdir to 'parrot': $!"; chdir('parrot') || die "Can't chdir to 'parrot': $!";


# This leaves the parrot repo in a HEADless state. Implications?
system_or_die(qw(git checkout $reqsha1));



## If we have a Makefile from a previous build, do a 'make realclean' ## If we have a Makefile from a previous build, do a 'make realclean'
if (-f 'Makefile') { if (-f 'Makefile') {
Expand Down

0 comments on commit db25963

Please sign in to comment.