summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2013-09-09 15:45:25 +0200
committerSven Eden <yamakuzure@gmx.net>2013-09-09 15:45:25 +0200
commitddbb4ba7b3cadc9dd1f237fa79da058fdc201e2b (patch)
tree0a9f8874a194a8fae792ad09c3029c4525cbd09a
parentIf the determined make.conf is not writable by the effective uid/gid, a warni... (diff)
downloadufed-ddbb4ba7b3cadc9dd1f237fa79da058fdc201e2b.tar.gz
ufed-ddbb4ba7b3cadc9dd1f237fa79da058fdc201e2b.tar.bz2
ufed-ddbb4ba7b3cadc9dd1f237fa79da058fdc201e2b.zip
ufed no longer tries to write out use flags if the new $Portage::ro_mode is not set to 0.
-rw-r--r--ufed.pl.in6
1 files changed, 3 insertions, 3 deletions
diff --git a/ufed.pl.in b/ufed.pl.in
index 5f10a22..a922109 100644
--- a/ufed.pl.in
+++ b/ufed.pl.in
@@ -128,12 +128,12 @@ sub flags_dialog {
wait;
if(POSIX::WIFEXITED($?)) {
my $rc = POSIX::WEXITSTATUS($?);
- if($rc==0) {
+ if( (0 == $rc) && (0 == $Portage::ro_mode) ) {
open my $fh, '<&=', $oread or die "Couldn't read output.\n";
my @flags = grep { $_ ne '--*' } do { local $/; split /\n/, <$fh> };
close $fh;
save_flags finalise @flags;
- } elsif($rc==1) {
+ } elsif( 1 == $rc ) {
print "Cancelled, not saving changes.\n";
}
exit $rc;
@@ -169,7 +169,7 @@ sub save_flags {
my $makeconf_name = $Portage::used_make_conf;
{
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";
+ open my $makeconfold, '>', $makeconf_name . '~' or die "Couldn't open ${makeconf_name}~\n";
local $/;
$_ = <$makeconf>;
print $makeconfold $_;