Add support for an --alphabetical option to emerge that restores the old
authorJason Stubbs <jstubbs@gentoo.org>
Fri, 27 Jan 2006 04:51:23 +0000 (04:51 -0000)
committerJason Stubbs <jstubbs@gentoo.org>
Fri, 27 Jan 2006 04:51:23 +0000 (04:51 -0000)
ordering of flags in --pretend output.

svn path=/main/trunk/; revision=2589

bin/emerge
man/emerge.1
pym/emergehelp.py

index a41b372a999506008ccdddcfb84aa84b9a9a1afb..eba9a3d193fd7285466ece960bc7508838589a81 100755 (executable)
@@ -170,7 +170,7 @@ actions=[
 "sync",  "system", "unmerge",  "world",
 ]
 options=[
-"--ask",
+"--ask",          "--alphabetical",
 "--buildpkg",     "--buildpkgonly",
 "--changelog",    "--columns", "--cols",
 "--debug",        "--deep",
@@ -1496,9 +1496,13 @@ class depgraph:
                        def create_use_string(*args):
                                return ""
                else:
-                       def create_use_string(name, cur_iuse, cur_use, old_iuse, old_use, is_new, all_flags=("--verbose" in myopts)):
+                       def create_use_string(name, cur_iuse, cur_use, old_iuse, old_use, is_new,
+                                       all_flags=("--verbose" in myopts), alphabetical=("--alphabetical" in myopts)):
                                enabled = []
-                               disabled = []
+                               if alphabetical:
+                                       disabled = enabled
+                               else:
+                                       disabled = []
                                for flag in cur_iuse:
                                        if flag in cur_use:
                                                if is_new or flag in old_use and all_flags:
@@ -1516,7 +1520,10 @@ class depgraph:
                                                        disabled.append(green("-"+flag)+"*")
 
                                enabled = " ".join(enabled)
-                               disabled = " ".join(disabled)
+                               if alphabetical:
+                                       disabled = ""
+                               else:
+                                       disabled = " ".join(disabled)
                                if enabled and disabled:
                                        ret = enabled + " " + disabled
                                elif enabled:
index 1a2554a1bf0fe0b4f5904995ba9e9acbb87185e8..0b39ff9263b4686e7dcbfa77a1ff47ca8851c3a5 100644 (file)
@@ -202,6 +202,10 @@ emerge  process  has completed.  This usually entails configuration
 file setup or other similar setups that the user  may  wish to run.
 .SH "OPTIONS"
 .TP
+.BR "\-\-alphabetical "
+When displaying USE and other flag output, combines the enabled and
+disabled lists into one list and sorts the whole list alphabetically.
+.TP
 .BR "\-\-ask " (\fB\-a\fR)
 Before performing the merge, display what ebuilds and tbz2s will be installed, 
 in the same format as when using \fB\-\-pretend\fR; then ask whether to 
index 19b30a6c594e6a91ef18fbd7c33b89b365157f7b..9a80de50d24f66748fad48d1d8c472d791e4b11c 100644 (file)
@@ -119,6 +119,12 @@ def help(myaction,myopts,havecolor=1):
                print "              file setup or other similar setups that the user  may  wish to run."
                print
                print turquoise("Options:")
+               print "       "+green("--alphabetical")
+               print "              When displaying USE and other flag output, combines the enabled and"
+               print "              disabled lists into one list and sorts the whole list"
+               print "              alphabetically.  With this option, output such as USE=\"dar -bar"
+               print "              -foo\" will instead be displayed as USE=\"-bar dar -foo\""
+               print
                print "       "+green("--ask")+" ("+green("-a")+" short option)"
                print "              before performing the merge, display what ebuilds and tbz2s will"
                print "              be installed, in the same format as when using --pretend; then"