Changeset 1907


Ignore:
Timestamp:
Oct 10, 2014, 11:32:12 AM (5 years ago)
Author:
bruno
Message:
Fix some default initializations (
undef e.g.)
  • VE.pm doesn't need to have pbstep (use pbforce simply)
  • Fix sbx2setupve in a docker context
  • Add entries for prepve|vm|rm
  • Move sandbox management into send2target so that all files to process are managed here
Location:
devel
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-modules/lib/ProjectBuilder/Base.pm

    r1903 r1907  
    146146my $cmd=shift;
    147147my $cmt=shift || $cmd;
    148 my $verbose=shift || undef;
     148my $verbose=shift;
    149149my $redir = "";
    150150
     
    201201sub pb_get_uri {
    202202
    203 my $uri = shift || undef;
     203my $uri = shift;
    204204
    205205pb_log(2,"DEBUG: uri:" . (defined $uri ? $uri : '') . "\n");
     
    252252sub pb_log_init {
    253253
    254 $pbdebug = shift || 0;
    255 $pbLOG = shift || \*STDOUT;
     254$pbdebug = shift;
     255$pbLOG = shift;
     256
     257$pbdebug = 0 if (not defined $pbdebug);
     258$pbLOG = \*STDOUT if (not defined $pbLOG);
    256259pb_log(1,"Debug value: $pbdebug\n");
    257260
     
    278281sub pb_log {
    279282
    280 my $dlevel = shift || 0;
    281 my $msg = shift || "";
    282 
     283my $dlevel = shift;
     284my $msg = shift;
     285
     286$dlevel = 0 if (not defined $dlevel);
     287$msg = "" if (not defined $msg);
    283288$pbLOG = \*STDOUT if (not defined $pbLOG);
    284289
     
    361366sub pb_exit {
    362367
    363 my $ret = shift || 0;
     368my $ret = shift;
     369$ret = 0 if (not defined $ret);
    364370pb_log(0,"Please remove manually $ENV{'PBTMP'} after debug analysis\n") if ($pbdebug > 1);
    365371exit($ret);
     
    426432sub pb_temp_init {
    427433
    428 my $pbkeep = shift || 0;    # Do not keep temp files by default
     434my $pbkeep = shift;
     435
     436# Do not keep temp files by default
     437$pbkeep = 0 if (not defined $pbkeep);
    429438
    430439if (not defined $ENV{'TMPDIR'}) {
     
    504513sub pb_check_requirements {
    505514
    506 my $req = shift || undef;
    507 my $opt = shift || undef;
    508 my $appname = shift || undef;
     515my $req = shift;
     516my $opt = shift;
     517my $appname = shift;
    509518
    510519my ($req2,$opt2) = (undef,undef);
  • devel/pb-modules/lib/ProjectBuilder/Conf.pm

    r1905 r1907  
    7878sub pb_conf_init {
    7979
    80 my $proj=shift || undef;
     80my $proj=shift;
    8181
    8282pb_log(1,"Entering pb_conf_init\n");
     
    240240open(CONF,"> $conffile") || confess "Unable to write into $conffile";
    241241
    242 foreach my $p (keys %$h) {
     242foreach my $p (sort keys %$h) {
    243243    my $j = $h->{$p};
    244     foreach my $k (keys %$j) {
     244    foreach my $k (sort keys %$j) {
    245245        print CONF "$p $k = $j->{$k}\n";
    246246    }
     
    321321sub pb_conf_add_last_in_hash {
    322322
    323 my $ptr = shift || undef;
     323my $ptr = shift;
    324324
    325325return if (not defined $ptr);
  • devel/pb-modules/lib/ProjectBuilder/Distribution.pm

    r1879 r1907  
    323323
    324324# SPEC file
    325 my $f = shift || undef;
     325my $f = shift;
    326326my $pbos = shift;
    327 my $deps = shift || undef;
     327my $deps = shift;
    328328
    329329# Protection
     
    358358sub pb_distro_getdeps {
    359359
    360 my $f = shift || undef;
     360my $f = shift;
    361361my $pbos = shift;
    362362
     
    441441
    442442my $pbos = shift;
    443 my $deps = shift || undef;
     443my $deps = shift;
    444444
    445445return("") if ((not defined $deps) || ($deps =~ /^\s*$/));
     
    538538
    539539my $pbos = shift;
    540 my $pbconf = shift || undef;
    541 my $pbkey = shift || undef;
     540my $pbconf = shift;
     541my $pbkey = shift;
    542542
    543543return if (not defined $pbconf);
  • devel/pb-modules/lib/ProjectBuilder/Env.pm

    r1872 r1907  
    139139sub pb_env_init {
    140140
    141 my $proj=shift || undef;
    142 my $pbinit=shift || undef;
     141my $proj=shift;
     142my $pbinit=shift;
    143143my $action=shift;
    144144my $pbkeep=shift || 0;
  • devel/pb-modules/lib/ProjectBuilder/VE.pm

    r1903 r1907  
    6868
    6969my $v = shift;
    70 my $pbscript = shift;
    71 my $pbforce = shift;   
    72 my $pbstep= shift;          # Which step are we in (0: create, 1: setup, 2: build, 3: use)
     70my $pbforce = shift;            # Which step are we in (0: create, 1: setup, 2: build, 3: use)
    7371my $locsnap = shift;
    7472my $vetype = shift;
     
    7876my $docrepo = undef;            # By default no repository for docker available
    7977
    80 pb_log(2,"Entering pb_ve_launch at step $pbstep\n");
     78pb_log(2,"Entering pb_ve_launch at step $pbforce for type $vetype\n");
    8179# Get distro context
    8280my $pbos = pb_distro_get_context($v);
     
    128126    my $root = pb_path_expand($vepath->{$ENV{PBPROJ}});
    129127   
    130     if (((((defined $verebuild) && ($verebuild->{$ENV{'PBPROJ'}} =~ /true/i)) || ($pbforce == 1)) && ($vetype ne "docker"))
     128    if (((((defined $verebuild) && ($verebuild->{$ENV{'PBPROJ'}} =~ /true/i)) || ($pbforce == 0)) && ($vetype ne "docker"))
    131129        # For docker we may have a reference image that we'll use
    132         || (($vetype eq "docker") && ($pbstep == 0))) {
     130        || (($vetype eq "docker") && ($pbforce == 0))) {
    133131
    134132        my ($verpmtype,$vedebtype) = pb_conf_get("verpmtype","vedebtype");
     
    288286
    289287    # If docker, create the image and remove the now temp dir except if we had one already
    290     if (($vetype eq "docker") && ($pbstep == 0)) {
     288    if (($vetype eq "docker") && ($pbforce == 0)) {
    291289        $docrepo = pb_ve_docker_repo($dockerregistry->{$ENV{'PBPROJ'}});
    292290        my $cmd1 = pb_check_req("docker",0);
     
    348346sub pb_ve_docker_registry {
    349347
    350 my $dockerreg = shift || undef;
     348my $dockerreg = shift;
    351349my $wget = pb_check_req("wget",0);
    352350my ($scheme, $account, $host, $port, $path) = pb_get_uri($dockerreg);
     
    369367sub pb_ve_docker_repo {
    370368
    371 my $dockerreg = shift || undef;
     369my $dockerreg = shift;
    372370my $docrepo = "";
    373371my ($scheme, $account, $host, $port, $path) = pb_get_uri($dockerreg);
     
    380378sub pb_ve_docker_get_image {
    381379
    382 my $pbimage = shift || undef;
     380my $pbimage = shift;
    383381my $found = 0;
    384382
     
    398396sub pb_ve_get_type {
    399397
    400 my $vetype = shift || undef;
     398my $vetype = shift;
    401399
    402400# Get VE context
  • devel/pb/bin/pb

    r1906 r1907  
    252252RM means Remote Machine, and could be a physical or Virtual one.
    253253This is one buildfarm integration for pb.
     254
     255=item B<prepvm>
     256
     257Prepare the VMs to have all requirements to build the project
     258
     259=item B<prepve>
     260
     261Prepare the VEs to have all requirements to build the project
     262
     263=item B<preprm>
     264
     265Prepare the RMs to have all requirements to build the project
    254266
    255267=item B<sbx2vm>
     
    855867} elsif ($action =~ /^build2vm$/) {
    856868    pb_build2v("vm","build");
     869} elsif ($action =~ /^preprm$/) {
     870    pb_build2v("rm","prep");
     871} elsif ($action =~ /^prepve$/) {
     872    pb_build2v("ve","prep");
     873} elsif ($action =~ /^prepvm$/) {
     874    pb_build2v("vm","prep");
    857875} elsif ($action =~ /^cms2rm$/) {
    858876    pb_cms2build("CMS");
     
    10001018sub pb_cms2build {
    10011019
    1002     my $param = shift || undef;
    1003     my $web = shift || undef;
     1020    my $param = shift;
     1021    my $web = shift;
    10041022
    10051023    my $pkg;
     
    15281546    }
    15291547    pb_log(0,"INFO: ------ Finished preparing build environment ------\n");
    1530     open(PKG,">> $ENV{'PBDESTDIR'}/$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.pb") || die "Unable to append to $ENV{'PBDESTDIR'}/$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.pb";
    1531     print PKG "pbstep $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'} = 2\n";
    1532     close(PKG);
    15331548}
    15341549
     
    15411556    my $pbos = pb_distro_get_context();
    15421557
    1543     # Check whether the preparation phase has already been done or not
    1544     my ($pbstep) = pb_distro_get_param($pbos,pb_conf_read_if("$ENV{'PBDESTDIR'}/$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.pb","pbstep"));
    1545     pb_build2prep() if ((not defined $pbstep) || ($pbstep < 2));
    1546    
    15471558    # Get list of packages to build
    15481559    my $ptr = pb_get_pkg();
     
    19341945    print KEEP "$made\n";
    19351946    close(KEEP);
    1936     open(PKG,">> $ENV{'PBDESTDIR'}/$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.pb") || die "Unable to append to $ENV{'PBDESTDIR'}/$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.pb";
    1937     print PKG "pbstep $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'} = 3\n";
    1938     close(PKG);
    19391947    pb_distro_installdeps(undef,$pbos,$ret) if ($do_install);
    1940 }
    1941 
    1942 sub create_solaris_prototype {
    1943 
    1944     my $uidgid = "bin bin";
    1945     my $pkgdestdir = $ENV{'PBSOLDESTDIR'};
    1946 
    1947     return if ($_ =~ /^$pkgdestdir$/);
    1948     if (-d $_) {
    1949         my $n = $File::Find::name;
    1950         $n =~ s~$pkgdestdir/~~;
    1951         print PROTO "d none $n 0755 $uidgid\n";
    1952     } elsif (-x $_) {
    1953         my $n = $File::Find::name;
    1954         $n =~ s~$pkgdestdir/~~;
    1955         print PROTO "f none $n 0755 $uidgid\n";
    1956     } elsif (-f $_) {
    1957         my $n = $File::Find::name;
    1958         $n =~ s~$pkgdestdir/~~;
    1959         print PROTO "f none $n 0644 $uidgid\n";
    1960     }
    19611948}
    19621949
     
    19751962
    19761963    my $cmt = shift;
    1977     my $pbscript = shift || undef;
    1978     my $v = shift || undef;
    1979     my $vexist = shift || 0;            # 0 is FALSE
    1980     my $vpid = shift || 0;              # 0 is FALSE
    1981     my $snapme = shift || 0;            # 0 is FALSE
    1982     my $pbstep = shift || 3;            # 3 is usage of container
    1983 
     1964    my $pbscript = shift;
     1965    my $v = shift;
     1966    my $vexist = shift;         # 0 is FALSE
     1967    my $vpid = shift;           # 0 is FALSE
     1968    my $snapme = shift;         # 0 is FALSE
     1969    my $pbstep = shift;         # 3 is usage of container
     1970
     1971    $vexist = 0 if (not defined $vexist);
     1972    $vpid = 0 if (not defined $vpid);
     1973    $snapme = 0 if (not defined $snapme);
     1974    $pbstep = 3 if (not defined $pbstep);
    19841975    pb_log(2,"DEBUG: pb_send2target($cmt,".Dumper($v).",$vexist,$vpid)\n");
    19851976    my $host = "sshhost";
     
    20852076    }
    20862077
    2087     if ($cmt =~ /(V[EM]|RM)build/) {
     2078    if ($cmt =~ /(V[EM]|RM)(build|prep)/) {
    20882079        $src="$src $ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb $ENV{'PBDESTDIR'}/$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.pb $ENV{'PBETC'} $ENV{'PBDESTDIR'}/pbrc $pbscript{$v}";
    20892080    } elsif ($cmt =~ /(V[EM]|RM)Script/) {
     
    21612152    } elsif ($cmt eq "CPAN") {
    21622153        $tdir = "$remdir";
    2163     } elsif ($cmt =~ /(V[EM]|RM)(build|test)/) {
     2154    } elsif ($cmt =~ /(V[EM]|RM)(build|test|prep)/) {
    21642155        $tdir = $remdir."/$ENV{'PBPROJ'}/delivery";
    21652156        $bdir = $remdir."/$ENV{'PBPROJ'}/build";
     
    24232414    if ($cmt =~ /^VE/) {
    24242415        $tp = pb_path_expand($vepath->{$ENV{'PBPROJ'}});
     2416        $vetype = pb_ve_get_type($vetype);
    24252417        if ($vetype eq "docker") {
    24262418            $tpdir = "/";
     
    24282420            $tpdir = pb_path_expand("$tp/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'}");
    24292421        }
    2430         $vetype = pb_ve_get_type($vetype);
    24312422        my $arch = pb_get_arch();
    24322423        if ($vetype eq "chroot") {
     
    25612552        $logres = "> ";
    25622553    }
     2554
     2555    if ($cmt =~ /SandBox/) {
     2556        # Install from sandbox mean using the result of the just passed sbx2build command
     2557        # Get content saved in cms2build
     2558        my ($pkg) = pb_conf_read("$ENV{'PBDESTDIR'}/$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.pb","pbpkg");
     2559        my $pbextdir = pb_get_extdir();
     2560        confess "Unable to get package list" if (not defined $pkg);
     2561
     2562        # We consider 2 specific packages
     2563        my $vertag1 = $pkg->{"ProjectBuilder"};
     2564        my $vertag2 = $pkg->{"project-builder"};
     2565        # get the version of the current package - maybe different
     2566        pb_log(2,"Vertag1: $vertag1\n");
     2567        pb_log(2,"Vertag2: $vertag2\n");
     2568        my ($pbver1,$tmp1) = split(/-/,$vertag1);
     2569        my ($pbver2,$tmp2) = split(/-/,$vertag2);
     2570        if ($cmt =~ /VE/) {
     2571            # Copy inside the VE
     2572            if ($vetype ne "docker") {
     2573                copy("$ENV{'PBDESTDIR'}/ProjectBuilder-$pbver1$pbextdir.tar.gz","$tpdir/tmp");
     2574                copy("$ENV{'PBDESTDIR'}/project-builder-$pbver2$pbextdir.tar.gz","$tpdir/tmp");
     2575            } else {
     2576                copy("$ENV{'PBDESTDIR'}/ProjectBuilder-$pbver1$pbextdir.tar.gz","$context");
     2577                copy("$ENV{'PBDESTDIR'}/project-builder-$pbver2$pbextdir.tar.gz","$context");
     2578                print DOCKER "COPY ProjectBuilder-$pbver1$pbextdir.tar.gz /tmp/\n";
     2579                print DOCKER "COPY project-builder-$pbver2$pbextdir.tar.gz /tmp/\n";
     2580            }
     2581        } else {
     2582            pb_system("$cpcmd $ENV{'PBDESTDIR'}/ProjectBuilder-$pbver1$pbextdir.tar.gz $ENV{'PBDESTDIR'}/project-builder-$pbver2$pbextdir.tar.gz $mac:/tmp","Copying local project files to $vetype.");
     2583        }
     2584    }
     2585           
    25632586    # For docker everything is done in the Dockerfile
    25642587    if (($cmt =~ /^VE/) && ($vetype eq "docker") && ($pbstep < 3)) {
     
    25802603            pb_system("$shcmd \"sudo chown -R $mac $tdir\"","Adapt owner in $tdir to $mac");
    25812604        } else {
    2582             print DOCKER "RUN sed -i '/requiretty/d' /etc/sudoers" if ($pbstep == 1);
     2605            print DOCKER "RUN sed -i '/requiretty/d' /etc/sudoers\n" if ($pbstep == 1);
    25832606        }
    25842607    }
     
    26152638    }
    26162639    # this is where we lanch the execution
    2617     pb_system("$shcmd","Executing pbscript on $cptarget if needed",$cmdverb);
     2640    my $ret = pb_system("$shcmd","Executing pbscript on $cptarget if needed",$cmdverb);
    26182641
    26192642    if ($cmt =~ /^(V[EM]|RM)build/) {
     
    27002723    }
    27012724    if (($cmt =~ /^VE/) && ($snapme != 0)) {
    2702         pb_ve_snap($pbos,$tp);
    27032725        if ($vetype eq "docker") {
    27042726            foreach my $f (split(/ +/,$src)) {
    27052727                unlink("$context/$f");
    27062728            }
     2729        } else {
     2730            pb_ve_snap($pbos,$tp);
    27072731        }
    27082732    }
     
    27142738my $vtype=shift;
    27152739my $pbstep=shift;   # Which step are we in (0: create, 1: setup pb, 2: prep pbproj, 3: use to build)
    2716 my $pbforce=shift || 0; # Force stop of VM. Default not.
    2717 my $snapme=shift || 0;  # Do we have to create a snapshot. Default not.
    2718 my $pbimage=shift || undef; # Which image to use to start the VM/VE
    2719 my $vm;
    2720 my $all;
     2740my $pbforce=shift;  # Force stop of VM. Default not.
     2741my $snapme=shift;   # Do we have to create a snapshot. Default not.
     2742my $pbimage=shift;  # Which image to use to start the VM/VE
     2743
     2744$pbforce = 0 if (not defined $pbforce);
     2745$snapme = 0 if (not defined $snapme);
    27212746
    27222747pb_log(2,"DEBUG: pb_script2v($vtype,$pbstep,$pbforce,$snapme)\n");
     
    27292754my $pbscript=shift;
    27302755my $vtype = shift;
    2731 my $action = shift;             # It an action is defined then use send2target
     2756my $action = shift;         # It an action is defined then use send2target
    27322757my $pbstep=shift;           # Which step are we in (0: create, 1: setup, 2: build 3: use)
    2733 my $pbforce=shift || 0;         # Force stop of VM. Default not.
    2734 my $snapme = shift || 0;        # By default do not snap a VM/VE/RM
    2735 my $usesnap = shift || 1;       # By default study the usage of the snapshot feature of VM/VE/RM   
    2736 my $pbimage=shift || undef;     # Which image to use to start the VM/VE
     2758my $pbforce=shift;          # Force stop of VM. Default not.
     2759my $snapme = shift;         # By default do not snap a VM/VE/RM
     2760my $usesnap = shift;        # By default study the usage of the snapshot feature of VM/VE/RM   
     2761my $pbimage=shift        # Which image to use to start the VM/VE
    27372762my $vm;
    27382763my $all;
     2764
     2765$pbforce = 0 if (not defined $pbforce);
     2766$snapme = 0 if (not defined $snapme);
     2767$usesnap = 1 if (not defined $usesnap);
    27392768
    27402769# Adapt // mode to memory size
     
    27772806    my $pbscript = $pbscript->{$v} if (defined $pbscript->{$v});
    27782807    $pbscript = $pbscript->{'default'} if (not defined $pbscript);
    2779     confess "No script defined so unable to launch it in $v" if (not defined $pbscript);
    27802808    ($vexist,$vpid) = pb_launchv($pbscript,$vtype,$v,$action,$pbstep,$pbforce,$snapme,$pbsnap,$pbimage);
    27812809   
     
    27952823my $pbscript=shift;
    27962824my $vtype = shift;
    2797 my $v = shift;                  # Only 1 VM/VE/RM treated here
    2798 my $action = shift;             # It an action is defined then use send2target
     2825my $v = shift;              # Only 1 VM/VE/RM treated here
     2826my $action = shift;         # It an action is defined then use send2target
    27992827my $pbstep=shift;           # Which step are we in (0: create, 1: setup, 2: build 3: use)
    2800 my $pbforce=shift || 0;         # Force stop of VM. Default not.
    2801 my $snapme = shift || 0;        # By default do not snap a VM/VE/RM
    2802 my $usesnap = shift || 1;       # By default study the usage of the snapshot feature of VM/VE/RM   
    2803 my $pbimage=shift || undef;     # Which image to use to start the VM/VE
     2828my $pbforce=shift;          # Force stop of VM. Default not.
     2829my $snapme = shift;         # By default do not snap a VM/VE/RM
     2830my $usesnap = shift;            # By default study the usage of the snapshot feature of VM/VE/RM   
     2831my $pbimage=shift        # Which image to use to start the VM/VE
    28042832my $vexist = undef;
    28052833my $vpid = undef;
     2834
     2835$pbforce = 0 if (not defined $pbforce);
     2836$snapme = 0 if (not defined $snapme);
     2837$usesnap = 1 if (not defined $usesnap);
    28062838
    28072839# Check that v exists
     
    28132845}
    28142846
    2815 pb_log(2,"DEBUG: pb_launchv(script,vtype,v,step,force,snapme,usesnap: $pbscript,$vtype,$v,$pbstep,$pbforce,$snapme,$usesnap)\n");
     2847pb_log(2,"DEBUG: pb_launchv(vtype,v,step,force,snapme,usesnap: $vtype,$v,$pbstep,$pbforce,$snapme,$usesnap)\n");
    28162848pb_log(2,"DEBUG: pb_launchv(pbimage: $pbimage)\n") if (defined $pbimage);
     2849pb_log(2,"DEBUG: pb_launchv(pbimage: $pbscript)\n") if (defined $pbscript);
    28172850pb_log(2,"DEBUG: pb_launchv(action: $action)\n") if (defined $action);
    28182851# Keep only the first VM in case many were given
     
    29673000    # Force the creation of the VE and no snapshot usable
    29683001    $vetype = pb_ve_get_type($vetype);
    2969     pb_ve_launch($v,$pbscript,$pbforce,$pbstep,$usesnap,$vetype,$pbimage);
     3002    pb_ve_launch($v,$pbstep,$usesnap,$vetype,$pbimage);
    29703003    $vexist = 0;
    29713004    $vpid = 0;
    29723005} else {
    2973     # RM here
    2974     # Get distro context
    2975     my $pbos = pb_distro_get_context($v);
    2976 
    29773006    # Get RM context
    29783007    my ($ptr,$rmpath) = pb_conf_get("rmtype","rmpath");
     
    30343063
    30353064my $vtype = shift;
    3036 my $action = shift || "build";   #build, test or prep
    3037 my $pbforce=shift || 0;         # Force stop of VM. Default not.
     3065my $action = shift;     #build, test or prep
     3066my $pbforce=shift;      # Force stop of VM. Default not.
     3067
     3068$action = "build" if (not defined $action);
     3069$pbforce = 0 if (not defined $pbforce);
    30383070
    30393071my $pbstep;
     
    31013133    print SCRIPT "export PBPROJ=$ENV{'PBPROJ'}\n";
    31023134
    3103     if ($action eq "build") {
     3135    if (($action eq "build") || ($action eq "prep")) {
    31043136        print SCRIPT "# Preparation for pb\n";
    31053137        print SCRIPT "rm -f \$HOME/.pbrc\n";
     
    31093141
    31103142    # VE needs a good /proc, tolerate one being potentially left around after a failure
     3143    $vetype = pb_ve_get_type($vetype);
    31113144    if (($vtype eq "ve") && ($vetype ne "docker")) {
    31123145        print SCRIPT "[ -d /proc/1 ] || sudo /bin/mount -t proc /proc /proc\n";
     
    33583391
    33593392my $vtype = shift;
    3360 my $sbx = shift || undef;
     3393my $sbx = shift;
    33613394my $pbstep = 1;
    33623395
     
    34633496        # once this is done, we can do what we need on the VM/RM remotely
    34643497    } elsif ($vtype eq "ve") {
     3498        $vetype = pb_ve_get_type($vetype);
    34653499        if ($vetype ne "docker") {
    34663500            print SCRIPT << "EOF";
     
    37273761            my ($pbver1,$tmp1) = split(/-/,$vertag1);
    37283762            my ($pbver2,$tmp2) = split(/-/,$vertag2);
    3729             # Copy inside the VE
    3730             if ($vtype eq "ve") {
    3731                 my ($vepath) = pb_conf_get("vepath");
    3732                 copy("$ENV{'PBDESTDIR'}/ProjectBuilder-$pbver1$pbextdir.tar.gz","$vepath->{$ENV{'PBPROJ'}}/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'}/tmp");
    3733                 copy("$ENV{'PBDESTDIR'}/project-builder-$pbver2$pbextdir.tar.gz","$vepath->{$ENV{'PBPROJ'}}/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'}/tmp");
    3734             } else {
    3735                 pb_system("scp -i $keyfile -p -o UserKnownHostsFile=/dev/null -P $nport $ENV{'PBDESTDIR'}/ProjectBuilder-$pbver1$pbextdir.tar.gz $ENV{'PBDESTDIR'}/project-builder-$pbver2$pbextdir.tar.gz root\@$vmhost->{$ENV{'PBPROJ'}}:/tmp","Copying local project files to $vtype.");
    3736             }
    37373763            $cmdget = "mv /tmp/ProjectBuilder-$pbver1$pbextdir.tar.gz ProjectBuilder-latest.tar.gz ; mv /tmp/project-builder-$pbver2$pbextdir.tar.gz project-builder-latest.tar.gz";
    37383764        } else {
     
    38513877# Launch the VM/VE/RM
    38523878pb_log(2,"DEBUG: before parallel launch, pbscript hash is:".Dumper(%pbscript)."\n");
    3853 pb_parallel_launchv(\%pbscript,$vtype,uc($vtype)."Script",$pbstep,$pbforce);
     3879pb_parallel_launchv(\%pbscript,$vtype,uc($vtype)."Script".$sbx,$pbstep,$pbforce);
    38543880return;
    38553881}
     
    38593885
    38603886my $vtype = shift;
    3861 my $pbstep = 3;
     3887my $pbstep = 2;
    38623888
    38633889my ($vm,$all) = pb_get2v($vtype);
     
    39233949EOF
    39243950    # VE needs a good /proc
     3951    $vetype = pb_ve_get_type($vetype);
    39253952    if (($vtype eq "ve") && ($vetype ne "docker")) {
    39263953        print SCRIPT "sudo /bin/mount -t proc /proc /proc\n";
     
    47604787}   
    47614788
    4762 sub pb_get_extdir () {
     4789sub pb_get_extdir {
    47634790
    47644791    # the pbrc file should contain it and whatever the key, we take it
     
    47764803}
    47774804
     4805# Unused now
     4806sub pb_keep_step {
     4807
     4808my $pbos = shift;
     4809my $pbstep = shift;
     4810
     4811$pbstep = 3 if (not defined $pbstep);
     4812
     4813my %h;
     4814my $h = \%h;
     4815$h = pb_conf_cache("$ENV{'PBDESTDIR'}/$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.pb",$h);
     4816$h->{'pbstep'}->{"$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}"} = $pbstep;
     4817pb_conf_write("$ENV{'PBDESTDIR'}/$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.pb",$h);
     4818}
     4819
     4820sub create_solaris_prototype {
     4821
     4822    my $uidgid = "bin bin";
     4823    my $pkgdestdir = $ENV{'PBSOLDESTDIR'};
     4824
     4825    return if ($_ =~ /^$pkgdestdir$/);
     4826    if (-d $_) {
     4827        my $n = $File::Find::name;
     4828        $n =~ s~$pkgdestdir/~~;
     4829        print PROTO "d none $n 0755 $uidgid\n";
     4830    } elsif (-x $_) {
     4831        my $n = $File::Find::name;
     4832        $n =~ s~$pkgdestdir/~~;
     4833        print PROTO "f none $n 0755 $uidgid\n";
     4834    } elsif (-f $_) {
     4835        my $n = $File::Find::name;
     4836        $n =~ s~$pkgdestdir/~~;
     4837        print PROTO "f none $n 0644 $uidgid\n";
     4838    }
     4839}
     4840
     4841
    477848421;
  • devel/pb/lib/ProjectBuilder/CMS.pm

    r1896 r1907  
    6262sub pb_cms_init {
    6363
    64 my $pbinit = shift || undef;
    65 my $param = shift || undef;
     64my $pbinit = shift;
     65my $param = shift;
    6666
    6767my ($pburl) = pb_conf_get("pburl");
     
    162162
    163163my @pkgs = ();
    164 my $defpkgdir = shift || undef;
    165 my $extpkgdir = shift || undef;
     164my $defpkgdir = shift;
     165my $extpkgdir = shift;
    166166
    167167# Get packages list
     
    188188sub pb_cms_get_real_pkg {
    189189
    190 my $pbpkg = shift || undef;
     190my $pbpkg = shift;
    191191my $dtype = shift;
    192192my $pbpkgreal = $pbpkg;
     
    285285my $chglog = shift;
    286286my $authors = shift;
    287 my $testver = shift || undef;
     287my $testver = shift;
    288288
    289289pb_cms_create_authors($authors,$dest,$scheme);
  • devel/pb/lib/ProjectBuilder/Changelog.pm

    r1791 r1907  
    7171my $OUTPUT = shift;
    7272my $doit = shift;
    73 my $chglog = $pb->{'chglog'} || undef;
     73my $chglog = $pb->{'chglog'};
    7474
    7575my $log = "";
Note: See TracChangeset for help on using the changeset viewer.