Ignore:
Timestamp:
Dec 23, 2010, 2:01:37 AM (13 years ago)
Author:
Bruno Cornec
Message:
  • Adds params to pb_distro_setuprepo to support generic family/os templates
  • Fix pbinstalltype issue (setupve was broken) by useing a dsitro based hash
  • Use new pb.conf variable (ospkg and osrepo for pkg install)
  • Adds function pb_distro_setuposrepo to setup pb install repo
  • Adds a private pb_distro_setuprepo_gen function for code share between pb_distro_setuposrepo and pb_distro_setuprepo
  • Move the relative conf parameters from pb.pb to pb.conf
File:
1 edited

Legend:

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

    r1111 r1132  
    2323 
    2424our @ISA = qw(Exporter);
    25 our @EXPORT = qw(pb_distro_conffile pb_distro_init pb_distro_get pb_distro_getlsb pb_distro_installdeps pb_distro_getdeps pb_distro_only_deps_needed pb_distro_setuprepo pb_distro_get_param);
     25our @EXPORT = qw(pb_distro_conffile pb_distro_init 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);
    2626
    2727=pod
     
    406406}
    407407
    408 =item B<pb_distro_setuprepo>
    409 
    410 This function sets up potential additional repository to the build environment
    411 
    412 =cut
    413 
    414 sub pb_distro_setuprepo {
     408=item B<pb_distro_setuposrepo>
     409
     410This function sets up potential additional repository for the setup phase
     411
     412=cut
     413
     414sub pb_distro_setuposrepo {
    415415
    416416my $ddir = shift || undef;
     
    418418my $darch = shift;
    419419my $dtype = shift || undef;
    420 
    421 my ($addrepo) = pb_conf_read("$ENV{'PBDESTDIR'}/pbrc","addrepo");
     420my $dfam = shift || undef;
     421my $dos = shift || undef;
     422
     423pb_distro_setuprepo_gen($ddir,$dver,$darch,$dtype,$dfam,$dos,pb_distro_conffile(),"osrepo");
     424}
     425
     426=item B<pb_distro_setuprepo>
     427
     428This function sets up potential additional repository to the build environment
     429
     430=cut
     431
     432sub pb_distro_setuprepo {
     433
     434my $ddir = shift || undef;
     435my $dver = shift;
     436my $darch = shift;
     437my $dtype = shift || undef;
     438my $dfam = shift || undef;
     439my $dos = shift || undef;
     440
     441pb_distro_setuprepo_gen($ddir,$dver,$darch,$dtype,$dfam,$dos,"$ENV{'PBDESTDIR'}/pbrc","addrepo");
     442}
     443
     444=item B<pb_distro_setuprepo_gen>
     445
     446This function sets up in a generic way potential additional repository
     447
     448=cut
     449
     450sub pb_distro_setuprepo_gen {
     451
     452my $ddir = shift || undef;
     453my $dver = shift;
     454my $darch = shift;
     455my $dtype = shift || undef;
     456my $dfam = shift || undef;
     457my $dos = shift || undef;
     458my $pbconf = shift || undef;
     459my $pbkey = shift || undef;
     460
     461return if (not defined $pbconf);
     462return if (not defined $pbkey);
     463my ($addrepo) = pb_conf_read($pbconf,$pbkey);
    422464return if (not defined $addrepo);
    423465
    424 my $param = pb_distro_get_param($ddir,$dver,$darch,$addrepo);
     466my $param = pb_distro_get_param($ddir,$dver,$darch,$addrepo,$dfam,$dtype,$dos);
    425467return if ($param eq "");
    426468
     
    487529my $dos = shift || "unknown";
    488530
     531pb_log(2,"DEBUG: pb_distro_get_param on $ddir-$dver-$darch for ".Dumper($opt)."\n");
    489532if (defined $opt->{"$ddir-$dver-$darch"}) {
    490533    $param = $opt->{"$ddir-$dver-$darch"};
Note: See TracChangeset for help on using the changeset viewer.