summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Varner <fuzzyray@gentoo.org>2012-10-23 11:12:40 -0500
committerPaul Varner <fuzzyray@gentoo.org>2012-10-23 11:12:40 -0500
commita6fa7fa7cb9ba8427cf9f7929d8a1340e9d62257 (patch)
treeec6d076830934d783951efffe4662b70dd015676
parentPatch for /etc/{,portage}/make.profile. (Bug 434672) (diff)
downloadufed-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.in10
1 files changed, 6 insertions, 4 deletions
diff --git a/ufed.pl.in b/ufed.pl.in
index 06d5642..7493147 100644
--- a/ufed.pl.in
+++ b/ufed.pl.in
@@ -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;
}