add bash completion for install+remove+update commands (bnc#928650) #66

Merged
merged 3 commits into from Jun 3, 2015

Conversation

Projects
None yet
2 participants
@bmwiedemann

This comment has been minimized.

Show comment
Hide comment
@bmwiedemann

bmwiedemann May 6, 2015

Member

After a discussion, we concluded that it would be best, if libzypp or repo2solv could produce a per-repo cache file after a refresh. The cache file would contain such lines:

bash<tab>4.2-75.3.1<tab>x86_64
bash-doc<tab>4.2-75.3.1<tab>noarch
rpm<tab>4.11.3-12.1<tab>x86_64
Member

bmwiedemann commented May 6, 2015

After a discussion, we concluded that it would be best, if libzypp or repo2solv could produce a per-repo cache file after a refresh. The cache file would contain such lines:

bash<tab>4.2-75.3.1<tab>x86_64
bash-doc<tab>4.2-75.3.1<tab>noarch
rpm<tab>4.11.3-12.1<tab>x86_64
@mlandres

This comment has been minimized.

Show comment
Hide comment
@mlandres

mlandres May 6, 2015

Member

Can we include {patch,pattern,product}-info commands to provide a result similar to #50?

Member

mlandres commented May 6, 2015

Can we include {patch,pattern,product}-info commands to provide a result similar to #50?

@bmwiedemann

This comment has been minimized.

Show comment
Hide comment
@bmwiedemann

bmwiedemann May 6, 2015

Member

added those 3

Member

bmwiedemann commented May 6, 2015

added those 3

@mlandres

This comment has been minimized.

Show comment
Hide comment
@mlandres

mlandres May 13, 2015

Member

libzypp-15.1.3 (available in obs://zypp:HEAD) supports writing solv.idx files to speed up completion.

Member

mlandres commented May 13, 2015

libzypp-15.1.3 (available in obs://zypp:HEAD) supports writing solv.idx files to speed up completion.

src/bash-completion.sh
+ # where no idx files have been created by libzypp yet
+ # TODO: drop in 2019
+ set +o noglob
+ if echo $idx | grep -q -F '*' ; then

This comment has been minimized.

@bmwiedemann

bmwiedemann May 15, 2015

Member

This part seems to be a bit fragile as there might have been zypper ref calls before the first completion. Also only works for root user.

@bmwiedemann

bmwiedemann May 15, 2015

Member

This part seems to be a bit fragile as there might have been zypper ref calls before the first completion. Also only works for root user.

This comment has been minimized.

@mlandres

mlandres May 15, 2015

Member

You can't silently remove the solv files.
Existing solv files may belong to volatile media (CD/DVD/USB), so you'd enforce zypper asking to insert the media again. I can try to create missing idx files in zypp even if the solv file is up-to-date.

@mlandres

mlandres May 15, 2015

Member

You can't silently remove the solv files.
Existing solv files may belong to volatile media (CD/DVD/USB), so you'd enforce zypper asking to insert the media again. I can try to create missing idx files in zypp even if the solv file is up-to-date.

@bmwiedemann

This comment has been minimized.

Show comment
Hide comment
@bmwiedemann

bmwiedemann May 24, 2015

Member

Updated the code to not have any ugly workarounds anymore. IMHO it is ready to be merged.

Member

bmwiedemann commented May 24, 2015

Updated the code to not have any ugly workarounds anymore. IMHO it is ready to be merged.

bmwiedemann added some commits Apr 26, 2015

completion: speed up handling of args
in case we know that someone wants to complete something
that starts with "-"
we dont need to spend time expanding other options

and if it does not start with "-"
we dont need to query zypper for its options
completion: dont reset CMDLIST
this speeds up the 2nd completion
by not having to query zypper again
completion: support for install+remove+update commands (bnc#928650)
https://bugzilla.opensuse.org/show_bug.cgi?id=928650

+handle source-install and info

for fast access this uses solv.idx files created by recent libzypp versions

mlandres added a commit that referenced this pull request Jun 3, 2015

Merge pull request #66 from bmwiedemann/master
add bash completion for install+remove+update commands (bnc#928650)

@mlandres mlandres merged commit 52a9c69 into openSUSE:master Jun 3, 2015

mlandres added a commit that referenced this pull request Jun 3, 2015

@Sam0523 Sam0523 referenced this pull request in fish-shell/fish-shell Mar 30, 2016

Closed

__fish_print_packages: use libzypp builtin cache for zypper #2870

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment