1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-11 13:01:28 +02:00

43990: _opkg: Support gain-privileges

This commit is contained in:
dana 2019-01-18 01:45:27 -06:00
parent 88ad890c05
commit 96a7993801
2 changed files with 14 additions and 4 deletions

View file

@ -1,3 +1,7 @@
2018-01-18 dana <dana@dana.is>
* 43990: Completion/Linux/Command/_opkg: Support gain-privileges
2019-01-08 Peter Stephenson <p.stephenson@samsung.com> 2019-01-08 Peter Stephenson <p.stephenson@samsung.com>
* users/23829: Completion/Unix/Type/_path_files, * users/23829: Completion/Unix/Type/_path_files,

View file

@ -35,6 +35,10 @@
# % zstyle ':completion:*:opkg:*' conf-paths <pattern> ... # % zstyle ':completion:*:opkg:*' conf-paths <pattern> ...
# Set to one or more paths or glob patterns to override the defaults used when # Set to one or more paths or glob patterns to override the defaults used when
# searching opkg configuration data. # searching opkg configuration data.
#
# Elevated privileges may be necessary to complete package names, etc.; consider
# setting the gain-privileges style as follows:
# zstyle ':completion:*:(ipkg|opkg)/*' gain-privileges yes
## ##
# Check cache validity. # Check cache validity.
@ -105,7 +109,7 @@ _opkg_arch_prio() {
} }
# Already configured arches # Already configured arches
tmp=( ${(f)"$( _call_program architectures $svc print-architecture )"} ) tmp=( ${(f)"$( _call_program -p architectures $svc print-architecture )"} )
tmp=( ${${tmp##arch[ ]##}%% *} ) tmp=( ${${tmp##arch[ ]##}%% *} )
tmp+=( tmp+=(
@ -182,7 +186,9 @@ _opkg_pkg_all() {
{ (( ! $#_opkg_cache_pkg_all )) || _cache_invalid opkg-pkg-all } && { (( ! $#_opkg_cache_pkg_all )) || _cache_invalid opkg-pkg-all } &&
! _retrieve_cache opkg-pkg-all && { ! _retrieve_cache opkg-pkg-all && {
_opkg_cache_pkg_all=( ${(f)"$( _call_program pkg-all ${svc:-opkg} list )"} ) _opkg_cache_pkg_all=( ${(f)"$(
_call_program -p pkg-all ${svc:-opkg} list )"}
)
_opkg_cache_pkg_all=( ${(@)_opkg_cache_pkg_all##[[:space:]]*} ) _opkg_cache_pkg_all=( ${(@)_opkg_cache_pkg_all##[[:space:]]*} )
_opkg_cache_pkg_all=( ${(@)_opkg_cache_pkg_all%%[[:space:]]*} ) _opkg_cache_pkg_all=( ${(@)_opkg_cache_pkg_all%%[[:space:]]*} )
_store_cache opkg-pkg-all _opkg_cache_pkg_all _store_cache opkg-pkg-all _opkg_cache_pkg_all
@ -207,7 +213,7 @@ _opkg_pkg_inst() {
{ (( ! $#_opkg_cache_pkg_inst )) || _cache_invalid opkg-pkg-inst } && { (( ! $#_opkg_cache_pkg_inst )) || _cache_invalid opkg-pkg-inst } &&
! _retrieve_cache opkg-pkg-inst && { ! _retrieve_cache opkg-pkg-inst && {
_opkg_cache_pkg_inst=( ${(f)"$( _opkg_cache_pkg_inst=( ${(f)"$(
_call_program pkg-inst ${svc:-opkg} list-installed _call_program -p pkg-inst ${svc:-opkg} list-installed
)"} ) )"} )
_opkg_cache_pkg_inst=( ${(@)_opkg_cache_pkg_inst##[[:space:]]*} ) _opkg_cache_pkg_inst=( ${(@)_opkg_cache_pkg_inst##[[:space:]]*} )
_opkg_cache_pkg_inst=( ${(@)_opkg_cache_pkg_inst%%[[:space:]]*} ) _opkg_cache_pkg_inst=( ${(@)_opkg_cache_pkg_inst%%[[:space:]]*} )
@ -257,7 +263,7 @@ _opkg_pkg_upgr() {
{ (( ! $#_opkg_cache_pkg_upgr )) || _cache_invalid opkg-pkg-upgr } && { (( ! $#_opkg_cache_pkg_upgr )) || _cache_invalid opkg-pkg-upgr } &&
! _retrieve_cache opkg-pkg-upgr && { ! _retrieve_cache opkg-pkg-upgr && {
_opkg_cache_pkg_upgr=( ${(f)"$( _opkg_cache_pkg_upgr=( ${(f)"$(
_call_program pkg-upgr ${svc:-opkg} list-upgradable _call_program -p pkg-upgr ${svc:-opkg} list-upgradable
)"} ) )"} )
_opkg_cache_pkg_upgr=( ${(@)_opkg_cache_pkg_upgr##[[:space:]]*} ) _opkg_cache_pkg_upgr=( ${(@)_opkg_cache_pkg_upgr##[[:space:]]*} )
_opkg_cache_pkg_upgr=( ${(@)_opkg_cache_pkg_upgr%%[[:space:]]*} ) _opkg_cache_pkg_upgr=( ${(@)_opkg_cache_pkg_upgr%%[[:space:]]*} )