Lines 17-22
Link Here
|
17 |
sub read_use_descs(); |
17 |
sub read_use_descs(); |
18 |
sub save_flags(@); |
18 |
sub save_flags(@); |
19 |
|
19 |
|
|
|
20 |
# Quit early if there is no valid make.conf found by Portage.pm |
21 |
die "Could not determine the location of your make.conf.\n" |
22 |
unless (defined($Portage::make_conf_path) |
23 |
&& length($Portage::make_conf_path)); |
24 |
|
20 |
delete $Portage::all_flags{'*'}; |
25 |
delete $Portage::all_flags{'*'}; |
21 |
|
26 |
|
22 |
read_use_descs; |
27 |
read_use_descs; |
Lines 25-30
Link Here
|
25 |
|
30 |
|
26 |
$Portage::make_conf_flags{'-*'} = 1 if defined $Portage::make_conf_flags{'*'} && !$Portage::make_conf_flags{'*'}; |
31 |
$Portage::make_conf_flags{'-*'} = 1 if defined $Portage::make_conf_flags{'*'} && !$Portage::make_conf_flags{'*'}; |
27 |
|
32 |
|
|
|
33 |
|
28 |
for(keys %Portage::all_flags) { |
34 |
for(keys %Portage::all_flags) { |
29 |
@{$use_descriptions{$_}} = "(Unknown)" |
35 |
@{$use_descriptions{$_}} = "(Unknown)" |
30 |
if not exists $use_descriptions{$_}; |
36 |
if not exists $use_descriptions{$_}; |
Lines 155-164
Link Here
|
155 |
|
161 |
|
156 |
my (@flags) = @_; |
162 |
my (@flags) = @_; |
157 |
my $contents; |
163 |
my $contents; |
|
|
164 |
my $mcFile = $Portage::make_conf_path; |
158 |
|
165 |
|
159 |
{ |
166 |
{ |
160 |
open my $makeconf, '<', '/etc/make.conf' or die "Couldn't open /etc/make.conf\n"; |
167 |
open my $makeconf, '<', $mcFile or die "Couldn't open $mcFile\nReason: $!\n"; |
161 |
open my $makeconfold, '>', '/etc/make.conf.old' or die "Couldn't open /etc/make.conf.old\n"; |
168 |
open my $makeconfold, '>', "${mcFile}.old" or die "Couldn't open ${mcFile}.old\nReason: $!\n"; |
162 |
local $/; |
169 |
local $/; |
163 |
$_ = <$makeconf>; |
170 |
$_ = <$makeconf>; |
164 |
print $makeconfold $_; |
171 |
print $makeconfold $_; |
Lines 293-303
Link Here
|
293 |
die "Parse error when writing make.conf - did you modify it while ufed was running?\n" if $@; |
300 |
die "Parse error when writing make.conf - did you modify it while ufed was running?\n" if $@; |
294 |
|
301 |
|
295 |
print STDERR <<EOF if $sourcing; |
302 |
print STDERR <<EOF if $sourcing; |
296 |
Warning: source command found in /etc/make.conf. Flags may |
303 |
Warning: source command found in ${mcFile}. Flags may |
297 |
be saved incorrectly if the sourced file modifies them. |
304 |
be saved incorrectly if the sourced file modifies them. |
298 |
EOF |
305 |
EOF |
299 |
{ |
306 |
{ |
300 |
open my $makeconf, '>', '/etc/make.conf' or die "Couldn't open /etc/make.conf\n"; |
307 |
open my $makeconf, '>', $mcFile or die "Couldn't open $mcFile\nReason: $!\n"; |
301 |
print $makeconf $_; |
308 |
print $makeconf $_; |
302 |
close $makeconf; |
309 |
close $makeconf; |
303 |
} |
310 |
} |