Changeset 128 in ProjectBuilder
- Timestamp:
- Sep 10, 2007, 12:16:45 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/bin/pb
r127 r128 422 422 my $basesrc = map { basename($_) } split(/ /,$src); 423 423 424 print $LOG " $cmt: $src\n" if ($debug >= 0);424 print $LOG "Sources handled ($cmt): $src\n" if ($debug >= 0); 425 425 my ($sshhost,$sshlogin,$sshdir,$sshport) = pb_conf_get($host,$login,$dir,$port); 426 426 my $mac = "$sshlogin->{$ENV{'PBPROJ'}}\@$sshhost->{$ENV{'PBPROJ'}}"; … … 429 429 $tdir = "$sshdir->{$ENV{'PBPROJ'}}/src"; 430 430 } elsif ($cmt eq "VMs") { 431 $tdir = "$sshdir->{$ENV{'PBPROJ'}}";431 $tdir = basename("$sshdir->{$ENV{'PBPROJ'}}"); 432 432 } elsif ($cmt eq "Packages") { 433 433 $tdir = "$sshdir->{$ENV{'PBPROJ'}}/$ddir/$dver"; … … 440 440 pb_system("ssh -q -p $port $mac \"echo \'cd $tdir ; if [ -f pbscript ]; then ./pbscript; rm -f ./pbscript; fi\' | bash\"","Executing pbscript on $mac if needed"); 441 441 if ($cmt eq "VMs") { 442 442 # Get back info on pkg produced, compute their name and get them from the VM 443 443 pb_system("scp -p -P $port $mac:$tdir/pbgen-$pbprojver$pbprojtag $ENV{'PBBUILDDIR'}","Get package names in $tdir on $mac"); 444 444 open(KEEP,"$ENV{'PBBUILDDIR'}/pbgen-$pbprojver$pbprojtag") || die "Unable to read $ENV{'PBBUILDDIR'}/pbgen-$pbprojver$pbprojtag"; … … 461 461 print SCRIPT "echo ... Execution needed\n"; 462 462 print SCRIPT "# Move the copied .pbrc to the home dir on the build account\n"; 463 print SCRIPT "mv .pbrc \$ ENV{'HOME'}\n";463 print SCRIPT "mv .pbrc \$HOME\n"; 464 464 print SCRIPT "# Setup the variables required for building\n"; 465 465 print SCRIPT "export PBPROJ=$ENV{'PBPROJ'}\n"; … … 468 468 my $p = ""; 469 469 $p = $ARGV[0] if (defined $ARGV[0]); 470 print SCRIPT "echo Building packages on $vm\n"; 470 471 print SCRIPT "pb build2pkg $p\n"; 472 print SCRIPT "echo End of build. Halting VM.\n"; 471 473 print SCRIPT "sudo halt -p\n"; 472 474 close(SCRIPT); … … 478 480 foreach my $v (@$vm) { 479 481 # Launch the VMs 480 my ($ptr ) = pb_conf_get("vmtype");482 my ($ptr,$vmopt,$vmport,$vmpath) = pb_conf_get("vmtype","vmopt","vmport","vmpath"); 481 483 my $vmtype = $ptr->{$ENV{'PBPROJ'}}; 482 my ($vmopt,$vmport,$vmpath) = pb_conf_read("$ENV{'PBETC'}","vmopt","vmport","vmpath"); 483 $vmopt->{$vmtype} = $vmopt->{'default'} if ((not defined $vmopt->{$vmtype}) and (defined $vmopt->{'default'})); 484 $vmport->{$vmtype} = $vmport->{'default'} if ((not defined $vmport->{$vmtype}) and (defined $vmport->{'default'})); 485 $vmpath->{$vmtype} = $vmpath->{'default'} if ((not defined $vmpath->{$vmtype}) and (defined $vmpath->{'default'})); 486 if (defined $vmopt->{$vmtype}) { 487 $ENV{'PBVMOPT'} = $vmopt->{$vmtype}; 484 if (defined $vmopt->{$ENV{'PBPROJ'}}) { 485 $ENV{'PBVMOPT'} = $vmopt->{$ENV{'PBPROJ'}}; 488 486 } else { 489 487 $ENV{'PBVMOPT'} = ""; … … 509 507 $qemucmd = "$qemucmd32"; 510 508 } 511 if (! -f "$vmpath->{$ vmtype}/$v.qemu") {512 print "Unable to find VM $vmpath->{$ vmtype}/$v.qemu";509 if (! -f "$vmpath->{$ENV{'PBPROJ'}}/$v.qemu") { 510 print "Unable to find VM $vmpath->{$ENV{'PBPROJ'}}/$v.qemu"; 513 511 next; 514 512 } 515 $cmd = "$qemucmd $ENV{'PBVMOPT'} -redir tcp:$vmport->{$ vmtype}:10.0.2.15:22 $vmpath->{$vmtype}/$v.qemu"513 $cmd = "$qemucmd $ENV{'PBVMOPT'} -redir tcp:$vmport->{$ENV{'PBPROJ'}}:10.0.2.15:22 $vmpath->{$ENV{'PBPROJ'}}/$v.qemu" 516 514 } elsif ($vmtype eq "xen") { 517 515 } elsif ($vmtype eq "vmware") { … … 523 521 524 522 # Gather all required files to send them to the VM and launch the build thourgh pbscript 525 pb_send2ssh("VMs","$v","vmhost","vmlogin", dirname($pbrc->{$ENV{'PBPROJ'}}),"vmport");523 pb_send2ssh("VMs","$v","vmhost","vmlogin","pbrc","vmport"); 526 524 } 527 525 }
Note:
See TracChangeset
for help on using the changeset viewer.