diff options
author | Paul Varner <fuzzyray@gentoo.org> | 2012-10-23 11:12:40 -0500 |
---|---|---|
committer | Paul Varner <fuzzyray@gentoo.org> | 2012-10-23 11:12:40 -0500 |
commit | a6fa7fa7cb9ba8427cf9f7929d8a1340e9d62257 (patch) | |
tree | ec6d076830934d783951efffe4662b70dd015676 | |
parent | Patch for /etc/{,portage}/make.profile. (Bug 434672) (diff) | |
download | ufed-a6fa7fa7cb9ba8427cf9f7929d8a1340e9d62257.tar.gz ufed-a6fa7fa7cb9ba8427cf9f7929d8a1340e9d62257.tar.bz2 ufed-a6fa7fa7cb9ba8427cf9f7929d8a1340e9d62257.zip |
Write into correct make.conf. (Bug 434672)ufed-0.40.2
Patch supplied by Martin Väth
-rw-r--r-- | ufed.pl.in | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -155,9 +155,11 @@ sub save_flags(@) { my (@flags) = @_; my $contents; + my $makeconf_name = '/etc/portage/make.conf'; + $makeconf_name = '/etc/make.conf' unless(-r $makeconf_name); { - open my $makeconf, '<', '/etc/make.conf' or die "Couldn't open /etc/make.conf\n"; - open my $makeconfold, '>', '/etc/make.conf.old' or die "Couldn't open /etc/make.conf.old\n"; + open my $makeconf, '<', $makeconf_name or die "Couldn't open $makeconf_name\n"; + open my $makeconfold, '>', $makeconf_name . '.old' or die "Couldn't open $makeconf_name.old\n"; local $/; $_ = <$makeconf>; print $makeconfold $_; @@ -292,11 +294,11 @@ sub save_flags(@) { die "Parse error when writing make.conf - did you modify it while ufed was running?\n" if $@; print STDERR <<EOF if $sourcing; -Warning: source command found in /etc/make.conf. Flags may +Warning: source command found in $makeconf_name. Flags may be saved incorrectly if the sourced file modifies them. EOF { - open my $makeconf, '>', '/etc/make.conf' or die "Couldn't open /etc/make.conf\n"; + open my $makeconf, '>', $makeconf_name or die "Couldn't open $makeconf_name\n"; print $makeconf $_; close $makeconf; } |