[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
https://bugzilla.novell.com/show_bug.cgi?id=818503
https://bugzilla.novell.com/show_bug.cgi?id=818503#c
Michael Andres
https://bugzilla.novell.com/show_bug.cgi?id=818503
https://bugzilla.novell.com/show_bug.cgi?id=818503#c2
Christian Boltz
https://bugzilla.novell.com/show_bug.cgi?id=818503
https://bugzilla.novell.com/show_bug.cgi?id=818503#c3
Thomas Wagner
https://bugzilla.novell.com/show_bug.cgi?id=818503
https://bugzilla.novell.com/show_bug.cgi?id=818503#c4
--- Comment #4 from Michael Andres
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
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
https://bugzilla.novell.com/show_bug.cgi?id=818503
https://bugzilla.novell.com/show_bug.cgi?id=818503#c7
--- Comment #7 from Michael Andres
https://bugzilla.novell.com/show_bug.cgi?id=818503
https://bugzilla.novell.com/show_bug.cgi?id=818503#c8
--- Comment #8 from Thomas Wagner
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
@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