public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sven Eden" <sven.eden@gmx.de>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/ufed:master commit in: /
Date: Fri,  1 Feb 2013 10:49:49 +0000 (UTC)	[thread overview]
Message-ID: <1359554589.ffc687420a76332329082abab9e787f441910091.yamakuzure@gentoo> (raw)

commit:     ffc687420a76332329082abab9e787f441910091
Author:     Sven Eden <sven.eden <AT> gmx <DOT> de>
AuthorDate: Wed Jan 30 14:03:09 2013 +0000
Commit:     Sven Eden <sven.eden <AT> gmx <DOT> de>
CommitDate: Wed Jan 30 14:03:09 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/ufed.git;a=commit;h=ffc68742

Removed obsolete passages and changed the output to include the many more details.

---
 ufed.pl.in |  189 ++++++++++++++++++++++--------------------------------------
 1 files changed, 69 insertions(+), 120 deletions(-)

diff --git a/ufed.pl.in b/ufed.pl.in
index 299c79d..bf09de4 100644
--- a/ufed.pl.in
+++ b/ufed.pl.in
@@ -17,54 +17,14 @@ my $interface = 'ufed-curses';
 #			  . " --read-var-info=yes"
 #              . " XX_libexecdir@/ufed-curses 2>/tmp/ufed_memcheck.log";
 
-# no longer needed
-# my %use_descriptions;
-
 sub finalise;
 sub flags_dialog;
 sub save_flags;
 
-# deprecated, the functionality is merged into Portage.pm
-# delete $Portage::all_flags{'*'};
-# read_use_descs;
-# @use_descriptions{qw(bootstrap build)};
-#
-#$Portage::make_conf_flags{'-*'} = 1
-#	if defined $Portage::make_conf_flags{'*'}
-#		&& !$Portage::make_conf_flags{'*'};
-#
-#for(keys %Portage::all_flags) {
-#	@{$use_descriptions{$_}} = "[(Unknown)] g"
-#		if not exists $use_descriptions{$_};
-#}
-#@{$use_descriptions{'-*'}} = '[Never enable any flags other than those specified in make.conf] g';
-#
-#for(@Portage::archs) {
-#	delete $Portage::default_flags{$_};
-#	delete $Portage::all_flags{$_};
-#	delete $use_descriptions{$_};
-#}
-#for my $flag (keys %Portage::use_masked_flags) {
-#	my $masked = 1;
-#	for my $mask (values %{$Portage::use_masked_flags{$flag}}) {
-#		last if not($masked &&= $mask);
-#	}
-#	if($masked) {
-#		if (defined($use_descriptions{$flag})) {
-#			for (my $i = 0; $i < scalar @{$use_descriptions{$flag}}; ++$i) {
-#				$use_descriptions{$flag}->[$i] =~ s/ [lg]$/ m/ ;
-#				$use_descriptions{$flag}->[$i] =~ s/ L$/ M/ ;
-#			}
-#		} else {
-#			delete $use_descriptions{$flag};
-#			delete $Portage::default_flags{$flag};
-#			delete $Portage::all_flags{$flag};
-#		}
-#	}
-#}
 
 flags_dialog;
 
+
 # Take a list and return it ordered the following way:
 # Put "-*" first, followed by enabling flags and put
 # disabling flags to the end.
