Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 38269 Details for
Bug 61889
[PATCH] add ability to interactively resolve package name abiguities when --ask option is specified
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to emerge to interactively resolve short name ambiguities
ambigchoice.diff (text/plain), 2.72 KB, created by
slapcat
on 2004-08-26 23:27:28 UTC
(
hide
)
Description:
patch to emerge to interactively resolve short name ambiguities
Filename:
MIME Type:
Creator:
slapcat
Created:
2004-08-26 23:27:28 UTC
Size:
2.72 KB
patch
obsolete
>--- /usr/bin/emerge 2004-08-26 23:07:15.000000000 -0700 >+++ /root/emerge 2004-08-26 23:02:10.801371432 -0700 >@@ -21,6 +21,47 @@ > else: > return os.path.normpath(mystr) > >+def getch(): >+ """Gets a single character from standard input. Does not echo to the >+ screen.""" >+ try: >+ import msvcrt >+ char = msvcrt.getch() >+ except ImportError: >+ import sys, tty, termios >+ fd = sys.stdin.fileno() >+ old_settings = termios.tcgetattr(fd) >+ try: >+ tty.setraw(sys.stdin.fileno()) >+ char = sys.stdin.read(1) >+ finally: >+ termios.tcsetattr(fd, termios.TCSADRAIN, old_settings) >+ return char >+ >+ >+def userchoice(choices): >+ """Displays a prompt and a set of responses, then waits for a response >+ which is checked against the responses and the first to match is >+ returned. >+ >+ choice: a List of Strings. >+ choice_color: a Function taking and returning a String >+ >+ Returns the number of the response.""" >+ for i in range(1, len(choices) + 1) : >+ print green("\t[" + `i` + "] ") + red(choices[i - 1]) >+ >+ while 1: >+ choice = getch() >+ try: >+ choice = int(choice) >+ except ValueError: >+ continue >+ if choice > len(choices) : >+ continue >+ >+ return choice - 1 >+ > def userquery(prompt, responses=None, colours=None): > """Displays a prompt and a set of responses, then waits for a response > which is checked against the responses and the first to match is >@@ -873,12 +914,17 @@ > try: > mykey=portage.dep_expand(x,portage.portdb) > except ValueError, errpkgs: >- print "\n\n!!! The short ebuild name \"" + x + "\" is ambiguous. Please specify" >- print "!!! one of the following fully-qualified ebuild names instead:\n" >- for i in errpkgs[0]: >- print " " + green(i) >- print >- sys.exit(1) >+ print "\n!!! The short ebuild name \"" + x + "\" is ambiguous. Please specify" >+ print "!!! one of the following fully-qualified ebuild names instead:\n" >+ if "--ask" in myopts: >+ choice = userchoice(errpkgs[0]) >+ mykey = errpkgs[0][choice] >+ print >+ else : >+ for i in errpkgs[0]: >+ print " " + green(i) >+ print >+ sys.exit(1) > > # select needs to return 0 on dep_check failure >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 61889
: 38269 |
38270