add sub
This commit is contained in:
parent
24e3c9cfc4
commit
ace0efceee
1 changed files with 25 additions and 1 deletions
26
nbuild
26
nbuild
|
@ -17,6 +17,7 @@ use NBuild::Func;
|
||||||
use File::Path qw(rmtree mkpath);
|
use File::Path qw(rmtree mkpath);
|
||||||
use Sys::Hostname;
|
use Sys::Hostname;
|
||||||
use Log::Log4perl;
|
use Log::Log4perl;
|
||||||
|
use File::Path;
|
||||||
|
|
||||||
=todo
|
=todo
|
||||||
# some VMs do not allow to specify the init process...
|
# some VMs do not allow to specify the init process...
|
||||||
|
@ -107,6 +108,29 @@ EOT
|
||||||
sub cleanup_and_exit {
|
sub cleanup_and_exit {
|
||||||
my ($var, $msg)=@_;
|
my ($var, $msg)=@_;
|
||||||
$var=0 unless defined $var;
|
$var=0 unless defined $var;
|
||||||
if(defined )
|
if(defined $msg){
|
||||||
|
if($var!=0){
|
||||||
|
print STDERR $msg;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
say $msg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rmtree $BUILD_DIST_TMP unless undef $BUILD_DIST_TMP;
|
||||||
|
if(undef $BUILD_OPTIONS_PARSED){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
rmtree $BUILD_ROOT . '/exit';
|
||||||
|
if(defined $RUN_SHELL_AFTER_FAIL && $BUILD_SUCCEEDED==0 && $var==1){
|
||||||
|
undef $BUILD_SUCCEEDED;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub fail_exit {
|
||||||
|
cleanup_and_exit(1,'');
|
||||||
|
}
|
||||||
|
|
||||||
|
sub run_shell {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue