- Timestamp:
- Oct 12, 2007, 2:02:02 AM (16 years ago)
- Location:
- devel/pb
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/bin/pb
r194 r199 43 43 my $pbaccount; # Login to use to connect to the VM 44 44 my $pbport; # Port to use to connect to the VM 45 my $newver; # New version to create 45 46 my $LOG = \*STDOUT; 46 47 47 getopts('a:hl:m:P:p:qr:s:tv ',\%opts);48 getopts('a:hl:m:P:p:qr:s:tvV:',\%opts); 48 49 49 50 my ($projectbuilderver,$projectbuilderrev) = pb_version_init(); … … 86 87 if (defined $opts{'P'}) { 87 88 $pbport = $opts{'P'}; 89 } 90 if (defined $opts{'V'}) { 91 $newver = $opts{'V'}; 88 92 } 89 93 … … 132 136 } elsif ($action =~ /^script2vm$/) { 133 137 pb_script2vm($pbscript); 138 } elsif ($action =~ /^newver$/) { 139 pb_newver(); 134 140 } elsif ($action =~ /^clean$/) { 135 141 } else { … … 374 380 chdir "$pbpkg-$pbver" || die "Unable to chdir to $pbpkg-$pbver"; 375 381 symlink "pbconf/$ddir-$dver","debian" || die "Unable to symlink to pbconf/$ddir-$dver"; 382 chmod 0755,"debian/rules"; 376 383 pb_system("dpkg-buildpackage -us -uc -rfakeroot","Building package"); 377 384 $made="$made $pbpkg"."_*.deb $pbpkg"."_*.dsc $pbpkg"."_*.tar.gz"; … … 552 559 print KEEP "$made\n"; 553 560 close(KEEP); 554 pb_system("ssh -q -p $port $mac \"rm -rf $tdir \"","VM cleanup on $mac");561 pb_system("ssh -q -p $port $mac \"rm -rf $tdir $bdir\"","VM cleanup on $mac"); 555 562 if (! $vmexist) { 556 pb_system("ssh -q -p $port $mac \"sudo /usr/bin/poweroff \"; sleep 120 ; echo \'if [ -d /proc/$vmexist ]; then kill $vmexist; fi \' | bash ; sleep 10","VM halt on $mac");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)"); 557 564 } 558 565 pb_send2ssh("Packages","$odir"."_"."$over"); … … 577 584 my $vmexist = pb_launchvm($v); 578 585 if (! $vmexist) { 579 pb_system("sleep 300","Waiting for it to come up"); 586 pb_system("sleep 300","Waiting for $v to come up"); 587 } else { 588 print "Using VM pid $vmexist\n"; 580 589 } 581 590 … … 635 644 die "VM of type $vmtype not supported. Report to the dev team"; 636 645 } 637 my $vmexist = pb_check_ps($vmcmd,$vmm); 646 my ($tmpcmd,$void) = split(/ +/,$cmd); 647 my $vmexist = pb_check_ps($tmpcmd,$vmm); 638 648 if (! $vmexist) { 639 pb_system("$cmd &","Launching the VM ");649 pb_system("$cmd &","Launching the VM $vmm"); 640 650 } 641 651 return($vmexist); … … 674 684 my $vmexist = pb_launchvm($v); 675 685 if (! $vmexist) { 676 pb_system("sleep 300","Waiting for it to come up"); 686 pb_system("sleep 300","Waiting for $v to come up"); 687 } else { 688 print "Using VM pid $vmexist\n"; 677 689 } 678 690 … … 681 693 pb_send2ssh("VMs","$v",$vmexist,"vmhost","vmlogin","pbrc","vmport"); 682 694 } 695 } 696 697 sub pb_newver { 698 699 my $cms=pb_cms_init($ENV{'PBPROJ'}); 700 if ($cms->{$ENV{'PBPROJ'}} ne "svn") { 701 die "Only SVN is supported at the moment"; 702 } 703 my $res = pb_cms_isdiff($cms); 704 die "You need to have no differences before creating a new version" if ($res != 0); 705 my $cmsurl = pb_cms_getinfo($cms); 706 my $newurl = dirname($cmsurl).$newver; 707 pb_cms_copy($cmsurl,$newurl); 708 pb_cms_checkout($newurl); 683 709 } 684 710 … … 789 815 print " to connect on the related VMs.\n"; 790 816 print "\n"; 817 print "-P port : Number of the port to use\n"; 818 print " to connect on the related VMs.\n"; 819 print "\n"; 791 820 print "-p project : Name of the project you're working on\n"; 792 821 print " (or use the env variable PBPROJ) \n"; … … 794 823 print "-r pbroot : Path Name of project under the CMS \n"; 795 824 print " (or use the env variable PBROOT) \n"; 825 print "\n"; 826 print "-V newver : New version of the project to create\n"; 827 print " from the current one. \n"; 796 828 print "\n"; 797 829 print "<action> can be:\n"; … … 821 853 print "\t and executes a script on it \n"; 822 854 print "\n"; 823 } 855 print "\tnewver: Create a new version of the project derived \n"; 856 print "\t from the current one \n"; 857 print "\n"; 858 } -
devel/pb/contrib/pbsetupqemu
r191 r199 92 92 chomp($topbuilddir); 93 93 94 my $p = `rpm -q afio`;95 chomp($p);96 if ($p !~ /^afio/) {97 system "rm -f afio-* ; wget ftp://ftp.mondorescue.org/src/afio-2.4.7-1.src.rpm ; rpm -ivh afio-2.4.7-1.src.rpm ; rpmbuild -ba $topbuilddir/SPECS/afio.spec ; chmod 644 $topbuilddir/RPMS/*/*.rpm";98 }99 $p = `rpm -q buffer`;100 chomp($p);101 if ($p !~ /^buffer/) {102 system "rm -f buffer-* ; wget ftp://ftp.mondorescue.org/src/buffer-1.19-1.src.rpm ; rpm -ivh buffer-1.19-1.src.rpm ; rpmbuild -ba $topbuilddir/SPECS/buffer.spec ; chmod 644 $topbuilddir/RPMS/*/*.rpm";103 }104 94 if ( $dver <= 4 ) { 105 95 # FC4 - AppConfig unavailable -
devel/pb/lib/ProjectBuilder/Base.pm
r174 r199 13 13 use AppConfig qw(ARGCOUNT_HASH); 14 14 use Data::Dumper; 15 16 use ProjectBuilder::Changelog qw (pb_changelog); 15 17 16 18 $ENV{'PBETC'} = "$ENV{'HOME'}/.pbrc";
Note:
See TracChangeset
for help on using the changeset viewer.