Changeset 2426 in ProjectBuilder for devel/pb-modules
- Timestamp:
- Sep 1, 2019, 3:18:34 AM (5 years ago)
- Location:
- devel/pb-modules
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb-modules/etc/pb.yml.pod
r2410 r2426 27 27 =over 4 28 28 29 =item B<add repo>30 31 Nature: Optional 32 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch). The family name is generaly used here. 33 Value: comma separated list of URLs that point to repository files, or packages to install . The values may not include substitutions.34 Conffile: project 35 Example: add repo:29 =item B<addbuildrepo> 30 31 Nature: Optional 32 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch). The family name is generaly used here. 33 Value: comma separated list of URLs that point to repository files, or packages to install at project build time. The values may not include substitutions. 34 Conffile: project 35 Example: addbuildrepo: 36 36 centos-5-x86_64: file:///prj/extras.repo,http://mirror.centos.org/centos/5.8/extras/x86_64/RPMS/chrpath-0.13-3.el5.centos.x86_64.rpm 37 38 =item B<addinstallrepo> 39 40 Nature: Optional 41 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch). The family name is generaly used here. 42 Value: comma separated list of URLs that point to repository files, or packages to install at project installation time. The values may not include substitutions. 43 Conffile: project 44 Example: addinstallrepo: 45 centos-7-x86_64: ftp://ftp.project-builder.org/centos/7/x86_64/pb.repo 46 47 =item B<addtestrepo> 48 49 Nature: Optional 50 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch). The family name is generaly used here. 51 Value: comma separated list of URLs that point to repository files, or packages to install at project test time. The values may not include substitutions. 52 Conffile: project 53 Example: addtestrepo: 54 centos-7-x86_64: ftp://ftp.project-builder.org/centos/7/x86_64/pb.repo 37 55 38 56 =item B<cachedir> -
devel/pb-modules/lib/ProjectBuilder/Conf.pm
r2402 r2426 29 29 30 30 our @ISA = qw(Exporter); 31 our @EXPORT = qw(pb_conf_init pb_conf_add pb_conf_read pb_conf_read_if pb_conf_write pb_conf_get pb_conf_get_if pb_conf_get_all pb_conf_get_hash pb_conf_cache pb_conf_update_v0 );31 our @EXPORT = qw(pb_conf_init pb_conf_add pb_conf_read pb_conf_read_if pb_conf_write pb_conf_get pb_conf_get_if pb_conf_get_all pb_conf_get_hash pb_conf_cache pb_conf_update_v0 pb_conf_get_in_hash_if); 32 32 ($VERSION,$REVISION,$PBCONFVER) = pb_version_init(); 33 33 -
devel/pb-modules/lib/ProjectBuilder/Distribution.pm
r2410 r2426 69 69 =over 4 70 70 71 =item B<pb_distro_ conffile>72 73 This function returns the mandatory configuration file used for distribution/OS detection71 =item B<pb_distro_api> 72 73 This function returns the mandatory configuration file used for api 74 74 75 75 =cut … … 605 605 606 606 pb_log(3, "INFO: Adding osrepo from config file\n"); 607 return(pb_distro_setuprepo_gen_conf($pbos,pb_distro_conffile(),"osrepo")); 607 my %h; 608 my $h = \%h; 609 # Adds conf file for availability of conf elements either from the local build env or from a VE/VM/RM in which the conf file has been passed 610 $h = pb_conf_cache(pb_distro_conffile(),$h); 611 my ($osrepo) = pb_conf_get_in_hash_if($h,"osrepo"); 612 return(pb_distro_setuprepo_gen($pbos,$osrepo->{$ENV{'PBPROJ'}})); 608 613 } 609 614 610 615 =item B<pb_distro_setuprepo> 611 616 612 This function sets up potential additional repository to the build environment617 This function sets up potential additional repository to the build/install/test environment 613 618 614 619 =cut … … 617 622 618 623 my $pbos = shift; 619 620 pb_log(3, "INFO: Adding addrepo from config file\n"); 621 return(pb_distro_setuprepo_gen_conf($pbos,"$ENV{'PBDESTDIR'}/pbrc.yml","addrepo")); 622 } 623 =item B<pb_distro_setuprepo_gen_conf> 624 625 This function sets up in a generic way potential additional repository using conf files 626 627 =cut 628 629 sub pb_distro_setuprepo_gen_conf { 630 631 my $pbos = shift; 632 my $pbconf = shift; 633 my $pbkey = shift; 634 635 return undef if (not defined $pbconf); 636 return undef if (not defined $pbkey); 637 my ($addrepo) = pb_conf_read($pbconf,$pbkey); 638 return undef if (not defined $addrepo); 639 640 my $param = pb_distro_get_param($pbos,$addrepo); 641 return undef if ($param eq ""); 642 643 pb_log(1, "INFO: Adding repos $param\n"); 644 return(pb_distro_setuprepo_gen($pbos,$param)); 645 } 646 624 my $repotype = shift; 625 626 my %h; 627 my $h = \%h; 628 # Adds conf file for availability of conf elements either from the local build env or from a VE/VM/RM in which the conf file has been passed 629 $h = pb_conf_cache("$ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.yml",$h) if ((defined $ENV{'PBROOTDIR'}) && (-f "$ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.yml")); 630 $h = pb_conf_cache("$ENV{'PBDESTDIR'}/pbrc.yml",$h) if ((defined $ENV{'PBDESTDIR'}) && (-f "$ENV{'PBDESTDIR'}/pbrc.yml")); 631 632 pb_log(3, "INFO: Adding addrepo from config file for $repotype\n"); 633 if ($repotype =~ /install/) { 634 # Give a probable default if nothing is provided to avoid overloading conf files 635 # 636 my ($addrepo) = pb_conf_get_in_hash_if($h,"addinstallrepo"); 637 if ((not defined $addrepo) || (not defined $addrepo->{$ENV{'PBPROJ'}})) { 638 my ($pbrepo) = pb_conf_get_in_hash_if($h,"pbrepo"); 639 return undef if (not defined $pbrepo); 640 my $url = "$pbrepo->{$ENV{'PBPROJ'}}"; 641 my ($testver,$delivery) = pb_conf_get_in_hash_if($h,"testver","delivery"); 642 $delivery->{$ENV{'PBPROJ'}} = "" if (not defined $delivery->{$ENV{'PBPROJ'}}); 643 $url .= "/$delivery->{$ENV{'PBPROJ'}}/"; 644 my $repotag = ""; 645 $repotag = "-$delivery->{$ENV{'PBPROJ'}}" if ($delivery->{$ENV{'PBPROJ'}} ne ""); 646 $url .= "/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'}/$ENV{PBPROJ}$repotag."; 647 my $ext = ""; 648 if ($pbos->{'type'} eq "rpm") { 649 $ext = "repo"; 650 if ($pbos->{'family'} eq "md") { 651 $ext = "addmedia"; 652 } 653 } elsif ($pbos->{'type'} eq "deb") { 654 $ext = ".sources.list"; 655 } 656 $url .= $ext; 657 return(pb_distro_setuprepo_gen($pbos,$url)); 658 } else { 659 my ($addrepo) = pb_conf_get_in_hash_if($h,"addinstallrepo"); 660 return(pb_distro_setuprepo_gen($pbos,$addrepo->{$ENV{'PBPROJ'}})); 661 } 662 } else { 663 my ($addrepo) = pb_conf_get_in_hash_if($h,"add".$repotype."repo"); 664 return(pb_distro_setuprepo_gen($pbos,$addrepo->{$ENV{'PBPROJ'}})); 665 } 666 } 647 667 648 668 =item B<pb_distro_setuprepo_gen>
Note:
See TracChangeset
for help on using the changeset viewer.