Changeset 3644 in MondoRescue for branches/3.3/MondoRescue/lib/MondoRescue
- Timestamp:
- Jan 3, 2017, 2:04:51 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/MondoRescue/lib/MondoRescue/Base.pm
r3219 r3644 61 61 my $msg = shift || ""; 62 62 63 pb_log_init($pbdebug );63 pb_log_init($pbdebug, $pbLOG); 64 64 65 65 if (defined $msg) { … … 67 67 } 68 68 69 # Temp dir 70 pb_temp_init($pbdebug); 69 71 70 72 my $pbproj; … … 72 74 ($mr->{'confdir'},$pbproj) = mr_dynconf_init(); 73 75 74 # Temp dir75 pb_ temp_init();76 # First setup the PBPRJ env var 77 pb_conf_init($pbproj); 76 78 77 # First use the main configuration file78 pb_conf_init($pbproj);79 $ENV{'PBPROJ'} = $pbproj;80 79 # 81 80 # Conf files Management … … 141 140 pb_log(2,"Entering mr_conf_get\n"); 142 141 my @args1 = pb_conf_get_if(@params); 142 my @args2 = (); 143 143 my $proj = $ENV{'PBPROJ'}; 144 $ENV{'PBPROJ'} = $ENV{'PBPKG'}; 145 my @args2 = pb_conf_get_if(@params); 144 if (defined $ENV{'PBPKG'}) { 145 $ENV{'PBPROJ'} = $ENV{'PBPKG'}; 146 @args2 = pb_conf_get_if(@params); 147 $ENV{'PBPROJ'} = $proj; 148 } 146 149 foreach my $i (0..$#args1) { 147 150 $ptr = undef; 148 151 # Process from least important to more important 149 $ptr = $args1[$i]->{'default'}; 150 $ptr[$i] = $ptr if (defined $ptr); 151 $ptr = $args1[$i]->{$ENV{'PBPROJ'}}; 152 $ptr[$i] = $ptr if (defined $ptr); 153 $ptr = $args2[$i]->{$ENV{'PBPKG'}}; 154 $ptr[$i] = $ptr if (defined $ptr); 152 if (defined $args1[$i]->{'default'}) { 153 $ptr[$i] = $args1[$i]->{'default'}; 154 } 155 if (defined $args1[$i]->{$ENV{'PBPROJ'}}) { 156 $ptr[$i] = $args1[$i]->{$ENV{'PBPROJ'}}; 157 } 158 if ((defined $ENV{'PBPKG'}) and (defined $args2[$i]) and (defined $args2[$i]->{$ENV{'PBPKG'}})) { 159 $ptr[$i] = $args2[$i]->{$ENV{'PBPKG'}}; 160 } 155 161 $ptr[$i] = "Undefined" if (not defined $ptr[$i]); 156 162 pb_log(2,"Found parameter $params[$i] with value $ptr[$i]\n"); 157 163 } 158 $ENV{'PBPROJ'} = $proj;159 164 return(@ptr); 160 165 }
Note:
See TracChangeset
for help on using the changeset viewer.