Changeset 91 in ProjectBuilder for devel/pb/bin
- Timestamp:
- Sep 3, 2007, 6:50:38 PM (18 years ago)
- Location:
- devel/pb/bin
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/bin/pb
r90 r91 44 44 my $pbdate = strftime("%Y-%m-%d", @date); 45 45 46 getopts('hl: p:qr:tv',\%opts);46 getopts('hl:m:p:qr:tv',\%opts); 47 47 48 48 my ($projectbuilderver,$projectbuilderrev) = pb_version_init(); … … 77 77 $ENV{'PBROOT'} = $opts{'r'}; 78 78 } 79 # Handle virtual machines if any 80 if (defined $opts{'m'}) { 81 $ENV{'PBVM'} = $opts{'m'}; 82 } 79 83 # Handles project name if any 80 84 if (defined $opts{'p'}) { … … 87 91 print $LOG "Action: $action\n" if ($debug >= 0); 88 92 89 # Keep s those project value to store atend each time93 # Keep those project values to store them at the end each time 90 94 my $pbprojtag = $ENV{'PBTAG'}; 91 95 my $pbprojver = $ENV{'PBVER'}; … … 103 107 } elsif ($action =~ /^pkg2ssh$/) { 104 108 pb_pkg2ssh(); 109 } elsif ($action =~ /^build2vm$/) { 110 pb_build2vm(); 111 } elsif ($action =~ /^cms2vm$/) { 112 pb_cms2build(); 113 pb_build2vm(); 105 114 } else { 106 115 print $LOG "'$action' is not available\n"; … … 158 167 159 168 my %build; 160 open(D,"$ENV{'PBCONF'}/DISTROS") || die "Unable to find $ENV{'PBCONF'}/DISTROS\n"; 161 while (<D>) {162 my $d = $_;163 my ($n dir,$ver) = split(/_/,$d);169 170 my ($ptr) = pb_conf_get("vmlist"); 171 foreach my $d (split(/,/,$ptr->{$ENV{'PBPROJ'}})) { 172 my ($name,$ver) = split(/_/,$d); 164 173 chomp($ver); 165 my ($ddir, $dver, $dfam, $dtype, $dsuf) = pb_distro_init($n dir,$ver);174 my ($ddir, $dver, $dfam, $dtype, $dsuf) = pb_distro_init($name,$ver); 166 175 print $LOG "DEBUG: distro tuple: ".Dumper($ddir, $dver, $dfam, $dtype, $dsuf)."\n" if ($debug >= 1); 167 176 print $LOG "DEBUG Filtering PBDATE => $pbdate, PBTAG => $pbtag, PBVER => $pbver\n" if ($debug >= 1); … … 238 247 print $LOG "No Build files found for ".join(',',@notfound)."\n"; 239 248 } 240 close(D);241 249 # Prepare the dest directory for archive 242 250 if (-x "$ENV{'PBCONF'}/$pbpkg/pbinit") { … … 374 382 $src="$ENV{'PBBUILDDIR'}/RPMS/*/$pbpkg$pbver-$pbtag$dsuf.*.rpm $ENV{'PBBUILDDIR'}/SRPMS/$pbpkg$pbver-$pbtag$dsuf.src.rpm" 375 383 } elsif ($dtype eq "deb") { 376 $src="$ENV{'PBBUILDDIR'}/$pbpkg_*.deb $ENV{'PBBUILDDIR'}/$pbpkg_*.dsc $ENV{'PBBUILDDIR'}/$pbpkg_*.tag.gz" 384 my $tmp = "$ENV{'PBBUILDDIR'}/$pbpkg"; 385 $src="$tmp"."_*.deb $tmp"."_*.dsc $tmp"."_*.tar.gz" 377 386 } elsif ($dtype eq "ebuild") { 378 387 $src="$ENV{'PBBUILDDIR'}/portage/*/$pbpkg/$pbpkg$pbver.ebuild" … … 424 433 } 425 434 435 sub pb_get_vm { 436 437 my @vm; 438 439 # Get VM list 440 if (not defined $ENV{'PBVM'}) { 441 @vm = keys %defpkgdir; 442 } elsif ($ENV{'PBVM'} =~ /^all$/) { 443 @vm = keys %defpkgdir; 444 if (defined %extpkgdir) { 445 my $k = keys %extpkgdir; 446 if (defined $k) { 447 push(@vm, keys %extpkgdir); 448 } 449 } 450 } else { 451 @vm = $ENV{'PBVM'}; 452 } 453 print $LOG "VMs: ".join(',',@vm)."\n" if ($debug >= 0); 454 return(\@vm); 455 } 456 426 457 sub pb_extract_build_files { 427 458 … … 449 480 print "pb (aka project-builder) Version $projectbuilderver-$projectbuilderrev\n"; 450 481 print "\n"; 451 print "Syntax: pb [-vhqt][-r pbroot][-p project] <action> [<params>...]\n";482 print "Syntax: pb [-vhqt][-r pbroot][-p project][-m \"mach-1...\"] <action> [<pkg1>...]\n"; 452 483 print "\n"; 453 484 print "-h : This help file\n"; … … 456 487 print "-v : Verbose mode\n"; 457 488 print "\n"; 489 print "-m machine : Name of the virtual Machines you want\n"; 490 print " to build on (space separated) \n"; 491 print " (or use the env variable PBVM) \n"; 492 print "\n"; 493 print "-p project : Name of the project you're working on\n"; 494 print " (or use the env variable PBPROJ) \n"; 495 print "\n"; 458 496 print "-r pbroot : Path Name of project under the CMS \n"; 459 497 print " (or use the env variable PBROOT) \n"; 460 print "\n";461 print "-p project : Name of the project you're working on\n";462 print " (or use the env variable PBPROJ) \n";463 498 print "\n"; 464 499 print "<action> can be:\n";
Note:
See TracChangeset
for help on using the changeset viewer.