Changeset 2488 in ProjectBuilder
- Timestamp:
- Mar 30, 2020, 8:21:44 PM (5 years ago)
- Location:
- devel
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb-modules/bin/pbgetparam
r2279 r2488 5 5 # $Id$ 6 6 # 7 # Copyright B. Cornec 2007- 20167 # Copyright B. Cornec 2007-today 8 8 # Provided under the GPL v2 9 9 … … 29 29 pb helps you build various packages directly from your project sources. 30 30 pbgetparam is a command from the pb project providing the value of the parameter for the running distribution based on the most precise tuple 31 It is a CLI version of the pb_distro_get _paramfunction31 It is a CLI version of the pb_distro_get function 32 32 33 33 =head1 SYNOPSIS -
devel/pb-modules/etc/pb.yml
r2483 r2488 537 537 # ubuntu: http://archive.ubuntu.com/ubuntu 538 538 # 539 addbuildrepo: 540 centos-8: ftp://ftp.project-builder.org/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'}/powertools.repo 541 rhel-8: ftp://ftp.project-builder.org/centos/8/$pbos->{'arch'}/powertools.repo 539 542 540 543 # … … 690 693 rhel-7: wget,make,ntpdate,patch,perl-Date-Manip,rpm-build,diffutils,perl-Module-Build,perl-YAML 691 694 centos-7: wget,make,ntpdate,patch,perl-Date-Manip,rpm-build,diffutils,perl-Module-Build,perl-ExtUtils-MakeMaker,perl-File-MimeInfo,perl-File-BaseDir,perl-YAML 692 rhel-8: wget,make, ntpdate,patch,perl-Date-Manip,rpm-build,diffutils,perl-Module-Build,perl-ExtUtils-MakeMaker,perl-File-MimeInfo,perl-File-BaseDir,perl-Data-Dumper,perl-YAML693 centos-8: wget,make, ntpdate,patch,perl-Date-Manip,rpm-build,diffutils,perl-Module-Build,perl-ExtUtils-MakeMaker,perl-File-MimeInfo,perl-File-BaseDir,perl-Data-Dumper,perl-YAML695 rhel-8: wget,make,chrony,patch,perl-Date-Manip,rpm-build,diffutils,perl-Module-Build,perl-ExtUtils-MakeMaker,perl-File-MimeInfo,perl-File-BaseDir,perl-Data-Dumper,perl-YAML 696 centos-8: wget,make,chrony,patch,perl-Date-Manip,rpm-build,diffutils,perl-Module-Build,perl-ExtUtils-MakeMaker,perl-File-MimeInfo,perl-File-BaseDir,perl-Data-Dumper,perl-YAML 694 697 redhat: 695 698 suse: wget,make,ntp,patch,diffutils … … 816 819 oscmdntp: 817 820 default: /usr/sbin/ntpdate 821 centos-8: /bin/true 822 rhel-8: /bin/true 823 fedora: /bin/true 818 824 # opensuse-11.0-i386: sntp -P no -r 819 825 # opensuse-11.0-x86_64: sntp -P no -r … … 848 854 mandriva: ftp://ftp.project-builder.org/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'}/pb.addmedia 849 855 deb: ftp://ftp.project-builder.org/$pbos->{'name'}/$pbos->{'version'}/pb.sources.list 856 centos-8: ftp://ftp.project-builder.org/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'}/pb.repo,ftp://ftp.project-builder.org/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'}/powertools.repo 857 rhel-8: ftp://ftp.project-builder.org/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'}/pb.repo,ftp://ftp.project-builder.org/centos/8/$pbos->{'arch'}/powertools.repo 850 858 851 859 # default remote git repo name -
devel/pb-modules/lib/ProjectBuilder/Conf.pm
r2484 r2488 5 5 # which can be easily used by wahtever perl project 6 6 # 7 # Copyright B. Cornec 2007- 20167 # Copyright B. Cornec 2007-today 8 8 # Eric Anderson's changes are (c) Copyright 2012 Hewlett Packard 9 9 # Provided under the GPL v2 … … 409 409 my @ptr = (); 410 410 411 pb_log( 2,"DEBUG: pb_conf_get_in_hash_if on params ".join(' ',@params)."\n");411 pb_log(3,"DEBUG: pb_conf_get_in_hash_if on params ".join(' ',@params)."\n"); 412 412 foreach my $k (@params) { 413 413 push @ptr,$lh->{$k}; 414 414 } 415 415 416 pb_log( 2,"DEBUG: pb_conf_get_in_hash_if returns\n".Dumper(@ptr));416 pb_log(3,"DEBUG: pb_conf_get_in_hash_if returns\n".Dumper(@ptr)); 417 417 return(@ptr); 418 418 } … … 474 474 my $p2; 475 475 476 pb_log( 2,"DEBUG: pb_conf_add_last_in_hash params: ".Dumper(@params)."\n");477 pb_log( 2,"DEBUG: pb_conf_add_last_in_hash current hash: ".Dumper(@h)."\n");478 pb_log( 2,"DEBUG: pb_conf_add_last_in_hash new inputs: ".Dumper(@ptr)."\n");476 pb_log(3,"DEBUG: pb_conf_add_last_in_hash params: ".Dumper(@params)."\n"); 477 pb_log(3,"DEBUG: pb_conf_add_last_in_hash current hash: ".Dumper(@h)."\n"); 478 pb_log(3,"DEBUG: pb_conf_add_last_in_hash new inputs: ".Dumper(@ptr)."\n"); 479 479 480 480 foreach my $i (0..$#params) { -
devel/pb-modules/lib/ProjectBuilder/Distribution.pm
r2468 r2488 3 3 # Creates common environment for distributions 4 4 # 5 # Copyright B. Cornec 2007- 20165 # Copyright B. Cornec 2007-today 6 6 # Eric Anderson's changes are (c) Copyright 2012 Hewlett Packard 7 7 # Provided under the GPL v2 … … 33 33 34 34 our @ISA = qw(Exporter); 35 our @EXPORT = qw(pb_distro_init pb_distro_conffile pb_distro_sysconffile pb_distro_api pb_distro_get pb_distro_get lsb pb_distro_installdeps pb_distro_installpkgs pb_distro_getdeps pb_distro_only_deps_needed pb_distro_setuprepo pb_distro_setuposrepo pb_distro_setuprepo_gen pb_distro_get_parampb_distro_get_context pb_distro_to_keylist pb_distro_conf_print pb_apply_conf_proxy);35 our @EXPORT = qw(pb_distro_init pb_distro_conffile pb_distro_sysconffile pb_distro_api pb_distro_get pb_distro_get_if pb_distro_getlsb pb_distro_installdeps pb_distro_installpkgs pb_distro_getdeps pb_distro_only_deps_needed pb_distro_setuprepo pb_distro_setuposrepo pb_distro_setuprepo_gen pb_distro_get_context pb_distro_to_keylist pb_distro_conf_print pb_apply_conf_proxy); 36 36 ($VERSION,$REVISION,$PBCONFVER) = pb_version_init(); 37 37 … … 63 63 # Return information on the running distro 64 64 # 65 my ($ddir,$dver) = pb_distro_g et();65 my ($ddir,$dver) = pb_distro_guess(); 66 66 67 67 =head1 USAGE … … 159 159 160 160 # If we don't know which distribution we're on, then guess it 161 ($pbos->{'name'},$pbos->{'version'}) = pb_distro_g et() if ((not defined $pbos->{'name'}) || (not defined $pbos->{'version'}));161 ($pbos->{'name'},$pbos->{'version'}) = pb_distro_guess() if ((not defined $pbos->{'name'}) || (not defined $pbos->{'version'})); 162 162 163 163 # For some rare cases, typically nover ones … … 174 174 # Do NOT factorize here, as it won't work as of now for hash creation 175 175 # Do NOT change order without caution 176 $pbos->{'useminor'} = pb_distro_get_param($pbos,pb_conf_get("osuseminorrel")); 177 $pbos->{'family'} = pb_distro_get_param($pbos,pb_conf_get("osfamily")); 178 $pbos->{'type'} = pb_distro_get_param($pbos,pb_conf_get("ostype")); 179 ($pbos->{'os'},$pbos->{'install'},$pbos->{'suffix'},$pbos->{'nover'},$pbos->{'rmdot'},$pbos->{'update'}) = pb_distro_get_param($pbos,pb_conf_get("os","osins","ossuffix","osnover","osremovedotinver","osupd")); 180 ($pbos->{'localinstall'}) = pb_distro_get_param($pbos,pb_conf_get_if("oslocalins")); 181 #($pbos->{'family'},$pbos->{'type'},$pbos->{'os'},$pbos->{'install'},$pbos->{'suffix'},$pbos->{'nover'},$pbos->{'rmdot'},$pbos->{'update'}) = pb_distro_get_param($pbos,pb_conf_get("osfamily","ostype","os","osins","ossuffix","osnover","osremovedotinver","osupd")); 176 $pbos->{'useminor'} = pb_distro_get($pbos,"osuseminorrel"); 177 $pbos->{'family'} = pb_distro_get($pbos,"osfamily"); 178 $pbos->{'type'} = pb_distro_get($pbos,"ostype"); 179 ($pbos->{'os'},$pbos->{'install'},$pbos->{'suffix'},$pbos->{'update'}) = pb_distro_get($pbos,("os","osins","ossuffix","osupd")); 180 ($pbos->{'localinstall'},$pbos->{'nover'},$pbos->{'rmdot'}) = pb_distro_get_if($pbos,"oslocalins","osnover","osremovedotinver"); 182 181 183 182 # Some OS have no interesting version … … 204 203 } 205 204 206 =item B<pb_distro_g et>205 =item B<pb_distro_guess> 207 206 208 207 This function returns a list of 2 parameters indicating the distribution name and version of the underlying Linux distribution. The value of those 2 fields may be "unknown" in case the function was unable to recognize on which distribution it is running. … … 212 211 =cut 213 212 214 sub pb_distro_g et{213 sub pb_distro_guess { 215 214 216 215 # 1: List of files that unambiguously indicates what distro we have … … 360 359 my ($pbos) = @_; 361 360 362 my $ftp_proxy = pb_distro_get_ param($pbos,pb_conf_get_if("ftp_proxy"));363 my $http_proxy = pb_distro_get_ param($pbos,pb_conf_get_if("http_proxy"));364 my $https_proxy = pb_distro_get_ param($pbos,pb_conf_get_if("https_proxy"));361 my $ftp_proxy = pb_distro_get_if($pbos,"ftp_proxy"); 362 my $http_proxy = pb_distro_get_if($pbos,"http_proxy"); 363 my $https_proxy = pb_distro_get_if($pbos,"https_proxy"); 365 364 366 365 # We do not overwrite shell settings … … 626 625 # 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 627 626 $h = pb_conf_cache(pb_distro_conffile(),$h); 628 my ($osrepo) = pb_conf_get_in_hash_if($h,"osrepo");629 my $repo = pb_distro_get_ param($pbos,$osrepo);627 #my $repo = pb_distro_get_param($pbos,$osrepo); 628 my $repo = pb_distro_get_in_hash_if($pbos,$h,"osrepo"); 630 629 return(pb_distro_setuprepo_gen($pbos,$repo)); 631 630 } … … 649 648 $h = pb_conf_cache("$ENV{'PBDESTDIR'}/pbrc.yml",$h) if ((defined $ENV{'PBDESTDIR'}) && (-f "$ENV{'PBDESTDIR'}/pbrc.yml")); 650 649 651 my ($addrepo) = pb_conf_get_in_hash_if($h,"add".$repotype."repo"); 652 my $repo = pb_distro_get_param($pbos,$addrepo); 650 my $repo = pb_distro_get_in_hash_if($pbos,$h,"add".$repotype."repo"); 653 651 # If no repo then set it up as undef so the return value is correct from pb_distro_setuprepo_gen 654 652 $repo = undef if ($repo eq ""); … … 656 654 # Give a probable default if nothing is provided to avoid overloading conf files 657 655 # 658 if ( (not defined $addrepo) || (not defined $repo)) {656 if (not defined $repo) { 659 657 my ($pbrepo) = pb_conf_get_in_hash_if($h,"pbrepo"); 660 658 if (not defined $pbrepo) { … … 870 868 =item B<pb_distro_get_param> 871 869 872 This function gets the parameterin the conf file from the most precise tuple up to default870 This internal function gets the parameters in the conf file from the most precise tuple up to default 873 871 874 872 =cut … … 876 874 sub pb_distro_get_param { 877 875 876 my $pbos = shift; 877 my $var = shift; 878 878 my @param = (); 879 my $pbos = shift; 879 my $i = 0; 880 pb_log(3,"var: ".Dumper($var)); 880 881 881 882 my @keylist = pb_distro_to_keylist($pbos,"default"); 882 pb_log(2,"DEBUG: pb_distro_get_param on $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'} for ".Dumper(@_)."\n"); 883 foreach my $opt (@_) { 884 my $param = ""; 883 pb_log(3,"keylist: ".Dumper(@keylist)); 884 885 my $p = $var->{"ptr"}; 886 foreach my $opt (@$p) { 887 pb_log(3,'opt: '.Dumper($opt)); 888 my $param = undef; 889 my $fkey = undef; 885 890 foreach my $key (@keylist) { 891 pb_log(3,"key: $key\n"); 886 892 if (defined $opt->{$key}) { 887 893 $param = $opt->{$key}; 894 $fkey = $key; 888 895 last; 889 896 } 890 897 } 891 # Allow replacement of variables inside the parameter such as name, version, arch for rpmbootstrap 892 # but not shell variable which are backslashed 893 if ($param =~ /[^\\]\$/) { 894 pb_log(3,"Expanding variable on $param\n"); 895 eval { $param =~ s/(\$\w+->\{\'\w+\'\})/$1/eeg }; 898 my $field = $var->{"val"}; 899 pb_log(3,"field: ".Dumper($field)); 900 $fkey = "default" if (not defined $fkey); 901 pb_log(3,"key: $fkey\n"); 902 pb_log(2,"DEBUG: pb_distro_get_if on $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'} for $field->[$i]".'{'.$fkey.'}'." returns "); 903 if (defined $param) { 904 # Allow replacement of variables inside the parameter such as name, version, arch for rpmbootstrap 905 # but not shell variable which are backslashed 906 if ($param =~ /[^\\]\$/) { 907 pb_log(3,"Expanding variable on $param\n"); 908 eval { $param =~ s/(\$\w+->\{\'\w+\'\})/$1/eeg }; 909 } 910 pb_log(2,"$param\n"); 911 } else { 912 pb_log(2,"undefined\n"); 896 913 } 897 914 push @param,$param; 898 } 899 900 pb_log(2,"DEBUG: pb_distro_get_param on $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'} returns ==".Dumper(@param)."==\n"); 915 $i++; 916 } 901 917 902 918 # Return one param if user only asked for one lookup, an array if not. 903 919 my $nb = @param; 920 pb_log(3,"Param".Dumper(@param)." has $nb members\n"); 904 921 if ($nb eq 1) { 922 pb_log(3,"Retrun Param $param[0]\n"); 905 923 return($param[0]); 906 924 } else { 907 925 return(@param); 908 926 } 927 } 928 929 930 =item B<pb_distro_get_if> 931 932 This function gets the parameters in the conf file from the most precise tuple up to default 933 934 =cut 935 936 sub pb_distro_get_if { 937 938 my $pbos = shift; 939 my @ptr = pb_conf_get_if(@_); 940 my $var; 941 $var->{"ptr"} = \@ptr; 942 $var->{"val"} = \@_; 943 return(pb_distro_get_param($pbos,$var)); 944 } 945 946 =item B<pb_distro_get> 947 948 This function gets the parameters in the conf file from the most precise tuple up to default. 949 Aborts of one param doesn't exist whereas it should 950 951 =cut 952 953 sub pb_distro_get { 954 955 my $pbos = shift; 956 my @param = @_; 957 my @return = pb_distro_get_if($pbos,@param); 958 959 foreach my $i (0..$#param) { 960 confess "No $param[$i] defined for $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}" if (not defined $return[$i]); 961 } 962 my $nb = @return; 963 if ($nb eq 1) { 964 return($return[0]); 965 } else { 966 return(@return); 967 } 968 } 969 970 =item B<pb_distro_get_in_hash_if> 971 972 This function gets the parameters in the conf file passed as hash from the most precise tuple up to default 973 974 =cut 975 976 sub pb_distro_get_in_hash_if { 977 978 my $pbos = shift; 979 my $lh = shift || return(()); 980 981 my @ptr = pb_conf_get_in_hash_if($lh,@_); 982 my $var; 983 $var->{"ptr"} = \@ptr; 984 $var->{"val"} = \@_; 985 return(pb_distro_get_param($pbos,$var)); 986 } 987 988 =item B<pb_distro_get_in_conf_if> 989 990 This function gets the parameters in the conf file passed as name from the most precise tuple up to default 991 992 =cut 993 994 sub pb_distro_get_in_conf_if { 995 996 my $pbos = shift; 997 my $conffile = shift; 998 999 my @ptr = pb_conf_read($conffile,@_); 1000 my $var; 1001 $var->{"ptr"} = \@ptr; 1002 $var->{"val"} = \@_; 1003 return(pb_distro_get_param($pbos,$var)); 909 1004 } 910 1005 … … 962 1057 my $i = 0; 963 1058 # Index on distro 964 foreach my $r (pb_distro_get _param($pbos,pb_conf_get(@keys))) {1059 foreach my $r (pb_distro_get($pbos,@keys)) { 965 1060 $rep{$keys[$i]} = $r if (defined $keys[$i]); 966 1061 $i++; -
devel/pb-modules/lib/ProjectBuilder/VE.pm
r2428 r2488 3 3 # Common functions for virtual environment 4 4 # 5 # Copyright B. Cornec 2007- 20165 # Copyright B. Cornec 2007-today 6 6 # Eric Anderson's changes are (c) Copyright 2012 Hewlett Packard 7 7 # Provided under the GPL v2 … … 119 119 120 120 # We can probably only get those params now we have the distro context 121 my ($ rbsb4pi,$rbspi,$vesnap,$oscodename,$osmindep,$verebuild,$rbsmirrorsrv) = pb_conf_get_if("rbsb4pi","rbspi","vesnap","oscodename","osmindep","verebuild","rbsmirrorsrv");121 my ($vesnap,$verebuild) = pb_conf_get_if("vesnap","verebuild"); 122 122 123 123 if (((((defined $verebuild) && (defined $verebuild->{$ENV{'PBPROJ'}}) && ($verebuild->{$ENV{'PBPROJ'}} =~ /true/i)) || ($pbstep == 0)) && ($vetype ne "docker")) … … 147 147 } 148 148 149 my $postinstall = pb_ve_get_postinstall($pbos,$ rbspi,$verpmstyle);149 my $postinstall = pb_ve_get_postinstall($pbos,$verpmstyle); 150 150 if ($verpmstyle eq "rinse") { 151 151 # Need to reshape the mirrors generated with local before-post-install script 152 152 my $b4post = "--before-post-install "; 153 my $postparam = pb_distro_get_ param($pbos,$rbsb4pi);153 my $postparam = pb_distro_get_if($pbos,"rbsb4pi"); 154 154 if ($postparam eq "") { 155 155 $b4post = ""; … … 161 161 my $addpkgs; 162 162 $postparam = ""; 163 $postparam .= pb_distro_get_ param($pbos,$osmindep);163 $postparam .= pb_distro_get_if($pbos,"osmindep"); 164 164 if ($postparam eq "") { 165 165 $addpkgs = ""; … … 187 187 my $addpkgs = ""; 188 188 my $postparam = ""; 189 $postparam .= pb_distro_get_ param($pbos,$osmindep);189 $postparam .= pb_distro_get_if($pbos,"osmindep"); 190 190 if ($postparam eq "") { 191 191 $addpkgs = ""; … … 208 208 my $vedebstyle = $vedebtype->{$ENV{'PBPROJ'}}; 209 209 210 my $codename = pb_distro_get_ param($pbos,$oscodename);210 my $codename = pb_distro_get_if($pbos,"oscodename"); 211 211 my $postparam = ""; 212 212 my $addpkgs; 213 $postparam .= pb_distro_get_ param($pbos,$osmindep);213 $postparam .= pb_distro_get_if($pbos,"osmindep"); 214 214 if ($postparam eq "") { 215 215 $addpkgs = ""; … … 218 218 } 219 219 my $debmir = ""; 220 $debmir .= pb_distro_get_ param($pbos,$rbsmirrorsrv);220 $debmir .= pb_distro_get_if($pbos,"rbsmirrorsrv"); 221 221 222 222 # Get potential rbs option … … 302 302 # 303 303 # We can probably only get those params now we have the distro context 304 my ($osmindep) = pb_conf_get_if("osmindep"); 305 my $pkgs = pb_distro_get_param($pbos,$osmindep); 304 my $pkgs = pb_distro_get_if($pbos,"osmindep"); 306 305 $pkgs =~ s/,/ /g; 307 306 my $tmpd = "$ENV{'PBTMP'}/Dockerfile"; … … 335 334 336 335 my $pbos = shift; 337 my $rbspi = shift;338 336 my $vestyle = shift; 339 337 my $post = ""; … … 346 344 } 347 345 348 my $postparam = pb_distro_get_ param($pbos,$rbspi);346 my $postparam = pb_distro_get_if($pbos,"rbspi"); 349 347 if ($postparam eq "") { 350 348 $post = ""; -
devel/pb/bin/pb
r2485 r2488 1396 1396 my ($patchcmd,$patchopt); 1397 1397 if ($pbos->{'type'} eq "deb") { 1398 ($patchcmd,$patchopt) = pb_distro_get_ param($pbos,pb_conf_get_if("ospatchcmd","ospatchopt"));1398 ($patchcmd,$patchopt) = pb_distro_get_if($pbos,("ospatchcmd","ospatchopt")); 1399 1399 open(SCRIPT,"> $dest/pbconf/$v/pbpatch/pbapplypatch") || confess "Unable to create $dest/pbconf/$v/pbpatch/pbapplypatch"; 1400 1400 print SCRIPT "#!/bin/bash\n"; … … 2094 2094 2095 2095 # Find the appropriate check cmd/opts 2096 my ($chkcmd,$chkopt) = pb_distro_get_ param($pbos,pb_conf_get_if("oschkcmd","oschkopt"));2096 my ($chkcmd,$chkopt) = pb_distro_get_if($pbos,("oschkcmd","oschkopt")); 2097 2097 2098 2098 my $ret = ""; … … 2329 2329 } 2330 2330 if ($cmt =~ /^(V|R)M/) { 2331 $vtmout = pb_distro_get_ param($pbos,pb_conf_get_if($tmout));2331 $vtmout = pb_distro_get_if($pbos,$tmout); 2332 2332 } 2333 2333 my $remhost = $sshhost->{$ENV{'PBPROJ'}}; … … 2335 2335 if ($cmt =~ /^V[EM]|RM/) { 2336 2336 # In that case our real host is in the xxhost with the OS as key, not project as above 2337 $remhost = pb_distro_get _param($pbos,$sshhost);2337 $remhost = pb_distro_get($pbos,$host); 2338 2338 } 2339 2339 pb_log(2,"ssh: ".Dumper(($remhost,$sshlogin,$remdir,$sshport,$vepath,$rbsconf))."\n"); … … 2393 2393 open(PBS,"> $pbscript{$v}") || confess "Unable to create $pbscript{$v}"; 2394 2394 if ($pbos->{'type'} eq "rpm") { 2395 my $pbsha = pb_distro_get _param($pbos,pb_conf_get("ossha"));2395 my $pbsha = pb_distro_get($pbos,"ossha"); 2396 2396 my ($gpgcheck) = pb_conf_get_if("pbgpgcheck"); 2397 2397 my $pbgpgcheck; … … 2858 2858 if ($cmt =~ /^VE/) { 2859 2859 if ($vetype ne "docker") { 2860 my $sudomode = pb_distro_get _param($pbos,pb_conf_get("ossudoersmode"));2860 my $sudomode = pb_distro_get($pbos,"ossudoersmode"); 2861 2861 my $res = pb_system("$shcmdroot sed -i '/requiretty/d' /etc/sudoers","Removing potential requiretty in sudoers","quiet"); 2862 2862 pb_system("$shcmdroot sed '/requiretty/d' /etc/sudoers > /tmp/sudoers.new ; mv /tmp/sudoers.new $tpdir/tmp/sudoers.new ; $shcmdroot mv /tmp/sudoers.new /etc/sudoers ; $shcmdroot chown root:root /etc/sudoers ; $shcmdroot chmod $sudomode /etc/sudoers","Removing again potential requiretty in sudoers as sed -i failed") if (($res ne 0) && (-f "$tpdir/etc/sudoers")); … … 3053 3053 } 3054 3054 my $hoption = "-p"; 3055 my $hpath = pb_distro_get _param($pbos,pb_conf_get("ospathcmd-halt"));3055 my $hpath = pb_distro_get($pbos,"ospathcmd-halt"); 3056 3056 # Solaris doesn't support -p of halt 3057 3057 if ($pbos->{'type'} eq "pkg") { … … 3211 3211 # Launch the VMs/VEs 3212 3212 if ($vtype eq "vm") { 3213 my ($ptr,$ptr2,$vmpath,$vmport ,$vms) = pb_conf_get("vmtype","vmcmd","vmpath","vmport","vmsize");3214 my ($vmopt,$vm mm,$vmtmout,$vmsnap,$vmbuildtm,$vmmonport) = pb_conf_get_if("vmopt","vmmem","vmtmout","vmsnap","vmbuildtm","vmmonport");3215 my $vmsize = pb_distro_get _param($pbos,$vms);3213 my ($ptr,$ptr2,$vmpath,$vmport) = pb_conf_get("vmtype","vmcmd","vmpath","vmport"); 3214 my ($vmopt,$vmtmout,$vmsnap,$vmbuildtm,$vmmonport) = pb_conf_get_if("vmopt","vmtmout","vmsnap","vmbuildtm","vmmonport"); 3215 my $vmsize = pb_distro_get($pbos,"vmsize"); 3216 3216 3217 3217 my $vmtype = $ptr->{$ENV{'PBPROJ'}}; … … 3236 3236 3237 3237 # How much memory to allocate for VMs 3238 if (defined $vmmm) { 3239 my $vmmem = pb_distro_get_param($pbos,$vmmm); 3240 if (defined $vmmem) { 3241 $ENV{'PBVMOPT'} .= " -m $vmmem"; 3242 } 3238 my $vmmem = pb_distro_get_if($pbos,"vmmem"); 3239 if (defined $vmmem) { 3240 $ENV{'PBVMOPT'} .= " -m $vmmem"; 3243 3241 } 3244 3242 … … 3409 3407 pb_log(2,"ntp server is $vntp\n"); 3410 3408 # ntp command depends on pbos 3411 my $vntpcmd = pb_distro_get _param($pbos,pb_conf_get("oscmdntp"));3409 my $vntpcmd = pb_distro_get($pbos,"oscmdntp"); 3412 3410 $ntpline = "sudo $vntpcmd $vntp"; 3413 3411 } … … 4077 4075 # Try to restrict security to what is really needed 4078 4076 if ($vtype =~ /^vm/) { 4079 my $hpath = pb_distro_get _param($pbos,pb_conf_get("ospathcmd-halt"));4077 my $hpath = pb_distro_get($pbos,"ospathcmd-halt"); 4080 4078 my @sudocmds = pb_get_sudocmds($pbos,$ntpline,"sudo $hpath","sudo /bin/date"); 4081 4079 print SCRIPT << "EOF"; … … 4101 4099 EOF 4102 4100 } 4103 my $sudomode = pb_distro_get _param($pbos,pb_conf_get("ossudoersmode"));4101 my $sudomode = pb_distro_get($pbos,"ossudoersmode"); 4104 4102 print SCRIPT << 'EOF'; 4105 4103 close(PBOUT); … … 4132 4130 4133 4131 EOF 4134 my $itype = pb_distro_get _param($pbos,pb_conf_get("pbinstalltype"));4132 my $itype = pb_distro_get($pbos,"pbinstalltype"); 4135 4133 # Install from sandbox mean a file base install 4136 4134 $itype = "file" if (defined $sbx); 4137 4135 $itype = $installtype if (defined $installtype); 4138 4136 if ($itype =~ /^file/) { 4139 my ($addrepo) = pb_conf_read("$ENV{'PBDESTDIR'}/pbrc.yml","addbuildrepo"); 4140 my $pbrepo = pb_distro_get_param($pbos,$addrepo); 4137 #my ($addrepo) = pb_conf_read("$ENV{'PBDESTDIR'}/pbrc.yml","addbuildrepo"); 4138 #my $pbrepo = pb_distro_get_param($pbos,$addrepo); 4139 my $pbrepo = pb_distro_get_in_conf_if($pbos,"$ENV{'PBDESTDIR'}/pbrc.yml","addbuildrepo"); 4141 4140 print SCRIPT << 'EOF'; 4142 4141 4143 4142 # First install all required packages 4144 my ($ospkgdep) = pb_conf_get_if("ospkgdep"); 4145 my $pkgdep = pb_distro_get_param($pbos,$ospkgdep); 4143 my $pkgdep = pb_distro_get_if($pbos,"ospkgdep"); 4146 4144 my $forcerepo; 4147 4145 EOF … … 4177 4175 print SCRIPT << 'EOF'; 4178 4176 # Then install manually the missing perl modules 4179 my ($osperl dep,$osperlver) = pb_conf_get_if("osperldep","osperlver");4177 my ($osperlver) = pb_conf_get("osperlver"); 4180 4178 4181 my $ perldep = pb_distro_get_param($pbos,$osperldep);4179 my $osperldep = pb_distro_get_if($pbos,"osperldep"); 4182 4180 my $bashopt = ""; 4183 4181 $bashopt = "-x" if ($pbdebug ge 1); 4184 4182 my $verbopt = "mayfail"; 4185 4183 $verbopt = "mayfailverbose" if ($pbdebug ge 1); 4186 foreach my $m (split(/,/,$ perldep)) {4184 foreach my $m (split(/,/,$osperldep)) { 4187 4185 # Skip empty deps 4188 4186 next if ($m =~ /^\s*$/); … … 4202 4200 # pkg based install. We need to point to the project-builder.org repository 4203 4201 print SCRIPT << 'EOF'; 4204 my $pkgforpb = pb_distro_get_ param($pbos,pb_conf_get_if("ospkg"));4202 my $pkgforpb = pb_distro_get_if($pbos,"ospkg"); 4205 4203 my $forcerepo = pb_distro_setuposrepo($pbos); 4206 4204 pb_distro_installpkgs($pbos,pb_distro_only_deps_needed($pbos,join(' ',split(/,/,$pkgforpb)))); -
devel/pb/lib/ProjectBuilder/Changelog.pm
r2287 r2488 6 6 # $Id$ 7 7 # 8 # Copyright B. Cornec 2007- 20168 # Copyright B. Cornec 2007-today 9 9 # Provided under the GPL v2 10 10 … … 74 74 my $log = ""; 75 75 76 pb_log(2,"Entering pb_changelog - pb: ".Dumper($pb)."\n"); 77 pb_log(2,"Entering pb_changelog - doit: $doit\n") if (defined $doit); 78 pb_log(2,"Entering pb_changelog - OUTPUT: $OUTPUT\n") if (defined $OUTPUT); 76 pb_log(3,"Entering pb_changelog - pb: ".Dumper($pb)."\n"); 77 pb_log(3,"Entering pb_changelog - doit: $doit\n") if (defined $doit); 79 78 # For date handling 80 79 $ENV{'LANG'}="C"; … … 214 213 } 215 214 close(INPUT); 216 pb_log( 2,"Exiting pb_changelog\n");215 pb_log(3,"Exiting pb_changelog\n"); 217 216 } 218 217 -
devel/pb/lib/ProjectBuilder/Filter.pm
r2287 r2488 7 7 # $Id$ 8 8 # 9 # Copyright B. Cornec 2007- 20169 # Copyright B. Cornec 2007-today 10 10 # Eric Anderson's changes are (c) Copyright 2012 Hewlett Packard 11 11 # Provided under the GPL v2 … … 216 216 my $i = 0; 217 217 if (defined $pb->{'patches'}->{$tuple}) { 218 my ($patchcmd,$patchopt) = pb_distro_get_ param($pb->{'pbos'},pb_conf_get_if("ospatchcmd","ospatchopt"));218 my ($patchcmd,$patchopt) = pb_distro_get_if($pb->{'pbos'},("ospatchcmd","ospatchopt")); 219 219 foreach my $p (split(/,/,$pb->{'patches'}->{$tuple})) { 220 220 pb_log(3,"DEBUG($tuple) Adding patch command $i ($patchopt)\n"); -
devel/pbmkbm/bin/pbmkbm
r2434 r2488 5 5 # $Id$ 6 6 # 7 # Copyright B. Cornec 2011- 20167 # Copyright B. Cornec 2011-today 8 8 # Provided under the GPL v2 9 9 … … 418 418 419 419 # Create the directory structure needed on the target dir 420 my ($tdirs,$bdirs,$bfiles,$bcmds) = pb_distro_get _param($pbos,pb_conf_get("mkbmtargetdirs","mkbmbootdirs","mkbmbootfiles","mkbmbootcmds"));420 my ($tdirs,$bdirs,$bfiles,$bcmds) = pb_distro_get($pbos,("mkbmtargetdirs","mkbmbootdirs","mkbmbootfiles","mkbmbootcmds")); 421 421 # Create empty dirs for these 422 422 foreach my $d (split(/,/,$tdirs)) { … … 456 456 # and create the links for it in the target VE 457 457 458 my $busycmd = pb_distro_get _param($pbos,pb_conf_get("ospathcmd-busybox"));458 my $busycmd = pb_distro_get($pbos,"ospathcmd-busybox"); 459 459 open(BUSY,"$busycmd |") || (cluck "ERROR: Unable to execute $busycmd" && return); 460 460 my $cmdlist = 0; … … 494 494 495 495 pb_log(1,"Analyzing your keyboard's configuration\n"); 496 my $keyfile = pb_distro_get_param($pbos,pb_conf_get("ospathcmd-keyfile")); 497 confess "ERROR: Unable to read the keyfile $keyfile" if ((not defined $keyfile) || (! -r $keyfile)); 498 my $keymapdir = pb_distro_get_param($pbos,pb_conf_get("ospathcmd-keymapdir")); 499 confess "ERROR: Unable to read the keymapdir $keymapdir" if ((not defined $keymapdir) || (! -d $keymapdir)); 500 my $keymapre = pb_distro_get_param($pbos,pb_conf_get("ospathcmd-keymapre")); 501 confess "ERROR: Unable to read the keymapre $keymapre" if (not defined $keymapre); 496 my $keyfile = pb_distro_get($pbos,"ospathcmd-keyfile"); 497 confess "ERROR: Unable to read the keyfile $keyfile" if (! -r $keyfile); 498 my $keymapdir = pb_distro_get($pbos,"ospathcmd-keymapdir"); 499 confess "ERROR: Unable to read the keymapdir $keymapdir" if (! -d $keymapdir); 500 my $keymapre = pb_distro_get($pbos,"ospathcmd-keymapre"); 502 501 503 502 # if a direct keymap file is given as keyfile, use only the first existing one and return … … 534 533 535 534 pb_log(1,"Analyzing your terminfo's configuration\n"); 536 my $termdir = pb_distro_get _param($pbos,pb_conf_get("ospathcmd-termdir"));537 confess "ERROR: Unable to read the keymapdir $termdir" if ( (not defined $termdir) || (! -d $termdir));535 my $termdir = pb_distro_get($pbos,"ospathcmd-termdir"); 536 confess "ERROR: Unable to read the keymapdir $termdir" if (! -d $termdir); 538 537 $tgtree->{$termdir} = "recurdir"; 539 538 … … 556 555 $kernel->{"release"} = pb_get_osrelease(); 557 556 558 my $kfile = pb_distro_get_ param($pbos,pb_conf_get_if("mkbmkernelfile"));557 my $kfile = pb_distro_get_if($pbos,"mkbmkernelfile"); 559 558 if ((defined $kfile) && ($kfile ne "")) { 560 559 pb_log(1,"INFO: You specified your kernel as $kfile, so using it\n"); 561 560 $kernel->{"file"} = $kfile; 562 561 } else { 563 $kernel->{"dir"} = pb_distro_get _param($pbos,pb_conf_get("mkbmkerneldir"));562 $kernel->{"dir"} = pb_distro_get($pbos,"mkbmkerneldir"); 564 563 confess "ERROR: The mkbmkerneldir content ($kernel->{'dir'}) doesn't refer to a directory\n" if (! -d $kernel->{"dir"}); 565 564 pb_log(1,"INFO: Analyzing directory $kernel->{'dir'} to find your kernel\n"); 566 $kernel->{"namere"} = pb_distro_get _param($pbos,pb_conf_get("mkbmkernelnamere"));565 $kernel->{"namere"} = pb_distro_get($pbos,"mkbmkernelnamere"); 567 566 568 567 # TODO: Look at a better way to find the name of the kernel we run … … 612 611 my $kernel = shift; 613 612 614 my $lsmod = pb_distro_get _param($pbos,pb_conf_get("ospathcmd-lsmod"));615 my $depmod = pb_distro_get _param($pbos,pb_conf_get("ospathcmd-depmod"));613 my $lsmod = pb_distro_get($pbos,"ospathcmd-lsmod"); 614 my $depmod = pb_distro_get($pbos,"ospathcmd-depmod"); 616 615 open(LSMOD,"$lsmod") || confess "ERROR: Unable to read $lsmod: $!"; 617 616 while (<LSMOD>) { … … 655 654 # 656 655 #my ($mkbmcachedir) = pb_conf_get_if("mkbmcachedir"); 657 #my ($pkgs) = pb_distro_get _param($pbos,pb_conf_get("mkbmmindep"));656 #my ($pkgs) = pb_distro_get($pbos,"mkbmmindep"); 658 657 659 658 # -
devel/rpmbootstrap/bin/rpmbootstrap
r2287 r2488 5 5 # $Id$ 6 6 # 7 # Copyright B. Cornec 2010- 20167 # Copyright B. Cornec 2010-today 8 8 # Eric Anderson's changes are (c) Copyright 2012 Hewlett Packard 9 9 # Provided under the GPL v2 … … 269 269 # 270 270 my ($rbscachedir) = pb_conf_get_if("cachedir"); 271 my ($pkgs,$mirror) = pb_distro_get _param($pbos,pb_conf_get("rbsmindep","rbsmirrorsrv"));272 my ($updater) = pb_distro_get_ param($pbos,pb_conf_get_if("rbsmirrorupd"));271 my ($pkgs,$mirror) = pb_distro_get($pbos,("rbsmindep","rbsmirrorsrv")); 272 my ($updater) = pb_distro_get_if($pbos,"rbsmirrorupd"); 273 273 die "No packages defined for $pbos->{name}-$pbos->{version}-$pbos->{arch}" unless $pkgs =~ /\w/; 274 274
Note:
See TracChangeset
for help on using the changeset viewer.