[Bps-public-commit] r13714 - in Shipwright/trunk: .
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Tue Jul 1 11:16:25 EDT 2008
Author: sunnavy
Date: Tue Jul 1 11:16:23 2008
New Revision: 13714
Modified:
Shipwright/trunk/ (props changed)
Shipwright/trunk/lib/Shipwright/Build.pm
Log:
r13985 at sunnavys-mb: sunnavy | 2008-07-01 23:16:01 +0800
updated Build.pm to record installed dists too
Modified: Shipwright/trunk/lib/Shipwright/Build.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Build.pm (original)
+++ Shipwright/trunk/lib/Shipwright/Build.pm Tue Jul 1 11:16:23 2008
@@ -23,6 +23,9 @@
=cut
+# keeps the info of the already installed dists
+my ( $installed, $installed_file );
+
sub new {
my $class = shift;
my $self = {@_};
@@ -97,6 +100,17 @@
else {
dircopy( 'etc', File::Spec->catfile( $self->install_base, 'etc' ) );
+ my $installed_hash = {};
+ $installed_file =
+ File::Spec->catfile( $self->install_base, 'installed.yml' );
+ if ( -e $installed_file ) {
+ $installed = Shipwright::Util::LoadFile( $installed_file );
+ $installed_hash = { map { $_ => 1 } @$installed };
+ }
+ else {
+ $installed = [];
+ }
+
my $order =
Shipwright::Util::LoadFile(
File::Spec->catfile( 'shipwright', 'order.yml' ) )
@@ -141,6 +155,9 @@
} @$order;
}
+ # remove the already installed ones
+ @$order = grep { !$installed_hash->{$_} } @$order;
+
unless ( $self->perl && -e $self->perl ) {
my $perl =
File::Spec->catfile( $self->install_base, 'bin', 'perl' );
@@ -156,6 +173,7 @@
for my $dist (@$order) {
$self->_install( $dist, $ktf );
+ $self->_record( $dist );
chdir $self->build_base;
}
@@ -229,7 +247,7 @@
next;
}
## no critic
- elsif ( eval "$ktf->{$dir}" ) {
+ elsif ( eval "$ktf->{$dir}" ) {
$self->log->error(
"although tests failed, will install anyway since it's a known failure\n"
);
@@ -369,6 +387,18 @@
}
}
+
+# record the installed dist, so we don't need to installed it later
+# if at the same install_base
+
+sub _record {
+ my $self = shift;
+ my $dist = shift;
+
+ push @$installed, $dist;
+ Shipwright::Util::DumpFile( $installed_file, $installed );
+}
+
1;
__END__
More information about the Bps-public-commit
mailing list