Changeset 200 in ProjectBuilder for devel/pb/bin/pb
- Timestamp:
- Oct 13, 2007, 2:26:55 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/bin/pb
r199 r200 338 338 339 339 my $src="$ENV{'PBDESTDIR'}/$pbpkg-$pbver.tar.gz"; 340 # Suse < 10.2forces tar.bz2 usage :-(341 if ( $ddir eq "suse") {342 print "SuSE needs bz2 type of packages so recompressing...\n";340 # Suse 10.0 forces tar.bz2 usage :-( 341 if (($ddir eq "suse") && ($dver eq "10.0")) { 342 print "SuSE 10.0 needs bz2 type of packages so recompressing...\n"; 343 343 my $newsrc="$ENV{'PBDESTDIR'}/$pbpkg-$pbver.tar.bz2"; 344 344 system "gzip -cd $src | bzip2 -c6 > $newsrc"; … … 450 450 my $vm = shift || undef; 451 451 my $vmexist = shift || 0; # 0 is FALSE 452 my $vmpid = shift || 0; # 0 is FALSE 452 453 my $host = shift || "sshhost"; 453 454 my $login = shift || "sshlogin"; 454 455 my $dir = shift || "sshdir"; 455 456 my $port = shift || "sshport"; 457 my $tmout = shift || "120"; 456 458 my $cmd = ""; 457 459 … … 537 539 538 540 $port = $sshport->{$ENV{'PBPROJ'}}; 541 my $tm = $tmout->{$ENV{'PBPROJ'}}; 539 542 pb_system("ssh -q -p $port $mac \"mkdir -p $tdir ; cd $tdir ; echo \'for i in $basesrc; do if [ -f \$i ]; then rm -f \$i; fi; done\ ; $cmd' | bash\"","Preparing $tdir on $mac"); 540 543 pb_system("cd $ENV{'PBBUILDDIR'} ; scp -p -P $port $src $mac:$tdir 2> /dev/null","$cmt delivery in $tdir on $mac"); … … 542 545 if ($cmt eq "VMs") { 543 546 # Get back info on pkg produced, compute their name and get them from the VM 544 pb_system("scp -p -P $port $mac:$bdir/pbgen-$pbprojver-$pbprojtag $ENV{'PBBUILDDIR'} 2> /dev/null","Get package names in $ tdir on $mac");547 pb_system("scp -p -P $port $mac:$bdir/pbgen-$pbprojver-$pbprojtag $ENV{'PBBUILDDIR'} 2> /dev/null","Get package names in $bdir on $mac"); 545 548 open(KEEP,"$ENV{'PBBUILDDIR'}/pbgen-$pbprojver-$pbprojtag") || die "Unable to read $ENV{'PBBUILDDIR'}/pbgen-$pbprojver-$pbprojtag"; 546 549 my $src = <KEEP>; … … 554 557 foreach my $p (split(/ +/,$src)) { 555 558 my $j = basename($p); 556 pb_system("scp -p -P $port $mac:\'$bdir/$p\' $ENV{'PBBUILDDIR'}/$odir/$over 2> /dev/null","Package recovery of $j in $ tdir from $mac");559 pb_system("scp -p -P $port $mac:\'$bdir/$p\' $ENV{'PBBUILDDIR'}/$odir/$over 2> /dev/null","Package recovery of $j in $bdir from $mac"); 557 560 $made="$made $odir/$over/$j" if (($dtype ne "rpm") || ($j !~ /.src.rpm$/)); 558 561 } … … 561 564 pb_system("ssh -q -p $port $mac \"rm -rf $tdir $bdir\"","VM cleanup on $mac"); 562 565 if (! $vmexist) { 563 pb_system("ssh -q -p $port $mac \"sudo /usr/bin/poweroff \"; sleep 120 ; echo \'if [ -d /proc/$vmexist ]; then kill -9 $vmexist; fi \' | bash ; sleep 10","VM $vm halt (pid $vmexist)");566 pb_system("ssh -q -p $port $mac \"sudo /usr/bin/poweroff \"; sleep $tm ; echo \'if [ -d /proc/$vmpid ]; then kill -9 $vmpid; fi \' | bash ; sleep 10","VM $vm halt (pid $vmpid)"); 564 567 } 565 568 pb_send2ssh("Packages","$odir"."_"."$over"); … … 582 585 foreach my $v (@$vm) { 583 586 # Launch the VM 584 my $vmexist = pb_launchvm($v); 585 if (! $vmexist) { 586 pb_system("sleep 300","Waiting for $v to come up"); 587 } else { 588 print "Using VM pid $vmexist\n"; 589 } 587 my ($vmexist,$vmpid) = pb_launchvm($v); 590 588 591 589 # Gather all required files to send them to the VM 592 590 # and launch the build thourgh pbscript 593 pb_send2ssh("Script","$v",$vmexist, "vmhost","vmlogin","pbrc","vmport");591 pb_send2ssh("Script","$v",$vmexist,$vmpid,"vmhost","vmlogin","pbrc","vmport","vmtmout"); 594 592 595 593 } … … 604 602 605 603 # Launch the VMs 606 my ($ptr,$vmopt,$vmport,$vmpath ) = pb_conf_get("vmtype","vmopt","vmport","vmpath");604 my ($ptr,$vmopt,$vmport,$vmpath,$vmtmout) = pb_conf_get("vmtype","vmopt","vmport","vmpath","vmtmout"); 607 605 my $vmtype = $ptr->{$ENV{'PBPROJ'}}; 608 606 if (defined $vmopt->{$ENV{'PBPROJ'}}) { … … 646 644 my ($tmpcmd,$void) = split(/ +/,$cmd); 647 645 my $vmexist = pb_check_ps($tmpcmd,$vmm); 646 my $vmpid = 0; 648 647 if (! $vmexist) { 649 648 pb_system("$cmd &","Launching the VM $vmm"); 650 } 651 return($vmexist); 649 pb_system("sleep $vmtmout->{$ENV{'PBPROJ'}}","Waiting for VM $vm to come up"); 650 $vmpid = pb_check_ps($tmpcmd,$vmm); 651 } else { 652 print "Found an existing VM $vmm (pid $vmexist)\n"; 653 } 654 return($vmexist,$vmpid); 652 655 } 653 656 … … 682 685 foreach my $v (@$vm) { 683 686 # Launch the VM 684 my $vmexist = pb_launchvm($v); 685 if (! $vmexist) { 686 pb_system("sleep 300","Waiting for $v to come up"); 687 } else { 688 print "Using VM pid $vmexist\n"; 689 } 687 my ($vmexist,$vmpid) = pb_launchvm($v); 690 688 691 689 # Gather all required files to send them to the VM 692 690 # and launch the build thourgh pbscript 693 pb_send2ssh("VMs","$v",$vmexist, "vmhost","vmlogin","pbrc","vmport");691 pb_send2ssh("VMs","$v",$vmexist,$vmpid,"vmhost","vmlogin","pbrc","vmport","vmtmout"); 694 692 } 695 693 }
Note:
See TracChangeset
for help on using the changeset viewer.