summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Eden <sven.eden@gmx.de>2013-04-08 09:19:15 +0200
committerSven Eden <sven.eden@gmx.de>2013-04-08 09:19:15 +0200
commitbbfb51392ce096916aaba9f419b40aacc17ae6e7 (patch)
tree76f9b5566e6325641cd5cb79959d52615afccadf
parentUse pkg-config to check for ncurses. this should fix bug #464328 (diff)
downloadufed-bbfb51392ce096916aaba9f419b40aacc17ae6e7.tar.gz
ufed-bbfb51392ce096916aaba9f419b40aacc17ae6e7.tar.bz2
ufed-bbfb51392ce096916aaba9f419b40aacc17ae6e7.zip
Safe USE_EXPAND_HIDDEN separaterly and merge them into USE_EXPAND if the former has been set to "-*" in make.conf
-rw-r--r--Portage.pm17
1 files changed, 17 insertions, 0 deletions
diff --git a/Portage.pm b/Portage.pm
index 97ba400..ecf39ca 100644
--- a/Portage.pm
+++ b/Portage.pm
@@ -49,6 +49,7 @@ our $used_make_conf = "";
my %_environment = ();
my $_EPREFIX = "";
my @_profiles = ();
+my %_use_eh_safe = (); ## USE_EXPAND_HIDDEN safe hash. See _read_make_defaults()
my %_use_order = ();
# $_use_temp - hashref that represents the current state of
@@ -664,6 +665,12 @@ sub _read_make_defaults {
and $_use_temp->{$flag}{global}{"default"} = 1
or $_use_temp->{$flag}{global}{"default"} = -1;
}
+
+ # Safe USE_EXPAND_HIDDEN if set. This is done because a user might
+ # set it to "-*" in make.conf, which does not disable flags but only
+ # the hidden status making them visible.
+ _merge(\%_use_eh_safe, $env{USE_EXPAND_HIDDEN})
+ if (defined($env{USE_EXPAND_HIDDEN}));
}
} ## End of reading make.defaults
@@ -944,11 +951,21 @@ sub _read_use_mask {
#
# Note2: It might be a good idea to leave this function and just reduce it to kill
# USE_EXPAND_HIDDEN flags, as they must not be seen anyway.
+#
+# Note3: It can happen, that a user sets USE_EXPAND_HIDDEN to "-*" - which then moves
+# all entries to MOVE_EXPAND making them visible.
sub _remove_expands {
my $expands = $_environment{USE_EXPAND} || {};
my $hidden = $_environment{USE_EXPAND_HIDDEN} || {};
+ # If USE_EXPAND_HIDDEN is set to "-*", the safed flags have to be merged
+ # into USE_EXPAND
+ if (defined($hidden->{"*"})) {
+ _merge($expands, \%_use_eh_safe);
+ $hidden = {};
+ }
+
for my $key (map {my $x=lc($_)."_"; $x } keys %$expands) {
for my $flag (keys %$_use_temp) {
if ($flag =~ /^$key/ ) {