Changeset 2187 in ProjectBuilder


Ignore:
Timestamp:
Mar 3, 2017, 4:07:32 AM (7 years ago)
Author:
Bruno Cornec
Message:

Rename pb_distro_setuprepo_gen as pb_distro_setuprepo_gen_conf and create a
new pb_distro_setuprepo_gen external function called by pb to allow the usage
of external repository for pb installation itself if needed.

Location:
devel
Files:
2 edited

Legend:

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

    r2182 r2187  
    3333 
    3434our @ISA = qw(Exporter);
    35 our @EXPORT = qw(pb_distro_init pb_distro_conffile pb_distro_sysconffile pb_distro_get pb_distro_getlsb pb_distro_installdeps pb_distro_getdeps pb_distro_only_deps_needed pb_distro_setuprepo pb_distro_setuposrepo pb_distro_get_param pb_distro_get_context pb_distro_to_keylist pb_distro_conf_print pb_apply_conf_proxy);
     35our @EXPORT = qw(pb_distro_init pb_distro_conffile pb_distro_sysconffile pb_distro_get pb_distro_getlsb pb_distro_installdeps pb_distro_getdeps pb_distro_only_deps_needed pb_distro_setuprepo pb_distro_setuposrepo pb_distro_setuprepo_gen pb_distro_get_param pb_distro_get_context pb_distro_to_keylist pb_distro_conf_print pb_apply_conf_proxy);
    3636($VERSION,$REVISION) = pb_version_init();
    3737
     
    528528my $pbos = shift;
    529529
    530 return(pb_distro_setuprepo_gen($pbos,pb_distro_conffile(),"osrepo"));
     530return(pb_distro_setuprepo_gen_conf($pbos,pb_distro_conffile(),"osrepo"));
    531531}
    532532
     
    541541my $pbos = shift;
    542542
    543 return(pb_distro_setuprepo_gen($pbos,"$ENV{'PBDESTDIR'}/pbrc","addrepo"));
     543return(pb_distro_setuprepo_gen_conf($pbos,"$ENV{'PBDESTDIR'}/pbrc","addrepo"));
    544544}
    545545
     
    566566}
    567567
    568 =item B<pb_distro_setuprepo_gen>
    569 
    570 This function sets up in a generic way potential additional repository
    571 
    572 =cut
    573 
    574 sub pb_distro_setuprepo_gen {
     568=item B<pb_distro_setuprepo_gen_conf>
     569
     570This function sets up in a generic way potential additional repository using conf files
     571
     572=cut
     573
     574sub pb_distro_setuprepo_gen_conf {
    575575
    576576my $pbos = shift;
     
    585585my $param = pb_distro_get_param($pbos,$addrepo);
    586586return undef if ($param eq "");
     587
     588return(pb_distro_setuprepo_gen($pbos,$param));
     589}
     590
     591
     592=item B<pb_distro_setuprepo_gen>
     593
     594This function sets up in a generic way potential additional repository passed as a param
     595
     596=cut
     597
     598sub pb_distro_setuprepo_gen {
     599
     600my $pbos = shift;
     601my $param = shift;
     602
     603return if (not defined $param);
    587604
    588605pb_apply_conf_proxy($pbos);
  • devel/pb/bin/pb

    r2186 r2187  
    39033903    }
    39043904
     3905    my ($addrepo) = pb_conf_read("$ENV{'PBDESTDIR'}/pbrc","addrepo");
     3906    my $pbrepo = pb_distro_get_param($pbos,$addrepo);
    39053907    print SCRIPT << 'EOF';
    39063908   
     
    39123914pb_system("yum clean all","Cleaning yum env","mayfail") if ((($pbos->{'name'} eq "fedora") && ($pbos->{'version'} < 22)) || ($pbos->{'name'} eq "asianux") || ($pbos->{'name'} eq "rhel"));
    39133915my ($ospkgdep) = pb_conf_get_if("ospkgdep");
    3914    
     3916
    39153917my $pkgdep = pb_distro_get_param($pbos,$ospkgdep);
    3916 pb_distro_installdeps(undef,$pbos,undef,pb_distro_only_deps_needed($pbos,join(' ',split(/,/,$pkgdep))));
     3918my $forcerepo;
     3919EOF
     3920    print SCRIPT "\$forcerepo = pb_distro_setuprepo_gen(\$pbos,\"$pbrepo\");\n" if ((defined $pbrepo) && ($pbrepo ne ""));
     3921    print SCRIPT << 'EOF';
     3922pb_distro_installdeps(undef,$pbos,$forcerepo,pb_distro_only_deps_needed($pbos,join(' ',split(/,/,$pkgdep))));
    39173923
    39183924EOF
Note: See TracChangeset for help on using the changeset viewer.