[Bug 818503] New: Zypper cannot auto-complete package names.
https://bugzilla.novell.com/show_bug.cgi?id=818503 https://bugzilla.novell.com/show_bug.cgi?id=818503#c0 Summary: Zypper cannot auto-complete package names. Classification: openSUSE Product: openSUSE 12.2 Version: Final Platform: i686 OS/Version: openSUSE 12.2 Status: NEW Severity: Enhancement Priority: P5 - None Component: Other AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: kete@ninthfloor.org QAContact: qa-bugs@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.34 (KHTML, like Gecko) rekonq Safari/534.34 When I press Tab a couple times to complete package names, Zypper or the shell does not complete the name or make suggestions. Reproducible: Always Steps to Reproduce: 1. Open a shell. 2. Type a zypper command followed by a few letters of a package name. 3. Press Tab twice. Actual Results: No changes Expected Results: Suggest names or complete the package name if the typed letters are unique enough. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=818503 https://bugzilla.novell.com/show_bug.cgi?id=818503#c FeiXiang Zhang <fxzhang@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |zypp-maintainers@forge.prov | |o.novell.com AssignedTo|bnc-team-screening@forge.pr |poeml@cmdline.net |ovo.novell.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=818503 https://bugzilla.novell.com/show_bug.cgi?id=818503#c Michael Andres <ma@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - None |P2 - High -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=818503 https://bugzilla.novell.com/show_bug.cgi?id=818503#c2 Christian Boltz <suse-beta@cboltz.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |suse-beta@cboltz.de --- Comment #2 from Christian Boltz <suse-beta@cboltz.de> 2013-05-11 20:11:10 CEST --- Hint: for "zypper up" and "zypper rm", the completion used for rpm (probably in the bash-completion package) could be recycled. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=818503 https://bugzilla.novell.com/show_bug.cgi?id=818503#c3 Thomas Wagner <wagner-thomas@gmx.at> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wagner-thomas@gmx.at Component|libzypp |libzypp Platform|i686 |All Product|openSUSE 12.2 |openSUSE 13.1 Target Milestone|--- |Final OS/Version|openSUSE 12.2 |openSUSE 13.1 --- Comment #3 from Thomas Wagner <wagner-thomas@gmx.at> 2014-07-10 11:48:17 UTC --- This feature (which would be really nice) is still missing in openSUSE 13.1. So I'll update this feature request to 13.1. Hint: /var/cache/zypp/raw/* contains gzipped xml/sqlite files which probably already contain the needed list of available packages. So we "just" need a parser. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=818503 https://bugzilla.novell.com/show_bug.cgi?id=818503#c4 --- Comment #4 from Michael Andres <ma@suse.com> 2014-07-10 15:12:41 CEST --- (In reply to comment #3)
Hint: /var/cache/zypp/raw/* contains gzipped xml/sqlite files which probably already contain the needed list of available packages. So we "just" need a parser.
No. /var/cache/zypp/raw/ contains all the raw metadata for all (even disabled) repos. And you don't want to fiddle with all the supported repo formats and thair parsers. Upon refresh zypp will parse the repos and build solv caches in /var/cache/zypp/solv. At least a common format for all repos, e.g. installed: dumpsolv /var/cache/zypp/solv/\@System/solv but you'd still need to filter out the disabled repos. --- What about: zypper -x --no-refresh se for package names zypper -x --no-refresh se -s for package names, version, and arch zypper+XML is probably too slow..... Maybe a small zypper-complete binary taking a stem and writing the possible completions to stdout. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=818503 https://bugzilla.novell.com/show_bug.cgi?id=818503#c5 --- Comment #5 from Thomas Wagner <wagner-thomas@gmx.at> 2014-07-10 14:05:00 UTC ---
zypper+XML is probably too slow..... Just did a test and XML-dump zypper's packages. It takes approx 2 second (28550 available packages on my Xeon L5506 @ 2.13GHz)
time zypper -x --no-refresh se > /dev/null real 0m2.218s user 0m1.971s sys 0m0.159s Extracting package names with grep increases duration by about 0.4 sec. # time zypper -x --no-refresh se | grep -o -P '(?<=name\=\").*(?=\" summary)' > /dev/null real 0m2.565s user 0m2.450s sys 0m0.156s And even it's slow on the first try, it's better having it slow than not having it at all. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=818503 https://bugzilla.novell.com/show_bug.cgi?id=818503#c6 --- Comment #6 from Heinz Haderer <ha_heinz@yahoo.de> 2014-07-10 14:24:52 UTC --- Maybe it is an option to use the search algorithm already included in zypper. For example zypper -x --no-refresh se ema* -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=818503 https://bugzilla.novell.com/show_bug.cgi?id=818503#c7 --- Comment #7 from Michael Andres <ma@suse.com> 2014-07-10 17:53:10 CEST --- If you're using a recent libzypp, the `zypp-NameReqPrv` command might already be available on your systems. It's a quick hack we use when investigating solver testcases. But it has little overhead and it basically does what we need: Usage: NameReqPrv [--root ROOTDIR] [OPTIONS] NAME... [[OPTIONS] NAME...]... Load all enabled repositories (no refresh) and search for occurrences of NAME (regex) in package names, provides or requires. --root Load repos from the system located below ROOTDIR. If ROOTDIR denotes a sover testcase, the testcase is loaded. --installed Process installed packages only. -i/-I turn on/off case insensitive search (default on) -n/-N turn on/off looking for names (default on) -p/-P turn on/off looking for provides (default off) -r/-R turn on/off looking for requires (default off) -c/-C turn on/off looking for conflicts (default off) -o/-O turn on/off looking for obsoletes (default off) -m/-M turn on/off looking for recommends (default off) -s/-S turn on/off looking for supplements (default off) -a short for -n -p -r -A short for -n -P -R -D <pkg> dump dependencies of <pkg> It supports --root and --installed (up/rm); per default searches case insensitive for package names matching a regexp and prints the result in a pretty ugly format. zypp-NameReqPrv '^zypp' The 270 lines of code could easily serve as template for a zypp-complete command, producing more suitable output. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=818503 https://bugzilla.novell.com/show_bug.cgi?id=818503#c8 --- Comment #8 from Thomas Wagner <wagner-thomas@gmx.at> 2014-07-12 18:51:02 UTC --- (In reply to comment #6)
Maybe it is an option to use the search algorithm already included in zypper.
For example zypper -x --no-refresh se ema* Great idea. I tried this and it's IMHO sufficiently fast.
@Micheal: I created a pull-request in the official zypper repo at github. I wonder if you want to review and merge it. (In reply to comment #7)
If you're using a recent libzypp, the `zypp-NameReqPrv` command might already be available on your systems. I also tried this one and its indeed much faster than a "zypper se". However, at the moment I lack of sufficient understanding of libzypp to rewrite zypp-NameReqPrv to a zypp-complete.
-- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=818503 https://bugzilla.novell.com/show_bug.cgi?id=818503#c9 --- Comment #9 from Michael Andres <ma@suse.com> 2014-07-14 09:04:04 CEST --- (In reply to comment #8)
@Micheal: I created a pull-request in the official zypper repo at github. I wonder if you want to review and merge it.
Great. I'll have a look at it.
at the moment I lack of sufficient understanding of libzypp to rewrite zypp-NameReqPrv to a zypp-complete.
I'll take that part. I don't know in depth how the bash completion works, but with your patch I'll be able to provide a dedicated command to speed up the cases. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com