[Bps-public-commit] r13607 - in Shipwright/trunk: . share/bin
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Wed Jun 25 20:18:12 EDT 2008
Author: sunnavy
Date: Wed Jun 25 20:18:12 2008
New Revision: 13607
Modified:
Shipwright/trunk/ (props changed)
Shipwright/trunk/lib/Shipwright/Build.pm
Shipwright/trunk/share/bin/shipwright-builder
Log:
r13813 at sunnavys-mb: sunnavy | 2008-06-26 07:53:30 +0800
ktf support in build
Modified: Shipwright/trunk/lib/Shipwright/Build.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Build.pm (original)
+++ Shipwright/trunk/lib/Shipwright/Build.pm Wed Jun 25 20:18:12 2008
@@ -120,6 +120,11 @@
}
}
+ my $ktf =
+ Shipwright::Util::LoadFile(
+ File::Spec->catfile( 'shipwright', 'ktf.yml' ) )
+ || {};
+
# calculate the real order
if ( $self->only ) {
@$order = grep { $self->only->{$_} } @$order;
@@ -127,9 +132,11 @@
else {
@$order =
grep {
- ( $flags->{$_}
+ (
+ $flags->{$_}
? ( grep { $self->flags->{$_} } @{ $flags->{$_} } )
- : 1 )
+ : 1
+ )
&& !$self->skip->{$_}
} @$order;
}
@@ -147,8 +154,8 @@
}
}
- for my $dist ( @$order ) {
- $self->_install($dist);
+ for my $dist (@$order) {
+ $self->_install( $dist, $ktf );
chdir $self->build_base;
}
@@ -165,6 +172,7 @@
sub _install {
my $self = shift;
my $dir = shift;
+ my $ktf = shift;
chdir File::Spec->catfile( 'dists', $dir );
@@ -203,7 +211,7 @@
$cmd = $_;
}
- next if $type eq 'clean'; # don't need to clean when install
+ next if $type eq 'clean'; # don't need to clean when install
if ( $self->skip_test && $type eq 'test' ) {
$self->log->info("skip build $type part in $dir");
next;
@@ -213,17 +221,23 @@
if ( system($cmd) ) {
$self->log->error("build $dir with failure when run $type: $!");
- if ( $self->force && $type eq 'test' ) {
- $self->log->error(
+ if ( $type eq 'test' ) {
+ if ( $self->force ) {
+ $self->log->error(
"although tests failed, will install anyway since we have force arg\n"
- );
- }
- else {
- die "install failed";
+ );
+ next;
+ }
+ elsif ( eval "$ktf->{$dir}" ) {
+ $self->log->error(
+"although tests failed, will install anyway since it's a known failure\n"
+ );
+ next;
+ }
}
+ die "install failed";
}
}
-
}
$self->log->info("build $dir with success!");
}
Modified: Shipwright/trunk/share/bin/shipwright-builder
==============================================================================
--- Shipwright/trunk/share/bin/shipwright-builder (original)
+++ Shipwright/trunk/share/bin/shipwright-builder Wed Jun 25 20:18:12 2008
@@ -89,7 +89,6 @@
map { $_ => 1 } split /\s*,\s*/, $args{flags} || ''
};
-
$args{with} = { map { split /=/ } split /\s*,\s*/, $args{with} || '' };
if ( $args{only} ) {
@@ -105,6 +104,8 @@
( YAML::Tiny->read( File::Spec->catfile( 'shipwright', 'order.yml' ) ) )->[0];
my $flags =
( YAML::Tiny->read( File::Spec->catfile( 'shipwright', 'flags.yml' ) ) )->[0];
+my $ktf =
+ ( YAML::Tiny->read( File::Spec->catfile( 'shipwright', 'ktf.yml' ) ) )->[0];
# fill not specified but mandatary flags
if ( $flags->{__mandatary} ) {
@@ -127,7 +128,6 @@
} @$order;
}
-
my $log;
if ( $args{'only-test'} ) {
@@ -328,13 +328,19 @@
print "running shipwright build command: $cmd\n";
if ( system($cmd) ) {
print $log "build $dir $type part with failure.\n";
- if ( $args{force} && $type eq 'test' ) {
- print $log
+ if ( $type eq 'test' ) {
+ if ( $args{force} ) {
+ print $log
"although tests failed, will install anyway since we have force arg\n";
+ next;
+ }
+ elsif ( eval "$ktf->{$dir}" ) {
+ print $log
+"although tests failed, will install anyway since it's a known failure\n";
+ next;
+ }
}
- else {
- die "build $dir $type part with failure.\n";
- }
+ die "build $dir $type part with failure.\n";
}
else {
print $log "build $dir $type part with success!\n";
More information about the Bps-public-commit
mailing list