From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id D66331381F3 for ; Mon, 8 Apr 2013 07:18:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 66B11E0905; Mon, 8 Apr 2013 07:18:25 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EEA46E0905 for ; Mon, 8 Apr 2013 07:18:24 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 06B3933DD53 for ; Mon, 8 Apr 2013 07:18:24 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 9343EE4073 for ; Mon, 8 Apr 2013 07:18:22 +0000 (UTC) From: "Sven Eden" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sven Eden" Message-ID: <1365405555.bbfb51392ce096916aaba9f419b40aacc17ae6e7.yamakuzure@gentoo> Subject: [gentoo-commits] proj/ufed:master commit in: / X-VCS-Repository: proj/ufed X-VCS-Files: Portage.pm X-VCS-Directories: / X-VCS-Committer: yamakuzure X-VCS-Committer-Name: Sven Eden X-VCS-Revision: bbfb51392ce096916aaba9f419b40aacc17ae6e7 X-VCS-Branch: master Date: Mon, 8 Apr 2013 07:18:22 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 9bd20af2-fa2b-48d6-b4e7-ce533c42630b X-Archives-Hash: d6fdc2d6de4b4f0b90b373c6d766aceb commit: bbfb51392ce096916aaba9f419b40aacc17ae6e7 Author: Sven Eden gmx de> AuthorDate: Mon Apr 8 07:19:15 2013 +0000 Commit: Sven Eden gmx de> CommitDate: Mon Apr 8 07:19:15 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/ufed.git;a=commit;h=bbfb5139 Safe USE_EXPAND_HIDDEN separaterly and merge them into USE_EXPAND if the former has been set to "-*" in make.conf --- Portage.pm | 17 +++++++++++++++++ 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/ ) {