From: "Sven Eden" <sven.eden@gmx.de>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/ufed:master commit in: /
Date: Thu, 14 Feb 2013 08:35:04 +0000 (UTC) [thread overview]
Message-ID: <1360826594.f96cd4148a7b89a426b1f400598cfcdbe1824fb4.yamakuzure@gentoo> (raw)
commit: f96cd4148a7b89a426b1f400598cfcdbe1824fb4
Author: Sven Eden <sven.eden <AT> gmx <DOT> de>
AuthorDate: Thu Feb 14 07:23:14 2013 +0000
Commit: Sven Eden <sven.eden <AT> gmx <DOT> de>
CommitDate: Thu Feb 14 07:23:14 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/ufed.git;a=commit;h=f96cd414
Added a new function to Portage.pm that takes care that a) all flags that have no description but are explicitly set get the description "(Unknown)" and are therefore transported into the interface and b) flags with only local meaning get no global "(Unknown)" entry by accident.
---
Portage.pm | 98 +++++++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 74 insertions(+), 24 deletions(-)
diff --git a/Portage.pm b/Portage.pm
index 685d7f7..0e758bf 100644
--- a/Portage.pm
+++ b/Portage.pm
@@ -88,6 +88,7 @@ sub _determine_eprefix;
sub _determine_make_conf;
sub _determine_profiles;
sub _final_cleaning;
+sub _fix_descriptions;
sub _gen_use_flags;
sub _merge;
sub _merge_env;
@@ -134,6 +135,7 @@ INIT {
_read_archs;
_read_descriptions;
_remove_expands;
+ _fix_descriptions;
_final_cleaning;
_gen_use_flags;
}
@@ -269,23 +271,6 @@ sub _determine_profiles
# No parameters accepted
sub _final_cleaning
{
- # All flags that are specific to explicit versioning have no
- # descriptions yet. This must be enriched from the versionless
- # package setting, or deleted if none are found.
- for my $flag (keys %{$_use_temp}) {
- my $flagRef = $_use_temp->{$flag}; ## Shortcut
- for my $pkg (sort keys %{$flagRef->{"local"}}) {
- next if (length($flagRef->{"local"}{$pkg}{descr}));
-
- if ($pkg =~ /^[<>=~]+([^<>=~].+)-\d+(?:\.\d+)*\w?(?:_(?:alpha|beta|pre|rc|p)\d*)*(?:-r\d+)?$/) {
- defined($flagRef->{"local"}{$1})
- and $flagRef->{"local"}{$pkg}{descr} = $flagRef->{"local"}{$1}{descr}
- or delete($flagRef->{"local"}{$pkg}{descr});
- }
-
- } ## End of looping packages
- } ## End of looping flags
-
# The "disable all" flag is truncated to '*' by the parsing, but it
# has to read '-*'.
_add_temp("-*", "global");
@@ -311,6 +296,68 @@ sub _final_cleaning
}
+# All flags that are specific to explicit versioning have no
+# descriptions yet. This must be enriched from the versionless
+# package setting.
+# Further flags that have no proper description get the
+# string "(Unknown)" as a description
+sub _fix_descriptions
+{
+ for my $flag (keys %{$_use_temp}) {
+ my $flagRef = $_use_temp->{$flag}; ## Shortcut
+ my $globRef = $flagRef->{global} || undef;
+ my $locaRef = $flagRef->{"local"} || undef;
+ my $gDesc = "(Unknown)";
+ my $hasLocal = 0;
+
+ # check global part first
+ if (defined($globRef)) {
+ if (length($globRef->{descr})) {
+ $gDesc = $globRef->{descr};
+ } elsif ( $globRef->{conf}
+ || $globRef->{"default"}
+ || $globRef->{forcded}
+ || $globRef->{masked} ) {
+ ## The flag is definitely set somewhere
+ $globRef->{descr} = $gDesc;
+ }
+ }
+
+ # Now check local part
+ for my $pkg (sort keys %$locaRef) {
+ $hasLocal = 1;
+
+ # No action required if a description is present
+ next if (length($locaRef->{$pkg}{descr}));
+
+ # Otherwise check wether this is worth to be added
+ if ( $locaRef->{$pkg}{installed}
+ || $locaRef->{$pkg}{forced}
+ || $locaRef->{$pkg}{masked}
+ || $locaRef->{$pkg}{"package"}
+ || $locaRef->{$pkg}{pkguse}) {
+ # it is set and/or used by an ebuild
+ if ($pkg =~ /^[<>=~]+([^<>=~].+)-\d+(?:\.\d+)*\w?(?:_(?:alpha|beta|pre|rc|p)\d*)*(?:-r\d+)?$/) {
+ defined($locaRef->{$1})
+ and $locaRef->{$pkg}{descr} = $locaRef->{$1}{descr};
+ }
+ length($locaRef->{$pkg}{descr})
+ or $locaRef->{$pkg}{descr} = $gDesc; ## (Unknown) unless set
+ }
+ } ## End of looping packages
+
+ # Finally remove the global description if it is
+ # (Unknown) with at least one local representation
+ # present.
+ if ($hasLocal && ("(Unknown)" eq $gDesc)) {
+ $globRef->{descr} = "";
+ }
+ } ## End of looping flags
+
+ return;
+}
+
+
# Once $_use_temp is ready, this method builds
# the final $use_flags hashref.
# No parameters accepted
@@ -341,8 +388,11 @@ sub _gen_use_flags
for my $pkg (sort keys %{$flagRef->{"local"}}) {
$pRef = $flagRef->{"local"}{$pkg};
$pdLen = length($pRef->{descr});
- $pDesc = $pdLen ? "$pRef->{descr}" :
- $gdLen ? $gDesc : "(Unknown)";
+
+ # only accept entries with a non-empty description:
+ $pdLen or next;
+
+ $pDesc = $pRef->{descr};
# Now the Key can be assembled...
$pKey = sprintf("[%s]%d:%d:%d:%d:%d:%d:%d", $pDesc, $pRef->{conf}, $pRef->{"default"},
@@ -350,11 +400,11 @@ sub _gen_use_flags
$pRef->{"package"}, $pRef->{pkguse});
# ...and safed, if it has an own description or differs in its settings from global
- if ($pdLen || (0 == $lCount) ## has own description or no global description available
- || $pRef->{"default"} ## explicitly set default from IUSE
- || $pRef->{forced} ## explicitly (un)forced from package.use.force
- || $pRef->{masked} ## explicitly (un)masked from package.use.mask
- || $pRef->{pkguse} ## explicitly (un)set from users package.use
+ if ( ($pdLen && ($gDesc ne $pDesc)) ## has an own description
+ || $pRef->{"default"} ## explicitly set default from IUSE
+ || $pRef->{forced} ## explicitly (un)forced from package.use.force
+ || $pRef->{masked} ## explicitly (un)masked from package.use.mask
+ || $pRef->{pkguse} ## explicitly (un)set from users package.use
) {
$descCons{$pKey}{$pkg} = 1;
++$lCount;
next reply other threads:[~2013-02-14 8:35 UTC|newest]
Thread overview: 238+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-14 8:35 Sven Eden [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-11-07 14:25 [gentoo-commits] proj/ufed:master commit in: / Sven Eden
2020-05-02 8:38 Ulrich Müller
2019-09-27 6:42 Sven Eden
2019-09-27 6:39 Sven Eden
2019-09-24 17:57 Sven Eden
2019-09-24 17:56 Sven Eden
2019-04-07 15:17 David Seifert
2019-04-07 13:56 David Seifert
2019-04-07 13:19 David Seifert
2019-04-07 13:19 David Seifert
2019-04-07 13:19 David Seifert
2019-04-07 13:19 David Seifert
2019-04-07 13:19 David Seifert
2015-02-12 15:47 Sven Eden
2015-02-11 9:03 Sven Eden
2014-11-10 9:59 Sven Eden
2014-10-28 11:43 Sven Eden
2014-02-26 10:26 Sven Eden
2014-02-26 10:26 Sven Eden
2014-02-26 10:26 Sven Eden
2014-02-26 10:26 Sven Eden
2014-02-26 10:26 Sven Eden
2014-02-26 10:26 Sven Eden
2014-02-25 8:18 Sven Eden
2014-02-25 8:18 Sven Eden
2014-02-25 8:18 Sven Eden
2014-02-25 8:18 Sven Eden
2013-11-25 21:43 Sven Eden
2013-11-25 21:43 Sven Eden
2013-11-25 21:43 Sven Eden
2013-11-25 21:43 Sven Eden
2013-11-25 21:43 Sven Eden
2013-09-20 8:30 Sven Eden
2013-09-20 8:30 Sven Eden
2013-09-20 8:30 Sven Eden
2013-09-20 8:30 Sven Eden
2013-09-20 8:30 Sven Eden
2013-09-20 8:30 Sven Eden
2013-09-20 8:30 Sven Eden
2013-09-20 8:30 Sven Eden
2013-09-20 8:30 Sven Eden
2013-09-20 8:30 Sven Eden
2013-09-20 8:30 Sven Eden
2013-09-20 8:30 Sven Eden
2013-09-20 8:30 Sven Eden
2013-09-20 8:30 Sven Eden
2013-09-20 8:30 Sven Eden
2013-09-20 8:30 Sven Eden
2013-09-20 8:30 Sven Eden
2013-09-20 8:30 Sven Eden
2013-09-20 8:30 Sven Eden
2013-09-20 8:30 Sven Eden
2013-09-20 8:30 Sven Eden
2013-09-20 8:30 Sven Eden
2013-09-20 8:30 Sven Eden
2013-09-20 8:30 Sven Eden
2013-09-20 8:30 Sven Eden
2013-09-11 7:09 Sven Eden
2013-09-11 6:31 Sven Eden
2013-09-11 6:04 Sven Eden
2013-09-11 6:04 Sven Eden
2013-09-11 6:04 Sven Eden
2013-09-11 6:04 Sven Eden
2013-09-11 6:04 Sven Eden
2013-09-11 6:04 Sven Eden
2013-09-11 6:04 Sven Eden
2013-09-11 6:04 Sven Eden
2013-09-11 6:04 Sven Eden
2013-09-11 6:04 Sven Eden
2013-09-11 6:04 Sven Eden
2013-09-11 6:04 Sven Eden
2013-09-11 6:04 Sven Eden
2013-09-11 6:04 Sven Eden
2013-09-11 6:04 Sven Eden
2013-09-11 6:04 Sven Eden
2013-09-11 6:04 Sven Eden
2013-09-11 6:04 Sven Eden
2013-09-11 6:04 Sven Eden
2013-09-11 6:04 Sven Eden
2013-09-11 6:04 Sven Eden
2013-09-11 6:04 Sven Eden
2013-09-10 12:37 Sven Eden
2013-09-10 6:36 Sven Eden
2013-09-10 6:36 Sven Eden
2013-09-10 6:36 Sven Eden
2013-09-10 6:36 Sven Eden
2013-09-10 6:36 Sven Eden
2013-09-10 6:36 Sven Eden
2013-09-10 6:36 Sven Eden
2013-07-22 9:34 Sven Eden
2013-07-22 6:09 Sven Eden
2013-07-22 6:09 Sven Eden
2013-04-09 7:22 Sven Eden
2013-04-09 7:22 Sven Eden
2013-04-09 7:22 Sven Eden
2013-04-08 7:18 Sven Eden
2013-04-03 13:39 Sven Eden
2013-03-05 16:53 Sven Eden
2013-03-05 16:49 Sven Eden
2013-03-05 16:49 Sven Eden
2013-03-05 16:49 Sven Eden
2013-03-05 16:49 Sven Eden
2013-03-05 16:49 Sven Eden
2013-02-21 10:02 Sven Eden
2013-02-19 15:16 Sven Eden
2013-02-19 13:34 Sven Eden
2013-02-18 7:22 Sven Eden
2013-02-15 8:36 Sven Eden
2013-02-15 8:36 Sven Eden
2013-02-15 8:36 Sven Eden
2013-02-14 8:35 Sven Eden
2013-02-14 8:35 Sven Eden
2013-02-13 9:23 Sven Eden
2013-02-13 9:23 Sven Eden
2013-02-13 9:23 Sven Eden
2013-02-13 9:23 Sven Eden
2013-02-13 9:23 Sven Eden
2013-02-12 10:51 Sven Eden
2013-02-12 10:51 Sven Eden
2013-02-12 9:01 Sven Eden
2013-02-12 9:01 Sven Eden
2013-02-12 9:01 Sven Eden
2013-02-12 9:01 Sven Eden
2013-02-12 9:01 Sven Eden
2013-02-12 9:01 Sven Eden
2013-02-12 9:01 Sven Eden
2013-02-12 9:01 Sven Eden
2013-02-12 9:01 Sven Eden
2013-02-12 9:01 Sven Eden
2013-02-12 9:01 Sven Eden
2013-02-12 9:01 Sven Eden
2013-02-12 9:01 Sven Eden
2013-02-12 9:01 Sven Eden
2013-02-12 9:01 Sven Eden
2013-02-12 9:01 Sven Eden
2013-02-12 9:01 Sven Eden
2013-02-12 9:01 Sven Eden
2013-02-12 9:01 Sven Eden
2013-02-12 9:01 Sven Eden
2013-02-12 9:01 Sven Eden
2013-02-12 9:01 Sven Eden
2013-02-06 9:09 Sven Eden
2013-02-06 9:09 Sven Eden
2013-02-05 18:06 Paul Varner
2013-02-05 13:53 Sven Eden
2013-02-05 13:53 Sven Eden
2013-02-05 11:24 Sven Eden
2013-02-03 14:32 Sven Eden
2013-02-03 14:32 Sven Eden
2013-02-03 14:32 Sven Eden
2013-02-03 14:32 Sven Eden
2013-02-03 14:32 Sven Eden
2013-02-02 20:49 Sven Eden
2013-02-02 10:11 Sven Eden
2013-02-02 9:47 Sven Eden
2013-02-02 9:47 Sven Eden
2013-02-02 9:47 Sven Eden
2013-02-01 21:12 Sven Eden
2013-02-01 21:12 Sven Eden
2013-02-01 21:12 Sven Eden
2013-02-01 16:04 Sven Eden
2013-02-01 15:55 Sven Eden
2013-02-01 15:26 Sven Eden
2013-02-01 14:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-02-01 10:49 Sven Eden
2013-01-24 10:15 Sven Eden
2013-01-24 10:15 Sven Eden
2013-01-24 10:15 Sven Eden
2013-01-24 10:15 Sven Eden
2013-01-24 10:15 Sven Eden
2013-01-23 14:44 Sven Eden
2013-01-23 12:05 Sven Eden
2013-01-23 12:05 Sven Eden
2013-01-23 12:05 Sven Eden
2013-01-23 12:05 Sven Eden
2013-01-23 12:05 Sven Eden
2013-01-23 12:05 Sven Eden
2013-01-23 12:05 Sven Eden
2013-01-23 12:05 Sven Eden
2013-01-23 12:05 Sven Eden
2013-01-23 12:05 Sven Eden
2013-01-23 12:05 Sven Eden
2013-01-23 12:05 Sven Eden
2013-01-23 12:05 Sven Eden
2013-01-23 12:05 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-19 21:43 Sven Eden
2013-01-16 13:43 Sven Eden
2013-01-16 12:56 Sven Eden
2013-01-16 12:56 Sven Eden
2013-01-16 12:56 Sven Eden
2013-01-16 12:56 Sven Eden
2013-01-16 12:56 Sven Eden
2013-01-16 12:56 Sven Eden
2013-01-08 11:02 Sven Eden
2013-01-02 8:47 Sven Eden
2013-01-02 8:01 Sven Eden
2013-01-02 8:01 Sven Eden
2012-11-20 17:31 Paul Varner
2012-11-20 17:25 Paul Varner
2012-10-23 16:13 Paul Varner
2012-10-23 16:13 Paul Varner
2012-10-23 16:13 Paul Varner
2012-10-23 16:01 Paul Varner
2012-10-22 20:42 Paul Varner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1360826594.f96cd4148a7b89a426b1f400598cfcdbe1824fb4.yamakuzure@gentoo \
--to=sven.eden@gmx.de \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox