Changeset 1712 in ProjectBuilder


Ignore:
Timestamp:
Mar 9, 2013, 10:22:28 PM (11 years ago)
Author:
Bruno Cornec
Message:
  • Adds target build2setup*
  • Improve date setup when ntp is failing (don't know yet why for some VMs)
  • pb now prints the name of the VM as a prefix for each command result, improving greatly debug in parallel mode
File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r1708 r1712  
    320320
    321321Setup a remote machine for pb usage using the sandbox version of pb instead of the latest stable
     322Reserved to dev team.
     323
     324=item B<build2setupvm>
     325
     326Setup a virtual machine for pb usage using the build available
     327Reserved to dev team.
     328
     329=item B<build2setupve>
     330
     331Setup a virtual environment for pb usage using the build available
     332Reserved to dev team.
     333
     334=item B<build2setuprm>
     335
     336Setup a remote machine for pb usage using the build available
    322337Reserved to dev team.
    323338
     
    896911    die "This feature is limited to the pb project" if ($ENV{'PBPROJ'} ne $appname);
    897912    pb_cms2build("SandBox");
     913    pb_setup2v("vm","SandBox");
     914} elsif ($action =~ /^build2setuprm$/) {
     915    die "This feature is limited to the pb project" if ($ENV{'PBPROJ'} ne $appname);
     916    pb_setup2v("rm","SandBox");
     917} elsif ($action =~ /^build2setupve$/) {
     918    die "This feature is limited to the pb project" if ($ENV{'PBPROJ'} ne $appname);
     919    pb_setup2v("ve","SandBox");
     920} elsif ($action =~ /^build2setupvm$/) {
     921    die "This feature is limited to the pb project" if ($ENV{'PBPROJ'} ne $appname);
    898922    pb_setup2v("vm","SandBox");
    899923} elsif ($action =~ /^updaterm$/) {
     
    24032427        $shcmd .= " \"echo \'cd $tdir ; if [ -x $pbscript ]; then ./$pbscript; fi ; rm -f ./$pbscript\' | bash\"";
    24042428    }
    2405     my $cmdverb = "verbose";
     2429    my $cmdverb = "verbose_\[$v\] ";
    24062430    if (($cmt eq "Announce") || ($cmt eq "CPAN")) {
    24072431        $cmdverb = undef;
     
    27202744my $vtype = shift;
    27212745my $pbos = shift;
     2746my $nontp = shift || 0;
    27222747
    27232748# VE gets time from parent OS.
     
    27392764my $upddate = strftime("%m%d%H%M%Y", @date);
    27402765my $dateline = "sudo /bin/date $upddate";
    2741 if (defined $ntpline) {
     2766if ((defined $ntpline) && ($nontp == 0)) {
    27422767    return($ntpline);
    27432768} else {
     
    28002825
    28012826    print SCRIPT "echo ... Execution needed\n";
     2827    print SCRIPT "echo '==== Start of script $$ for $vtype $v =====\n";
    28022828    print SCRIPT "# This is in directory delivery\n";
    28032829    print SCRIPT "# Setup the variables required for building\n";
     
    28232849    print SCRIPT "echo setting up date with $ntpline\n";
    28242850    print SCRIPT "$ntpline\n";
     2851    print SCRIPT 'if [ $? -ne 0 ]; then\n';
     2852    # Force if bad status a trick using date
     2853    $ntpline = pb_date2v($vtype,$pbos, 1);
     2854    print SCRIPT "  $ntpline\n";
     2855    print SCRIPT "fi\n";
    28252856    # Use potential local proxy declaration in case we need it to download repo, pkgs, ...
    28262857    if (defined $ENV{'http_proxy'}) {
     
    28742905    }
    28752906
    2876     print SCRIPT q{echo "********** Successful exit of script $$ for $v *********************"}, "\n";
     2907    print SCRIPT "echo '==== End of script $$ for $vtype $v =====\n";
    28772908    close(SCRIPT);
    28782909    chmod 0755,"$ENV{'PBDESTDIR'}/pbscript.$$";
Note: See TracChangeset for help on using the changeset viewer.