Changeset 2502 in ProjectBuilder


Ignore:
Timestamp:
Apr 1, 2020, 2:28:06 AM (4 years ago)
Author:
Bruno Cornec
Message:

Fix pbinstalltype usage, based on project and addbuildrepo used in main conf files and check osperldep and improve setupv generation for pb_version_init and fix sbx2docker for pb/non-pb projects

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r2491 r2502  
    20902090            $made .= " ".pb_get_content($f);
    20912091        }
     2092        pb_rm_rf($tmpd);
    20922093        confess "Aborting, one or more of the children failed." if ((not $all_ok) && ($Global::pb_stop_on_error));
    2093         pb_rm_rf($tmpd);
    20942094    }
    20952095
     
    41384138
    41394139EOF
    4140     my $itype = pb_distro_get($pbos,"pbinstalltype");
     4140    my ($itype) = pb_conf_get("pbinstalltype");
    41414141    # Install from sandbox mean a file base install
    41424142    $itype = "file" if (defined $sbx);
    41434143    $itype = $installtype if (defined $installtype);
     4144    pb_log(2,"DEBUG: Found installtype: $itype\n");
    41444145    if ($itype =~ /^file/) {
    4145             #my ($addrepo) = pb_conf_read("$ENV{'PBDESTDIR'}/pbrc.yml","addbuildrepo");
    4146             #my $pbrepo = pb_distro_get_param($pbos,$addrepo);
    4147         my $pbrepo = pb_distro_get_in_conf_if($pbos,"$ENV{'PBDESTDIR'}/pbrc.yml","addbuildrepo");
     4146        my $pbrepo = pb_distro_get_if($pbos,"addbuildrepo");
     4147        #my $pbrepo = pb_distro_get_in_conf_if($pbos,"$ENV{'PBDESTDIR'}/pbrc.yml","addbuildrepo");
    41484148        print SCRIPT << 'EOF';
    41494149
     
    41904190my $verbopt = "mayfail";
    41914191$verbopt = "mayfailverbose" if ($pbdebug ge 1);
    4192 foreach my $m (split(/,/,$osperldep)) {
    4193     # Skip empty deps
    4194     next if ($m =~ /^\s*$/);
    4195     my $dir = $m;
    4196     $dir =~ s/-.*//;
    4197     pb_system("echo \"rm -rf $m* ; wget http://search.cpan.org/CPAN/modules/by-module/$dir/$m-$osperlver->{$m}.tar.gz ; gzip -cd $m-$osperlver->{$m}.tar.gz | tar xf - ; cd $m* ; if [ -f Build.PL ]; then perl Build.PL; ./Build ; ./Build install ; else perl Makefile.PL; make ; make install ; fi; cd .. ; rm -rf $m*\" | bash -e $bashopt" ,"Installing perl module $m-$osperlver->{$m}",$verbopt);
     4192if (defined $osperldep) {
     4193    foreach my $m (split(/,/,$osperldep)) {
     4194        # Skip empty deps
     4195        next if ($m =~ /^\s*$/);
     4196        my $dir = $m;
     4197        $dir =~ s/-.*//;
     4198        pb_system("echo \"rm -rf $m* ; wget http://search.cpan.org/CPAN/modules/by-module/$dir/$m-$osperlver->{$m}.tar.gz ; gzip -cd $m-$osperlver->{$m}.tar.gz | tar xf - ; cd $m* ; if [ -f Build.PL ]; then perl Build.PL; ./Build ; ./Build install ; else perl Makefile.PL; make ; make install ; fi; cd .. ; rm -rf $m*\" | bash -e $bashopt" ,"Installing perl module $m-$osperlver->{$m}",$verbopt);
     4199    }
    41984200}
    41994201EOF
     
    42204222pb_system("pb --version",undef,"verbose");
    42214223EOF
    4222     if ($vtype eq "ve"){
     4224    if ($vtype eq "ve") {
    42234225        if ($vetype ne "docker") {
    42244226            print SCRIPT << 'EOF';
     
    42394241}
    42404242chmod 0755,$nf;
     4243
    42414244EOF
    42424245    }
     4246
     4247    # Use a fake pb_version_init version here
     4248    print SCRIPT << "EOF";
     4249sub pb_version_init {
     4250    return("$projectbuilderver","$projectbuilderrev","$projectbuilderconfver");
     4251}
     4252EOF
    42434253
    42444254    # Adds pb_distro_get_context and all functions needed from ProjectBuilder::Distribution, Conf and Base
     
    42534263                    next if (/^use Exporter/);
    42544264                    next if (/^use ProjectBuilder::/);
     4265                    next if (/^1;$/);
    42554266                    # Remove lines with our except for the strerr var in YAML
    42564267                    next if ((/^our /) && ($_ !~ /errstr/));
     
    42634274        }
    42644275    }
    4265     # Use a fake pb_version_init version here
    42664276    print SCRIPT << "EOF";
    4267 sub pb_version_init {
    4268 
    4269 return("$projectbuilderver","$projectbuilderrev","$projectbuilderconfver");
    4270 }
    427142771;
    42724278EOF
     
    44534459        # pb -p pb -m distro-ver-arch setupve
    44544460        pb_log(2,"Using savproj: $savproj\n");
    4455         if ($savproj eq "pb") {
     4461        if ($savproj ne "pb") {
    44564462            pb_cms2build("SandBox") if ($action =~ /sbx2/);
    4457             pb_setup2v("ve","SandBox");
    4458         } else {
    44594463            # Here we install in the CTN pb from upstream packages to have a stable version
    44604464            pb_setup2v("ve",undef,"pkg");
     4465        } else {
     4466            pb_setup2v("ve","SandBox");
    44614467        }
    44624468    }
Note: See TracChangeset for help on using the changeset viewer.