@@ -112,49 +72,86 @@ sub flags_dialog {
 	# Write out flags 
 	for my $flag (sort { uc $a cmp uc $b } keys %$Portage::use_flags) {
 		my $conf = $Portage::use_flags->{$flag}; ## Shortcut
-		my $state = "g";
-		$outTxt .= sprintf ("%s %s (%s%s) %d\n", $flag,
+# deprecated: The output is updated to match the new data structure.
+#		my $state = "g";
+#
+#		$outTxt .= sprintf ("%s %s (%s%s) %d\n", $flag,
+#					defined($conf->{global}{conf}) ?
+#						$conf->{global}{conf} > 0 ? 'on' :
+#						$conf->{global}{conf} < 0 ? 'off' : 'def' : 'def',
+#					defined($conf->{global}{"default"}) ?
+#						$conf->{global}{"default"} > 0 ? '+' :
+#						$conf->{global}{"default"} < 0 ? '-' : ' ' : ' ',
+#					defined($conf->{global}{conf}) ?
+#						$conf->{global}{conf} > 0 ? '+' :
+#						$conf->{global}{conf} < 0 ? '-' : ' ' : ' ',
+#					$conf->{count});
+
+		$outTxt .= sprintf ("%s [%s%s] %d\n", $flag,
 					defined($conf->{global}{conf}) ?
-						$conf->{global}{conf} > 0 ? 'on' :
-						$conf->{global}{conf} < 0 ? 'off' : 'def' : 'def',
+						$conf->{global}{conf} > 0 ? '+' :
+						$conf->{global}{conf} < 0 ? '-' : ' ' : ' ',
 					defined($conf->{global}{"default"}) ?
 						$conf->{global}{"default"} > 0 ? '+' :
 						$conf->{global}{"default"} < 0 ? '-' : ' ' : ' ',
-					defined($conf->{global}{conf}) ?
-						$conf->{global}{conf} > 0 ? '+' :
-						$conf->{global}{conf} < 0 ? '-' : ' ' : ' ',
 					$conf->{count});
 
-		# Print global description first (if available)
+#		# Print global description first (if available)
 		if (defined($conf->{global}) && length($conf->{global}{descr})) {
-			if ($conf->{global}{installed}) {
-				$conf->{global}{masked} and $state = "M";
-				$conf->{global}{masked} or  $state = "G";
-			} else {
-				$conf->{global}{masked} and $state = "m";
-			}
-			$outTxt .= "[" . $conf->{global}{descr} . "] $state\n";
-	
-			# Then print the list of affected packages that have no own entry
+# deprecated: The output is updated to match the new data structure.
+#			if ($conf->{global}{installed}) {
+#				$conf->{global}{masked} and $state = "M";
+#				$conf->{global}{masked} or  $state = "G";
+#			} else {
+#				$conf->{global}{masked} and $state = "m";
+#			}
+#			$outTxt .= "[" . $conf->{global}{descr} . "] $state\n";
+# *  @param[in] state '+','-',' ' for global, installed, forced, masked, package - in that order.
+			$outTxt .= sprintf("\t%s\t ( ) [+%s%s%s ]\n",
+						$conf->{global}{descr},
+						$conf->{global}{installed} ? '+' : ' ',
+						$conf->{global}{forced} ? '+' : ' ',
+						$conf->{global}{masked} ? '+' : ' ');
+							
+# deprecated: The output is updated to match the new data structure.
+#			# Then print the list of affected packages that have no own entry
+#			for my $afLst (@{$conf->{global}{affected}}) {
+#				(defined($afLst) && length($afLst))
+#					and $outTxt .= "($afLst) [Affected by global flag setting] $state\n";
+#			}
 			for my $afLst (@{$conf->{global}{affected}}) {
 				(defined($afLst) && length($afLst))
-					and $outTxt .= "($afLst) [Affected by global flag setting] $state\n";
+					and $outTxt .= sprintf("\t%s\t (%s) [+    ]\n",
+									"Affected by global flag setting",
+									$afLst);
 			}
 		}
-				
+
 		# Finally print the local description lines
 		for my $pkg (sort keys %{$conf->{"local"}}) {
-			$state = "l";
-			if ($conf->{"local"}{$pkg}{installed}) {
-				$state = "L";
-				if ($conf->{global}{masked}) {
-					$conf->{"local"}{$pkg}{masked} > -1 and $state = "M";
-					$conf->{"local"}{$pkg}{masked} <  0 and $state = "L";
-				}
-			} elsif ($conf->{global}{masked}) {
-					$conf->{"local"}{$pkg}{masked} > -1 and $state = "m";
-			}
-			$outTxt .= sprintf("(%s) [%s] %s\n", $pkg, $conf->{"local"}{$pkg}{descr}, $state);
+# deprecated: The output is updated to match the new data structure.
+#			$state = "l";
+#			if ($conf->{"local"}{$pkg}{installed}) {
+#				$state = "L";
+#				if ($conf->{global}{masked}) {
+#					$conf->{"local"}{$pkg}{masked} > -1 and $state = "M";
+#					$conf->{"local"}{$pkg}{masked} <  0 and $state = "L";
+#				}
+#			} elsif ($conf->{global}{masked}) {
+#					$conf->{"local"}{$pkg}{masked} > -1 and $state = "m";
+#			}
+#			$outTxt .= sprintf("(%s) [%s] %s\n", $pkg, $conf->{"local"}{$pkg}{descr}, $state);
+			$outTxt .= sprintf("\t%s\t (%s) [ %s%s%s%s]\n",
+						$conf->{"local"}{$pkg}{descr},
+						$pkg,
+						$conf->{"local"}{$pkg}{installed} > 0 ? '+' :
+						$conf->{"local"}{$pkg}{installed} < 0 ? '-' : ' ',
+						$conf->{"local"}{$pkg}{forced}    > 0 ? '+' :
+						$conf->{"local"}{$pkg}{forced}    < 0 ? '-' : ' ',
+						$conf->{"local"}{$pkg}{masked}    > 0 ? '+' :
+						$conf->{"local"}{$pkg}{masked}    < 0 ? '-' : ' ',
+						$conf->{"local"}{$pkg}{"package"} > 0 ? '+' :
+						$conf->{"local"}{$pkg}{"package"} < 0 ? '-' : ' ');
 		}
 	}
 
@@ -162,7 +159,7 @@ sub flags_dialog {
 	# use descriptions. They cause problems unless the whole
 	# interface is changed to use wchar. Substitute with ISO:
 	$outTxt =~ tr/\x{2014}\x{201c}\x{201d}/\x2d\x22\x22/ ;
-	
+
 	# Now let the interface know of the result
 	if (open my $fh, '>&=', $iwrite) {
 		binmode( $fh, ":encoding(ISO-8859-1)" );
@@ -190,54 +187,6 @@ sub flags_dialog {
 	return;
 }
 
-# Deprecated, the funcionality is merged into Portage.pm.
-#
-## Build the global %use_descriptions hash.
-## Parsed files are:
-## 1. PORTDIR/profiles/use.desc
-## 2. PORTDIR/profiles/use.local.desc
-## No parameters accepted.
-## @todo : The local descriptions must be written in a different
-##         way (how?) to allow the wanted filtering/distinction
-##         between global/local flags.
-#sub read_use_descs {
-#	my %_use_descriptions;
-#	for my $dir(@Portage::portagedirs) {
-#		for(Portage::noncomments "$dir/profiles/use.desc") {
-#			my ($flag, $desc) = /^(.*?)\s+-\s+(.*)$/ or next;
-#			$_use_descriptions{$flag}{$desc} = 1;
-#		}
-#	}
-#	my %_use_local_descriptions;
-#	for my $dir(@Portage::portagedirs) {
-#		for(Portage::noncomments "$dir/profiles/use.local.desc") {
-#			my ($pkg, $flag, $desc) = /^(.*?):(.*?)\s+-\s+(.*)$/ or next;
-#			$_use_local_descriptions{$flag}{$desc}{$pkg} = 1;
-#		}
-#	}
-#	# Record all global flags first, their description is printed first
-#	# in the ncurses interface as well.
-#	for my $key (sort keys %_use_descriptions) {
-#		for my $desc (sort keys %{$_use_descriptions{$key}}) {
-#			push @{$use_descriptions{$key}}, "[" . $desc . "] g";
-#		}
-#	}
-#
-#	# Add local flags
-#	for my $key (sort keys %_use_local_descriptions) {
-#		for my $desc (sort keys %{$_use_local_descriptions{$key}}) {
-#			my $flagPrefix = "l";
-#			my @pkgs = ();
-#			for my $pkg (sort keys %{$_use_local_descriptions{$key}{$desc}}) {
-#				$flagPrefix = "L" if (Portage::have_package($pkg));
-#				push @pkgs, $pkg;
-#			}
-#			local $"=", ";
-#			push @{$use_descriptions{$key}}, sprintf("(%s) [%s] %s", "@pkgs", $desc, $flagPrefix);
-#		}
-#	}
-#	return;
-#}
 
 # Write given list of flags back to make.conf if
 # the file has not been changed since reading it.


             reply	other threads:[~2013-02-01 10:49 UTC|newest]

Thread overview: 238+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-01 10:49 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-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-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=1359554589.ffc687420a76332329082abab9e787f441910091.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