Changeset 2468 in ProjectBuilder
- Timestamp:
- Jan 20, 2020, 2:12:55 AM (5 years ago)
- Location:
- devel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb-modules/lib/ProjectBuilder/Distribution.pm
r2465 r2468 681 681 } 682 682 } 683 pb_log(1, "INFO: Adding $repo from config file for $repotype step\n") ;683 pb_log(1, "INFO: Adding $repo from config file for $repotype step\n") if (defined $repo); 684 684 return(pb_distro_setuprepo_gen($pbos,$repo)); 685 685 } -
devel/pb/bin/pb
r2466 r2468 2694 2694 $origimage = "$tag{$pbstep}"; 2695 2695 } 2696 c luck "No image $tag{$pbstep} available in Docker, please create one first\n" if (not defined $found);2696 confess "No image $tag{$pbstep} available in Docker, please create one first\n" if ((not defined $found) && ($pbstep <= 3)); 2697 2697 # Now we use that image to do what is needed 2698 2698 # use a dockerfile to ease the creation of next images … … 3458 3458 pb_log(1,"Entering in pb_build2v ($action in $vtype) \n"); 3459 3459 3460 # We prepare scripts for all V of this vtype to allow sharing that part 3461 my ($v,$all) = pb_get2v($vtype); 3460 my ($v,$all) = ("", 0); 3461 # Determine on which V to work 3462 if (defined $ENV{'PBV'}) { 3463 @$v = split(/,/,$ENV{'PBV'}); 3464 } else { 3465 ($v,$all) = pb_get2v($vtype); 3466 } 3462 3467 3463 3468 # Send tar files when we do a global generation … … 3486 3491 my $counter = 0; 3487 3492 foreach my $v (@$v) { 3493 # Check that this VE/VM is in the list of systems for which we build 3494 if (($action eq "build") || ($action eq "prep")) { 3495 pb_check_v($v,$vtype); 3496 } 3488 3497 $counter++; 3489 3498 $pbscript{$v} = "$ENV{'PBDESTDIR'}/pb$action-$v"; … … 3746 3755 } 3747 3756 3757 # Return the list of all VMs/VEs/RMs we are working on through the content of v(e|m)list 3758 # in conf file 3759 3760 sub pb_get_allv { 3761 3762 my $vtype = shift; 3763 my $vlist = $vtype."list"; 3764 3765 my ($ptr) = pb_conf_get($vlist); 3766 my @v = split(/,/,$ptr->{$ENV{'PBPROJ'}}); 3767 return(\@v); 3768 } 3769 3748 3770 # 3749 3771 # Return the list of VMs/VEs/RMs we are working on 3750 3772 # $all is a flag to know if we return all of them 3751 # or only some (if all we publish also tar files in addition to pkgs 3773 # or only some (if all we publish also tar files in addition to pkgs) 3752 3774 # 3753 3775 sub pb_get2v { … … 3769 3791 return(\@v,$all); 3770 3792 } 3771 3772 3793 # This function creates a giant script to configure a particular VM/VE/RM, it then copies the 3773 3794 # script to the target. … … 3803 3824 my $counter = 0; 3804 3825 foreach my $v (@$vm) { 3826 # Verify that this V is in our list 3827 pb_check_v($v,$vtype); 3828 3805 3829 # Script generated - should be before the fork - after the %pbscript hash isn't updated correctly 3806 3830 $pbscript{$v} = "$ENV{'PBDESTDIR'}/setupv-$v"; … … 4395 4419 $pm->start($counter) and next if (defined $pbparallel); 4396 4420 4397 my $done = 0;4398 4421 my $lmsg = ""; 4399 4422 my $lctn = ""; … … 4408 4431 # pb -p pb -m distro-ver-arch newve -i distro:ver 4409 4432 ($pbforce == 1) ? $lmsg = "Forced" : $lmsg = "not found"; 4410 pb_log(0," Docker image $lctn $lmsg, creating it\n");4433 pb_log(0,"INFO: Docker image $lctn $lmsg, creating it\n"); 4411 4434 pb_launchv(undef,"ve",$v,$action,0,$pbforce,undef,undef,$pbimage); 4412 4435 } … … 4417 4440 if (($pbforce == 1) || (not defined $found)) { 4418 4441 ($pbforce == 1) ? $lmsg = "Forced" : $lmsg = "not found"; 4419 pb_log(0," Docker image $lctn $lmsg, creating it\n");4442 pb_log(0,"INFO: Docker image $lctn $lmsg, creating it\n"); 4420 4443 # pb -p pb -m distro-ver-arch setupve 4444 pb_log(2,"Using savproj: $savproj\n"); 4421 4445 if ($savproj eq "pb") { 4422 pb_cms2build("SandBox") if ($action !~ /sbx2/); 4423 $done = 1; 4446 pb_cms2build("SandBox") if ($action =~ /sbx2/); 4424 4447 pb_setup2v("ve","SandBox"); 4425 4448 } else { … … 4434 4457 if (($pbforce == 1) || (not defined $found)) { 4435 4458 ($pbforce == 1) ? $lmsg = "Forced" : $lmsg = "not found"; 4436 pb_log(0,"Docker image $lctn $lmsg, creating it\n"); 4437 # pb -p pb -m distro-ver-arch prepve 4438 if ($savproj eq "pb") { 4439 pb_cms2build("SandBox") if ($action !~ /sbx2/); 4440 $done = 1; 4441 } 4459 pb_log(0,"INFO: Docker image $lctn $lmsg, creating it\n"); 4460 # pb -p proj -m distro-ver-arch prepve 4442 4461 pb_build2v("ve","prep"); 4443 4462 } 4444 pb_log(0,"Instantiating a Docker container from $lctn\n"); 4445 if (($savproj ne "pb") || ($done == 0)) { 4446 pb_cms2build("SandBox") if ($action !~ /sbx2/); 4447 } 4463 pb_log(0,"INFO: Instantiating a Docker container from $lctn\n"); 4448 4464 pb_build2v("ve","build"); 4449 4465 $pm->finish if (defined $pbparallel); … … 5509 5525 } 5510 5526 5527 sub pb_check_v { 5528 5529 my $v = shift; 5530 my $vtype = shift; 5531 5532 my ($v2,$all2) = pb_get_allv($vtype); 5533 pb_log(1,"INFO: velist is:\n"); 5534 pb_log(1,Dumper(@$v2)); 5535 my $foundv = 0; 5536 foreach my $v3 (@$v2) { 5537 pb_log(1,"INFO: looking at **$v3** in $vtype"."list\n"); 5538 if ($v3 eq $v) { 5539 $foundv = 1; 5540 last; 5541 } 5542 } 5543 confess("Building for $v, however it's not part of the $vtype"."list parameter. Aborting") if ($foundv == 0); 5544 pb_log(1,"INFO: $v is in $vtype"."list\n"); 5545 return; 5546 } 5547 5548 5511 5549 1;
Note:
See TracChangeset
for help on using the changeset viewer.