* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2020-02-19 18:51 Vadim Misbakh-Soloviov
0 siblings, 0 replies; 52+ messages in thread
From: Vadim Misbakh-Soloviov @ 2020-02-19 18:51 UTC (permalink / raw
To: gentoo-commits
commit: 8a1dcc8e862e1ca00fec39f921bcd2d9cf55c0e7
Author: Felix Neumärker <xdch47 <AT> posteo <DOT> de>
AuthorDate: Wed Feb 19 16:44:18 2020 +0000
Commit: Vadim Misbakh-Soloviov <mva <AT> gentoo <DOT> org>
CommitDate: Wed Feb 19 18:50:56 2020 +0000
URL: https://gitweb.gentoo.org/proj/zsh-completion.git/commit/?id=8a1dcc8e
Merge PR #22 (eselect fixes)
[PATCH 1/6] _eselect: php-module completion
[PATCH 2/6] _eselect: generic uses _describe instead of values
[PATCH 3/6] _ekeyword: inital completion
[PATCH 4/6] _eselect: news modules - fix order
[PATCH 5/6] _eselect: completion for rc module / rc-config
[PATCH 6/6] _eselect: repository fixes + options
Signed-off-by: Felix Neumärker <xdch47 <AT> posteo.de>
Signed-off-by: Vadim Misbakh-Soloviov <mva <AT> gentoo.org>
src/_ekeyword | 23 +++++++++
src/_eselect | 161 ++++++++++++++++++++++++++++++++++++++++++----------------
2 files changed, 139 insertions(+), 45 deletions(-)
diff --git a/src/_ekeyword b/src/_ekeyword
new file mode 100644
index 0000000..c86ebb0
--- /dev/null
+++ b/src/_ekeyword
@@ -0,0 +1,23 @@
+#compdef ekeyword
+
+local -a arguments=(
+ '(- :)'{-h,--help}'[Show this help message and exit]'
+ '(-m --manifest)'{-m,--manifest}'[Run `ebuild manifest` on the ebuild after modifying it]'
+ '(-n --dry-run)'{-n,--dry-run}'[Show what would be changed, but do not commit]'
+ '(-v --verbose)'{-v,--verbose}'[Be verbose while processing things]'
+ '(-q --quiet)'{-q,--quiet}'[Be quiet while processing things (only show errors)]'
+ '(--format)'--format':Select output format for showing differences:_values -V ekeywordsfmt "ekeywords formats" auto color-inline inline short-multi long-multi'
+ '(- :)'{-V,--version}'[Show version information]'
+)
+
+(( $+functions[_ekeywordargs] )) || _ekeywordargs() {
+ _files -g \*.ebuild
+
+ local -a keywords=(all $(_gentoo_arches))
+
+ compset -P '(\^|\~)'
+ _values -V "keywords" "gentoo arches" ${keywords[@]}
+}
+
+_arguments ${arguments[@]} "*:ekeywordargs:_ekeywordargs"
+
diff --git a/src/_eselect b/src/_eselect
index 77b9fd6..ce185a8 100644
--- a/src/_eselect
+++ b/src/_eselect
@@ -45,25 +45,24 @@ _eselect_parse_generic() {
}
_eselect_parse_action_list() {
- local eselect_list
- local idx descr
- local arr_items_selected=$2
- local arr_items_unselected=$3
-
- eselect_list="$(LANG=C COLUMNS=100 eselect --colour=no $1 list 2> /dev/null)"
- while IFS="" read -r ele ; do
- echo "$ele" | read idx descr
- idx=${idx#*\[}
- idx=${idx%\]*}
- if [[ "$idx" =~ '^[0-9]+$' ]]; then
- local stripped_descr="${descr% *\**}"
- if [[ "${stripped_descr}" != "${descr}" ]] ; then
- set -A $arr_items_selected ${(P)arr_items_selected} "$idx:${(q)descr}"
- else
- set -A $arr_items_unselected ${(P)arr_items_unselected} "$idx:${(q)descr}"
- fi
+ local idx item tag
+ local -a _sel_items
+ local -a _unsel_items
+
+ while read idx item tag descr ; do
+ if [[ "$idx" == '[' && "$item" == ']' ]] ; then
+ continue
+ fi
+ if [[ ${tag} =~ '^[*@#]$' ]] ; then
+ _sel_items+=($item)
+ else
+ _unsel_items+=($item)
fi
- done <<< "$eselect_list"
+ done <<< $(LANG=C COLUMNS=100 eselect --colour=no $1 list 2> /dev/null | tail -n +2)
+
+ set -A $2 ${_sel_items[@]}
+ set -A $3 ${_unsel_items[@]}
+
}
_eselect_module_action() {
@@ -78,9 +77,15 @@ _eselect_complete_action() {
local actionname=$(_eselect_get_module)
if (( $+functions[_eselect_complete_${actionname}_action] )) ; then
_eselect_complete_${actionname}_action
- else
+ return 0
+ fi
+
+ if (( $NORMARG + $(_eselect_action_index) == $CURRENT )) ; then
_eselect_complete_action_generic ${actionname}
+ return 0
fi
+
+ _nothing
}
_eselect_get_module() {
@@ -110,31 +115,29 @@ _eselect_module() {
_eselect_parse_generic
}
-_eselect_complete_action_generic() {
+(( $+function[_eselect_complete_action_generic] )) || _eselect_complete_action_generic() {
local -a sel_items
local -a unsel_items
- if (( $NORMARG + $(_eselect_action_index) == $CURRENT )) ; then
- case "$(_eselect_get_action)" in
- ("set"|"enable"))
- _eselect_parse_action_list $1 sel_items unsel_items
- if (( $#unsel_items + $#sel_items > 0 )) ; then
- _describe -t eselect_sel -V 'eselect items' unsel_items
- if (( $#unsel_items + $#sel_items < 10 )) ; then
- _describe -t eselect_unsel -V 'eselect already selected items' sel_items
- fi
- return 0
- fi
- ;;
- ("remove"|"disable"))
- _eselect_parse_action_list $1 sel_items unsel_items
- if [[ -n "${sel_items[@]}" ]] ; then
- _describe -V 'eselect items' sel_items
- return 0
+ case "$(_eselect_get_action)" in
+ ("set"|"enable"))
+ _eselect_parse_action_list $1 sel_items unsel_items
+ if (( $#unsel_items + $#sel_items > 0 )) ; then
+ _describe -t eselect_sel -V 'eselect items' unsel_items
+ if (( $#unsel_items + $#sel_items < 10 )) ; then
+ _describe -t eselect_unsel -V 'eselect already selected items' sel_items
fi
- ;;
- esac
- fi
+ return 0
+ fi
+ ;;
+ ("remove"|"disable"))
+ _eselect_parse_action_list $1 sel_items unsel_items
+ if [[ -n "${sel_items[@]}" ]] ; then
+ _describe -V 'eselect items' sel_items
+ return 0
+ fi
+ ;;
+ esac
_nothing
}
@@ -145,15 +148,19 @@ _eselect_complete_action_generic() {
case "$(_eselect_get_action)" in
("read"|"unread"))
- local -a extra_items=('all:Read all news items')
+ local idx descr
+ while read idx descr ; do
+ idx=${idx#'['}
+ idx=${idx%']'}
+ items=(${idx}:${(q)descr} ${items[@]})
+ done <<< $(eselect --colour=no news list 2> /dev/null | tail -n +2)
+ items+=('all:Read all news items')
if [[ $(_eselect_get_action) == "read" ]] ; then
- extra_items=('new:Read unread news items (default)' "${extra_items[@]}")
+ items+=('new:Read unread news items (default)')
fi
- _eselect_parse_action_list news items items
- items=(${(q)extra_items[@]} ${(Oa)items})
if [[ -n "${items[@]}" ]] ; then
- _describe -V 'eselect items' items
+ _describe -V 'eselect news' items
return 0
fi
;;
@@ -207,6 +214,70 @@ _eselect_complete_action_generic() {
_nothing
}
+(( $+functions[_eselect_complete_php_action] )) || _eselect_complete_php_action() {
+ if (( $NORMARG + $(_eselect_action_index) == $CURRENT )) ; then
+ case "$(_eselect_get_action)" in
+ ("list"|"set"|"show"|"update"))
+ _values 'eselect php modules' $(eselect --colour=no --brief php list-modules)
+ return 0
+ ;;
+ esac
+ elif (( $NORMARG + $(_eselect_action_index) + 1 == $CURRENT )) ; then
+ case "$words[$CURRENT-2]" in
+ "set")
+ local targets=($(eselect --colour=no --brief php list "$words[$CURRENT-1]" 2> /dev/null))
+ if [ -n "$targets" ]; then
+ _values 'eselect php modules' ${targets[@]}
+ return 0
+ fi
+ ;;
+ esac
+ fi
+
+ _nothing
+}
+
+(( $+functions[_eselect_complete_rc_action] )) || _eselect_complete_rc_action() {
+ if (( $NORMARG + $(_eselect_action_index) == $CURRENT )) ; then
+ case "$(_eselect_get_action)" in
+ ("list"|"show"))
+ _values 'runlevels' $(command ls --color=never ${EPREFIX}/etc/runlevels)
+ return 0
+ ;;
+ ("add"|"delete"|"pause"|"reload"|"restart"|"start"|"stop"))
+ _values 'scripts' $(rc-service -l)
+ return 0
+ ;;
+ esac
+ elif (( $NORMARG + $(_eselect_action_index) + 1 == $CURRENT )) ; then
+ case "$words[$CURRENT-2]" in
+ ("add"|"delete"))
+ _values 'runlevels' $(command ls --color=never ${EPREFIX}/etc/runlevels)
+ return 0
+ ;;
+ esac
+ fi
+
+ _nothing
+}
+
+
+(( $+functions[_eselect_complete_repository_action] )) || _eselect_complete_repository_action() {
+ local -a opts
+
+ case "$(_eselect_get_action)" in
+ ("disable"|"remove"))
+ opts=('-f:Force potentially dangerous removals')
+ ;;
+ "list")
+ opts=('-i:Only list installed')
+ ;;
+ esac
+
+ _describe -o 'options' opts
+ _eselect_complete_action_generic repository
+}
+
eselect_comp() {
integer NORMARG
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2023-01-17 14:45 Vadim Misbakh-Soloviov
0 siblings, 0 replies; 52+ messages in thread
From: Vadim Misbakh-Soloviov @ 2023-01-17 14:45 UTC (permalink / raw
To: gentoo-commits
commit: 3afaba3c7f939d84a128b232d9d58431bc44c91a
Author: Gabriel Sanches <gabriel <AT> gsr <DOT> dev>
AuthorDate: Sun Jan 1 16:37:02 2023 +0000
Commit: Vadim Misbakh-Soloviov <mva <AT> gentoo <DOT> org>
CommitDate: Tue Jan 17 14:45:26 2023 +0000
URL: https://gitweb.gentoo.org/proj/zsh-completion.git/commit/?id=3afaba3c
Replace 'upgradeonly' with 'changed-use'
Signed-off-by: Gabriel Sanches <gabriel <AT> gsr.dev>
Signed-off-by: Vadim Misbakh-Soloviov <mva <AT> gentoo.org>
src/_portage | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/src/_portage b/src/_portage
index 1eba6fb..23e88fc 100644
--- a/src/_portage
+++ b/src/_portage
@@ -93,9 +93,9 @@ _emerge () {
)
all=(
- $bopts -l --changelog --columns --deep -D --emptytree -e --newuse
+ $bopts -l --changelog --columns --deep -D --emptytree -e --newuse -N
--noconfmem --nodeps -O --noreplace -n --oneshot -1 -o --onlydeps --tree -t
- -u --update -U --upgradeonly --config
+ -u --update --changed-use -U --config
)
local yesno="yes/no:compadd -o nosort y n"
@@ -177,9 +177,9 @@ _emerge () {
"($bopts)"{-B,--buildpkgonly}"[Tells emerge to only build binary packages]"
"($nopkg_opts --emptytree -e -l --changelog --usepkgonly -K)"{-l,--changelog}"[This will show the ChangeLog]"
"($nopkg_opts -t --tree)--columns[Displays versions in aligned format]"
- "($nopkg_opts -D --deep --newuse -N --changed-use)"{-D,--deep}"[Consider the entire dependency tree of packages]"
- "($nopkg_opts -D --deep --newuse -N --changed-use)"{-N,--newuse}"[Include installed packages where any USE flags have changed since compilation.]"
- "($nopkg_opts -D --deep --newuse -N --changed-use)--changed-use[Include installed packages where enabled USE flags have changed since installation]"
+ "($nopkg_opts -D --deep --newuse -N --changed-use -U)"{-D,--deep}"[Consider the entire dependency tree of packages]"
+ "($nopkg_opts -D --deep --newuse -N --changed-use -U)"{-N,--newuse}"[Include installed packages where any USE flags have changed since compilation.]"
+ "($nopkg_opts -D --deep --newuse -N --changed-use -U)"{-U,--changed-use}"[Include installed packages where enabled USE flags have changed since installation]"
"($nopkg_opts -e -l --changelog --emptytree)"{-e,--emptytree}"[Only consider glibc as installed packages]"
"($all --nospinner --pretend -p)"{-i,--inject}"[Portage thinks that this package is installed]"
"($nopkg_opts $bopts)"{-f,--fetchonly}"[Just perform fetches for all packages]"
@@ -194,7 +194,6 @@ _emerge () {
"($nopkg_opts --onlydeps-with-rdeps)--onlydeps-with-rdeps[Include run time dependencies when --onlydeps is specified]:$yesno"
"($nopkg_opts --columns -t --tree)"{-t,--tree}"[Show dependency tree]"
"($nopkg_opts --update -u)"{-u,--update}"[Updates packages to the most recent version available]"
- "($nopkg_opts --upgradeonly -U)"{-U,--upgradeonly}"[Do not update packages to a lower version]"
"($bopts)"{-k,--usepkg}"[Tells emerge to use binary packages if available]"
"($bopts --changelog -l)"{-K,--usepkgonly}"[Tells emerge to use binary packages only]"
"($all)--clean[Cleans the system by removing packages]"
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2022-01-12 9:35 Vadim Misbakh-Soloviov
0 siblings, 0 replies; 52+ messages in thread
From: Vadim Misbakh-Soloviov @ 2022-01-12 9:35 UTC (permalink / raw
To: gentoo-commits
commit: db277637d96a6278e5e2171d2cc41aa39042977c
Author: Max Grinberg <codeswhite <AT> protonmail <DOT> com>
AuthorDate: Mon Sep 13 21:19:55 2021 +0000
Commit: Vadim Misbakh-Soloviov <mva <AT> gentoo <DOT> org>
CommitDate: Wed Jan 12 09:34:48 2022 +0000
URL: https://gitweb.gentoo.org/proj/zsh-completion.git/commit/?id=db277637
Fixed #27 (quse -p <tab>)
Signed-off-by: Vadim Misbakh-Soloviov <mva <AT> gentoo.org>
src/_portage_utils | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/_portage_utils b/src/_portage_utils
index 3508061..34858b6 100644
--- a/src/_portage_utils
+++ b/src/_portage_utils
@@ -199,7 +199,7 @@ case $service in
{'(--license)-L','(-L)--license'}'[Use the LICENSE vs IUSE]' \
{'(--describe)-D','(-D)--describe'}'[Describe the USE flag]' \
{'(--installed)-I','(-I)--installed'}'[Only search installed packages]' \
- {'(--package)-p','(-p)--package'}'[Restrict matching to package or category]:package:gentoo_packages available' \
+ {'(--package)-p','(-p)--package'}'[Restrict matching to package or category]:package:_gentoo_packages available' \
{'(--repo)-R','(-R)--repo'}'[Show repository the ebuild originates from]' \
{'(--format)-F','(-F)--format'}'[Print matched atom using given format string]:format' \
'*:useflag:_gentoo_packages useflag'
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2022-01-12 9:35 Vadim Misbakh-Soloviov
0 siblings, 0 replies; 52+ messages in thread
From: Vadim Misbakh-Soloviov @ 2022-01-12 9:35 UTC (permalink / raw
To: gentoo-commits
commit: 999b60ac5a2858842b5a53eddf851d54faa25290
Author: Michael Cook (mackal) <mcook <AT> mackal <DOT> net>
AuthorDate: Thu Apr 15 16:15:23 2021 +0000
Commit: Vadim Misbakh-Soloviov <mva <AT> gentoo <DOT> org>
CommitDate: Wed Jan 12 09:35:26 2022 +0000
URL: https://gitweb.gentoo.org/proj/zsh-completion.git/commit/?id=999b60ac
Add --changed-deps to emerge completion
Signed-off-by: Vadim Misbakh-Soloviov <mva <AT> gentoo.org>
src/_portage | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/_portage b/src/_portage
index 141404e..1eba6fb 100644
--- a/src/_portage
+++ b/src/_portage
@@ -129,6 +129,7 @@ _emerge () {
"--backtrack=[Number of times to backtrack if dependency calculation fails]:number:(0 10 30)"
"--binpkg-changed-deps[Ignore binary packages for which the corresponding ebuild dependencies have changed since the packages were built]:$yesno"
"--binpkg-respect-use[Ignore binary packages if their uses don't match current config]"
+ "--changed-deps[Replace installed packages whos dependencies have changed since install]"
"--complete-graph[Consider the deep dependencies of all packages from the world set]:$yesno"
"--complete-graph-if-new-use[--complete-graph if USE or IUSE will change for an installed package]:$yesno"
"--complete-graph-if-new-ver[--complete-graph if an installed package version will change]:$yesno"
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2020-09-14 3:13 Vadim Misbakh-Soloviov
0 siblings, 0 replies; 52+ messages in thread
From: Vadim Misbakh-Soloviov @ 2020-09-14 3:13 UTC (permalink / raw
To: gentoo-commits
commit: fbcf9c63d44f1d1cb5e57839bd4afe3cc90ffcf0
Author: Z5483 <Z5483Y <AT> gmail <DOT> com>
AuthorDate: Sun Jun 21 00:19:03 2020 +0000
Commit: Vadim Misbakh-Soloviov <mva <AT> gentoo <DOT> org>
CommitDate: Mon Sep 14 03:12:47 2020 +0000
URL: https://gitweb.gentoo.org/proj/zsh-completion.git/commit/?id=fbcf9c63
correct 'overlat' to 'overlay' in _layman
Signed-off-by: Vadim Misbakh-Soloviov <mva <AT> gentoo.org>
src/_layman | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/_layman b/src/_layman
index 75070f0..ec16854 100644
--- a/src/_layman
+++ b/src/_layman
@@ -46,7 +46,7 @@ actions_args=(
"($actions --add -a)"{--add,-a}'[Add the given overlay to your installed overlays]:overlay:_layman_remote_overlays'
"($actions --priority -p)"{--priority,-p}'[It will modify the priority of the added overlay]:priority:({0..100})'
"($actions $add_actions)"{--delete,-d}'[Delete the given overlay from your installed overlays]:overlay:_layman_local_overlays'
- "($actions $add_actions)"{--sync,-s}'[Update the specified overlay]:overlat:_layman_local_overlays'
+ "($actions $add_actions)"{--sync,-s}'[Update the specified overlay]:overlay:_layman_local_overlays'
"($actions $add_actions)"{--info,-i}'[Display all available information about the specified overlay]:overlay:_layman_remote_overlays'
"($actions $add_actions)"{--sync-all,-S}'[Update all overlays]'
"($actions $add_actions)"{--list,-L}'[List the contents of the remote list]'
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2020-09-14 3:13 Vadim Misbakh-Soloviov
0 siblings, 0 replies; 52+ messages in thread
From: Vadim Misbakh-Soloviov @ 2020-09-14 3:13 UTC (permalink / raw
To: gentoo-commits
commit: 7eaa952c52b09325a28881b3a2f1c76d63aaf8f6
Author: Felix Neumärker <xdch47 <AT> posteo <DOT> de>
AuthorDate: Thu Sep 10 11:04:32 2020 +0000
Commit: Vadim Misbakh-Soloviov <mva <AT> gentoo <DOT> org>
CommitDate: Mon Sep 14 03:12:47 2020 +0000
URL: https://gitweb.gentoo.org/proj/zsh-completion.git/commit/?id=7eaa952c
_portage: add further options
Signed-off-by: Felix Neumärker <xdch47 <AT> posteo.de>
Signed-off-by: Vadim Misbakh-Soloviov <mva <AT> gentoo.org>
src/_portage | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/_portage b/src/_portage
index 9ccaffd..141404e 100644
--- a/src/_portage
+++ b/src/_portage
@@ -127,6 +127,7 @@ _emerge () {
"--autounmask-keep-masks[Don't unmask hardmasks and unkeyworded (live)]"
"--autounmask-write[Automatically write autounmask changes (respect CONFIG_PROTECT)]"
"--backtrack=[Number of times to backtrack if dependency calculation fails]:number:(0 10 30)"
+ "--binpkg-changed-deps[Ignore binary packages for which the corresponding ebuild dependencies have changed since the packages were built]:$yesno"
"--binpkg-respect-use[Ignore binary packages if their uses don't match current config]"
"--complete-graph[Consider the deep dependencies of all packages from the world set]:$yesno"
"--complete-graph-if-new-use[--complete-graph if USE or IUSE will change for an installed package]:$yesno"
@@ -137,6 +138,9 @@ _emerge () {
"--dynamic-deps[Substitute the dependencies of installed packages with the dependencies of corresponding unbuilt ebuilds]:$yesno"
"--fail-clean[Clean up temporary files after a build failure]"
"--ignore-built-slot-operator-deps[Ignore the slot/sub-slot dependencies for built pkg]:$yesno"
+ "--ignore-soname-deps[Ignore the soname dependencies of binary and installed packages]:$yesno"
+ "--ignore-world[Ignore the @world package set and its dependencies]"
+ "--implicit-system-deps[Assume that packages may have implicit dependencies on packages which belong to the @system set]"
"--keep-going[Continue as much as possible after an error]"
"--load-average[No new builds should be started if there are other builds running and the load average is at least VALUE]"
"--misspell-suggestions[Enable or disable misspell suggestions]:$yesno"
@@ -146,6 +150,7 @@ _emerge () {
"--rebuild-ignore[Do not rebuild packages that depend on matching packages on --rebuild]:installed atom:_gentoo_packages installed"
"--package-moves[Perform package moves when necessary]"
"--pkg-format[Binary package format]:archive type:(tar rpm)"
+ "--quickpkg-direct[Enable use of installed packages directly as binary packages]:$yesno"
"--prefix=[Set EPREFIX env variable]:prefix path:_files -/"
"--quiet-build[Redirect all build output to logs]"
"--quiet-fail[Suppresses display of the build log on stdout]"
@@ -185,6 +190,7 @@ _emerge () {
"($nopkg_opts -n --noreplace)"{-n,--noreplace}"[Skip packages already installed]"
"($nopkg_opts)"{-1,--oneshot}"[Do not add package to the world profile]"
"($nopkg_opts --onlydeps -o)"{-o,--onlydeps}"[Only merge (or pretend to merge) the dependencies]"
+ "($nopkg_opts --onlydeps-with-rdeps)--onlydeps-with-rdeps[Include run time dependencies when --onlydeps is specified]:$yesno"
"($nopkg_opts --columns -t --tree)"{-t,--tree}"[Show dependency tree]"
"($nopkg_opts --update -u)"{-u,--update}"[Updates packages to the most recent version available]"
"($nopkg_opts --upgradeonly -U)"{-U,--upgradeonly}"[Do not update packages to a lower version]"
@@ -199,15 +205,19 @@ _emerge () {
"(: $all $noask_opts --verbose -v)--regen[Causes portage to check and update the dependency cache]"
"(: $all $noask_opts --verbose -v)"{-s,--search}"[Searches for matches]"
"(: $all $noask_opts --verbose -v)"{-S,--searchdesc}"[Matches the seachdesc string against the description field]"
+ "(: $all $noask_opts --verbose -v)--search-index[Enable or disable indexed search for search action]:$yesno"
+ "(: $all $noask_opts --verbose -v)--search-similarity[Set the minimum similarity percentage]"
+ "(: $all $noask_opts --verbose -v)--fuzzy-search[Enable or disable fuzzy search for search actions]"
"(: $all --pretend -p)--sync[Initiates a portage tree update]"
"(: $all --pretend -p)--check-news[Scan all repositories for relevant unread GLEP 42 news items]"
"($all)"{-C,--unmerge}"[Removes all matching packages]"
+ "($all)--rage-clean[does --unmerge with CLEAN_DELAY=0]"
'(: -)'{-V,--version}'[Display version info]'
"(: $all[3,-1])--resume[Resumes the last merge operation]"
"(: $all[3,-1])--skipfirst[Removes the first package in the resume list]"
"($all)--keep-going[Continue merge even if a package fails to build]"
"--with-bdeps=[pull in build time dependencies that are not strictly required]:$yesno"
- "--with-test-deps=[pull in dependencies that are conditional on the \"testUSE flag]:$yesno"
+ "--with-test-deps=[pull in dependencies that are conditional on the \"test\" USE flag]:$yesno"
)
profiles=(
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2020-09-14 3:13 Vadim Misbakh-Soloviov
0 siblings, 0 replies; 52+ messages in thread
From: Vadim Misbakh-Soloviov @ 2020-09-14 3:13 UTC (permalink / raw
To: gentoo-commits
commit: f059a1fa1b45b3bbf23ad79d1a720273c42a55f8
Author: Felix Neumärker <xdch47 <AT> posteo <DOT> de>
AuthorDate: Thu Sep 10 08:18:22 2020 +0000
Commit: Vadim Misbakh-Soloviov <mva <AT> gentoo <DOT> org>
CommitDate: Mon Sep 14 03:12:47 2020 +0000
URL: https://gitweb.gentoo.org/proj/zsh-completion.git/commit/?id=f059a1fa
_emaint: fix typo
Signed-off-by: Felix Neumärker <xdch47 <AT> posteo.de>
Signed-off-by: Vadim Misbakh-Soloviov <mva <AT> gentoo.org>
src/_portage | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/_portage b/src/_portage
index 8700829..ba8c165 100644
--- a/src/_portage
+++ b/src/_portage
@@ -307,7 +307,7 @@ _emaint () {
local -a remove
if (( $words[(I)(-f|--fix)] )); then
- remove=(${cmd[(r)logs:*]} ${cmd[(r)sync:*})
+ remove=(${cmd[(r)logs:*]} ${cmd[(r)sync:*]})
elif (( $words[(I)(-c|--check)] )); then
remove=(${cmd[(r)sync:*]})
elif (( $words[(I)(-p|--pretend|-C|--clean|-t|--time)] )); then
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2020-09-14 3:13 Vadim Misbakh-Soloviov
0 siblings, 0 replies; 52+ messages in thread
From: Vadim Misbakh-Soloviov @ 2020-09-14 3:13 UTC (permalink / raw
To: gentoo-commits
commit: c7d21758c505f1986c53ee8d689c940df50d08d4
Author: Felix Neumärker <xdch47 <AT> posteo <DOT> de>
AuthorDate: Thu Sep 10 11:02:29 2020 +0000
Commit: Vadim Misbakh-Soloviov <mva <AT> gentoo <DOT> org>
CommitDate: Mon Sep 14 03:12:47 2020 +0000
URL: https://gitweb.gentoo.org/proj/zsh-completion.git/commit/?id=c7d21758
_portage: add yes/no completion for options
Signed-off-by: Felix Neumärker <xdch47 <AT> posteo.de>
Signed-off-by: Vadim Misbakh-Soloviov <mva <AT> gentoo.org>
src/_portage | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/src/_portage b/src/_portage
index ba8c165..9ccaffd 100644
--- a/src/_portage
+++ b/src/_portage
@@ -3,10 +3,11 @@
_ebuild () {
local state
local expl=(-Vx)
+ local yesno="yes/no:compadd -o nosort y n"
local optional_args=(
'--skip-manifest[skip all manifest checks]'
'--debug[run bash with the -x option]'
- '--color=[enable or disable color output]:yes/no:((y\:yes n\:no))'
+ '--color=[enable or disable color output]'":$yesno"
'--ignore-default-opts[ignore $EBUILD_DEFAULT_OPTS]'
'--force[forces regeneration all associated distfiles if used with digest or or manifest command]'
)
@@ -97,6 +98,7 @@ _emerge () {
-u --update -U --upgradeonly --config
)
+ local yesno="yes/no:compadd -o nosort y n"
common_args=(
"($noask_opts --sync)"{-p,--pretend}"[Simply display what would be done]"
"($noask_opts)"{-a,--ask}"[Ask what would be done]"
@@ -107,7 +109,7 @@ _emerge () {
'(: -)'{-h,--help}'[Displays help]'
"(: -)--config[Run package specific actions needed to be executed after the emerge process has completed]:installed atom:_gentoo_packages installed"
"(: -)--list-sets[Displays a list of available package sets]"
- "--color=[Color output]:yes/no:((y\:'yes' n\:'no'))"
+ "--color=[Color output]:$yesno"
"--accept-properties=[Temporarily override the ACCEPT_PROPERTIES variable]"
"--accept-restrict=[Temporarily override the ACCEPT_RESTRICT variable]"
"($noask_opts)"{-A,--alert}"[Add a terminal bell to all interactive prompts]"
@@ -126,18 +128,18 @@ _emerge () {
"--autounmask-write[Automatically write autounmask changes (respect CONFIG_PROTECT)]"
"--backtrack=[Number of times to backtrack if dependency calculation fails]:number:(0 10 30)"
"--binpkg-respect-use[Ignore binary packages if their uses don't match current config]"
- "--complete-graph[Consider the deep dependencies of all packages from the world set]"
- "--complete-graph-if-new-use[--complete-graph if USE or IUSE will change for an installed package]"
- "--complete-graph-if-new-ver[--complete-graph if an installed package version will change]"
+ "--complete-graph[Consider the deep dependencies of all packages from the world set]:$yesno"
+ "--complete-graph-if-new-use[--complete-graph if USE or IUSE will change for an installed package]:$yesno"
+ "--complete-graph-if-new-ver[--complete-graph if an installed package version will change]:$yesno"
"--config-root=[Set PORTAGE_CONFIGROOT variable]:root path:_files -/"
"--depclean-lib-check[Check library link-level dependencies]"
"--digest[Prevent corruption from being noticed]"
- "--dynamic-deps[Substitute the dependencies of installed packages with the dependencies of corresponding unbuilt ebuilds]"
+ "--dynamic-deps[Substitute the dependencies of installed packages with the dependencies of corresponding unbuilt ebuilds]:$yesno"
"--fail-clean[Clean up temporary files after a build failure]"
- "--ignore-built-slot-operator-deps[Ignore the slot/sub-slot dependencies for built pkg]"
+ "--ignore-built-slot-operator-deps[Ignore the slot/sub-slot dependencies for built pkg]:$yesno"
"--keep-going[Continue as much as possible after an error]"
"--load-average[No new builds should be started if there are other builds running and the load average is at least VALUE]"
- "--misspell-suggestions[Enable or disable misspell suggestions]"
+ "--misspell-suggestions[Enable or disable misspell suggestions]:$yesno"
"--newrepo[Recompile a package if it is now being pulled from a different repository]"
"--usepkg-exclude[Ignore matching binary packages]:installed atom:_gentoo_packages installed"
"--rebuild-exclude[Do not rebuild matching packages on --rebuild]:installed atom:_gentoo_packages installed"
@@ -159,7 +161,7 @@ _emerge () {
"--reinstall-atoms[Treat matching packages as if they are not installed]:installed atoms:_gentoo_packages installed"
"--root=[Set ROOT env variable]:prefix path:_files -/"
"(: $nopkg_opts)"{-w,--select}"[Add specified packages to the world set (inverse of --oneshot)]"
- "--selective=[Use --selective=n if you want to forcefully disable --selective, regardless of options like --changed-use, --newuse, --noreplace, or --update]:yes/no:((y\:'yes' n\:'no'))"
+ "--selective=[Use --selective=n if you want to forcefully disable --selective, regardless of options like --changed-use, --newuse, --noreplace, or --update]:$yesno"
"--unordered-display[Produce more readable package tree with --tree]"
"--use-ebuild-visibility[Use unbuilt ebuild metadata for visibility checks on built packages]"
"--useoldpkg-atoms[Prefer matching binary packages over newer unbuilt packages]:available atom:_gentoo_packages available"
@@ -204,8 +206,8 @@ _emerge () {
"(: $all[3,-1])--resume[Resumes the last merge operation]"
"(: $all[3,-1])--skipfirst[Removes the first package in the resume list]"
"($all)--keep-going[Continue merge even if a package fails to build]"
- "--with-bdeps=[pull in build time dependencies that are not strictly required]:yes/no:((y\:'yes' n\:'no'))"
- "--with-test-deps=[pull in dependencies that are conditional on the \"testUSE flag]:yes/no:((y\:'yes' n\:'no'))"
+ "--with-bdeps=[pull in build time dependencies that are not strictly required]:$yesno"
+ "--with-test-deps=[pull in dependencies that are conditional on the \"testUSE flag]:$yesno"
)
profiles=(
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2020-02-19 18:47 Vadim Misbakh-Soloviov
0 siblings, 0 replies; 52+ messages in thread
From: Vadim Misbakh-Soloviov @ 2020-02-19 18:47 UTC (permalink / raw
To: gentoo-commits
commit: 82a3d3ad40c296dcccf66940b88bd0473a45f64b
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Thu Dec 7 19:32:25 2017 +0000
Commit: Vadim Misbakh-Soloviov <mva <AT> gentoo <DOT> org>
CommitDate: Wed Feb 19 18:46:10 2020 +0000
URL: https://gitweb.gentoo.org/proj/zsh-completion.git/commit/?id=82a3d3ad
remove OpenRC completions
OpenRC will provide these completions starting with version 0.35.
Signed-off-by: Vadim Misbakh-Soloviov <mva <AT> gentoo.org>
src/_openrc | 87 -------------------------------------------------------------
1 file changed, 87 deletions(-)
diff --git a/src/_openrc b/src/_openrc
deleted file mode 100644
index f467f1a..0000000
--- a/src/_openrc
+++ /dev/null
@@ -1,87 +0,0 @@
-#compdef rc-update rc-status rc rc-service
-
-# openrc-0.12.4
-
-local gentoo_runlevels
-gentoo_runlevels=(/etc/runlevels/*(:t))
-
-case "$service" in
- rc-service)
- if (( CURRENT == 2 )); then
- _arguments -s \
- '(-e --exists)'{-e,--exists}"[tests if the service exists or not]" \
- '(-l --list)'{-l,--list}'[list all available services]' \
- '(-r --resolve)'{-r,--resolve}'[resolve the service name to an init script]' \
- '(-C --nocolor)'{-C,--nocolor}'[Disable color output]' \
- '(-v --verbose)'{-v,--verbose}'[Run verbosely]' \
- '(-q --quiet)'{-q,--quiet}'[Run quietly]'
- _values "service" /etc/init.d/*~*.sh(:t)
- else
- case $words[2] in
- -e|--exists|-r|--resolve)
- (( CURRENT > 3 )) && return 0
- _values "service" /etc/init.d/*~*.sh(:t)
- ;;
- -*)
- return 0
- ;;
- *)
- _values "action" stop start restart describe zap
- ;;
- esac
- fi
- ;;
- rc-update)
- local used_init
- used_init=(${=${(M)${(f)"$(/sbin/rc-update show 2>/dev/null)"}:#*|*[a-z]*}% |*})
-
- if (( CURRENT == 2 )); then
- _values "rc-update actions" \
- 'add[Add script to a runlevel]' \
- 'del[Delete script from a runlevel]' \
- 'show[Show scripts lanched at a runlevel]' \
- '-a[Add script to a runlevel]' \
- '-d[Delete script from a runlevel]' \
- '-s[Show scripts lanched at a runlevel]'
- elif (( CURRENT == 3 )); then
- case "$words[2]" in
- add|-a)
- _values "service" /etc/init.d/*~*.sh(:t)
- ;;
- del|-d)
- _values "service" $used_init
- ;;
- show|-s)
- _values "runlevels" $gentoo_runlevels \
- '-v[Show all init scripts]' \
- '--verbose[Show all init scripts]'
- ;;
- esac
- elif (( CURRENT == 4 )); then
- _values "runlevels" $gentoo_runlevels
- fi
- ;;
- rc-status)
- _arguments -s \
- {'(--all)-a','(-a)--all'}'[Show services at all runlevels]' \
- {'(--crashed)-c','(-c)--crashed'}'[Show crashed services]' \
- {'(--list)-l','(-l)--list'}'[Show list of runlevels]' \
- {'(--runlevel)-r','(-r)--runlevel'}'[Show the name of the current runlevel]' \
- {'(--servicelist)-s','(-s)--servicelist'}'[Show all services]' \
- {'(--unused)-u','(-u)--unused'}'[Show services not assigned to any run level]' \
- {'(--help)-h','(-h)--help'}'[Print this help output]' \
- {'(--nocolor)-C','(-C)--nocolor'}'[Disable color output]' \
- {'(--version)-V','(-V)--version'}'[Display software version]' \
- {'(--verbose)-v','(-v)--verbose'}'[Run verbosely]' \
- {'(--quiet)-q','(-q)--quiet'}'[Run quietly (Does not affect errors)]'
-
- _values 'runlevels' $gentoo_runlevels
- ;;
- rc)
- if (( CURRENT == 2 )); then
- _values "runlevels" $gentoo_runlevels
- fi
- ;;
-esac
-
-# vim: set et sw=2 ts=2 ft=zsh:
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2020-02-19 18:47 Vadim Misbakh-Soloviov
0 siblings, 0 replies; 52+ messages in thread
From: Vadim Misbakh-Soloviov @ 2020-02-19 18:47 UTC (permalink / raw
To: gentoo-commits
commit: 4560ce6d6f93ebd5823723284708aa16ee7cc37c
Author: Felix Neumärker <xdch47 <AT> posteo <DOT> de>
AuthorDate: Wed Feb 20 20:18:05 2019 +0000
Commit: Vadim Misbakh-Soloviov <mva <AT> gentoo <DOT> org>
CommitDate: Wed Feb 19 18:47:24 2020 +0000
URL: https://gitweb.gentoo.org/proj/zsh-completion.git/commit/?id=4560ce6d
Merge Pull Request #18 (squashed)
[PATCH 1/6] _gentoo_repos: split functions into 2 files
[PATCH 2/6] _portage: improve completion for ebuild and emaint
[PATCH 3/6] _eselect: rewrite for more generic completion
[PATCH 4/6] add EPREFIX support
[PATCH 5/6] _eselect: multi_parts timezone completion
[PATCH 6/6] _eselect: set/enable filter for lists > 10
Signed-off-by: Vadim Misbakh-Soloviov <mva <AT> gentoo.org>
src/_eselect | 363 +++++++++++++++++++++++++++----------------------
src/_gentoo_packages | 28 ++--
src/_gentoo_repos | 64 ++-------
src/_gentoo_repos_conf | 55 ++++++++
src/_gentoolkit | 4 +-
src/_portage | 145 ++++++++++++++++----
src/_portage_utils | 4 +-
7 files changed, 396 insertions(+), 267 deletions(-)
diff --git a/src/_eselect b/src/_eselect
index 46b8477..77b9fd6 100644
--- a/src/_eselect
+++ b/src/_eselect
@@ -1,199 +1,232 @@
-#compdef eselect
-
-common_values=(
- "help[Display help text]"
- "usage[Display usage information]"
- "version[Display version information]"
-)
-
-_eselect_env () {
- if (( $words[(I)(update)] )); then
- _values "update options" \
- "makelinks[force updating of links]" \
- "noldconfig[Do not alter the ld.so cache or configuration]" && return 0
+#compdef eselect kernel-config profile-config rc-config
+
+_eselect_parse_generic() {
+ local -a mod_std mod_extra
+ local -a eselect_args
+ local mod_cur eselect_descr
+ local mod descr etype
+
+ eselect_args=($@)
+ if [[ $1 == "modules" ]] ; then
+ eselect_args=($1 usage)
fi
- _values "env options" $common_values \
- 'update[Collect environment variables from all scripts in /etc/env.d/]' && return 0
-}
+ mod_cur="mod_extra"
+ eselect_descr="$(LANG=C COLUMNS=100 eselect --colour=no ${eselect_args[@]} 2> /dev/null)"
+
+ while IFS="" read -r helpdesc ; do
+ case "$helpdesc" in
+ ("Built-in modules:"|"Standard actions:"))
+ mod_cur="mod_std"
+ ;;
+ ("Extra modules:"|"Extra actions:"))
+ mod_cur="mod_extra"
+ ;;
+ esac
+
+ if [[ "$helpdesc" =~ '^ [A-Za-z]' ]] ; then
+ echo "$helpdesc" | read mod descr
+ descr="$(echo "$descr" | sed -r -e 's/.*\s\s\s+//')"
+ set -A $mod_cur ${(P)mod_cur} ${mod}:${(q)descr}
+ fi
+ done <<< "$eselect_descr"
-_eselect_binutils () {
- local binutilslist
- if (( $words[(I)(set)] )); then
- binutilslist=(${(f)"$(eselect --brief --color=no binutils list)"})
- _values "available binutils version" $binutilslist[@] && return 0
+ if [[ -z "${eselect_args[@]}" ]] ; then
+ etype="modules"
+ else
+ etype="actions"
fi
- _values "binutils options" $common_values \
- "list[List all installed version of binutils]" \
- "show[Print the currently active binutils version]" \
- "set[Activate one of the installed binutils]" && return 0
-}
-_eselect_kernel () {
- local kernellist
- if (( $words[(I)(set)] )); then
- kernellist=(${(f)"$(eselect --brief --color=no kernel list)"})
- _values "available kernel version" $kernellist[@] && return 0
+ if [[ -z "${mod_extra}" && -z "${mod_std}" ]] ; then
+ _nothing
+ else
+ _describe -t eselect_extra -V "eselect extra $etype" mod_extra
+ _describe -t eselect_standard -V "eselect standard $etype" mod_std
fi
- _values "kernel options" $common_values \
- "list[List available kernel symlink targets]" \
- "show[Show the current kernel symlink]" \
- "set[Set a new kernel symlink target]" && return 0
}
-_eselect_ctags () {
- local ctagslist
- if (( $words[(I)(set)] )); then
- ctagslist=(${(f)"$(eselect --brief --color=no ctags list)"})
- _values "available ctags version" $ctagslist[@] && return 0
+_eselect_parse_action_list() {
+ local eselect_list
+ local idx descr
+ local arr_items_selected=$2
+ local arr_items_unselected=$3
+
+ eselect_list="$(LANG=C COLUMNS=100 eselect --colour=no $1 list 2> /dev/null)"
+ while IFS="" read -r ele ; do
+ echo "$ele" | read idx descr
+ idx=${idx#*\[}
+ idx=${idx%\]*}
+ if [[ "$idx" =~ '^[0-9]+$' ]]; then
+ local stripped_descr="${descr% *\**}"
+ if [[ "${stripped_descr}" != "${descr}" ]] ; then
+ set -A $arr_items_selected ${(P)arr_items_selected} "$idx:${(q)descr}"
+ else
+ set -A $arr_items_unselected ${(P)arr_items_unselected} "$idx:${(q)descr}"
+ fi
+ fi
+ done <<< "$eselect_list"
+}
+
+_eselect_module_action() {
+ if (( $+functions[_eselect_${1}_action] )) ; then
+ _eselect_${1}_action
+ else
+ _eselect_parse_generic ${1}
fi
- _values "ctags options" $common_values \
- "list[List available ctags symlink targets]" \
- "show[Show the current target of the ctags symlink]" \
- "update[Automatically update the ctags symlink]" \
- "set[Set a new ctags symlink target]" && return 0
}
-_eselect_profile () {
- local profilelist
- if (( $words[(I)(set)] )); then
- profilelist=(${${(f)"$(eselect --brief --color=no profile list)"}/:/\\:})
- _values -w "available profiles" $profilelist[@] \
- "--force[Forcibly set the symlink]" && return 0
+_eselect_complete_action() {
+ local actionname=$(_eselect_get_module)
+ if (( $+functions[_eselect_complete_${actionname}_action] )) ; then
+ _eselect_complete_${actionname}_action
+ else
+ _eselect_complete_action_generic ${actionname}
fi
- _values "profile options" $common_values \
- "list[List available profile symlink targets]" \
- "show[Show the current make.profile symlink]" \
- "set[Set a new profile symlink target]" && return 0
}
-_eselect_fontconfig () {
- local fclistenabled fclistdisabled
- if (( $words[(I)(enable)] )); then
- fclistdisabled=(${${${${(M)${(f)"$(eselect --color=no fontconfig list)"}## *}#*\*}// \**/}//( \[*\] | \[*\] )/})
- _values -w ".conf to enable" $fclistdisabled[@] && return 0
- elif (( $words[(I)(disable)] )); then
- fclistenabled=(${${${(M)${(M)${(f)"$(eselect --color=no fontconfig list)"}## *}#*\*}// \**/}//( \[*\] | \[*\] )/})
- _values -w ".conf to disable" $fclistenabled[@] && return 0
+_eselect_get_module() {
+ if [[ $service == "eselect" ]] ; then
+ echo $line[1]
+ else
+ echo ${service%-config}
fi
- _values "fontconfig options" $common_values \
- "list[List available fontconfig .conf files]" \
- "disable[Disable specified fontconfig .conf file(s)]" \
- "enable[Enable specified fontconfig .conf file(s)]" && return 0
}
-_eselect_opengl () {
- local opengllist
- if (( $words[(I)(set)] )); then
- opengllist=(${(f)"$(eselect --brief --color=no opengl list)"})
- _values -w "opengl implementations and options" $opengllist[@] \
- "--use-old[If an implementation is already set, use that one instead]" \
- "--prefix[Set the source prefix]:path:_files -/" \
- "--dst-prefix[Set the destination prefix]:path:_files -/" \
- "--ignore-missing[Ignore missing files when setting a new implementation]" && return 0
+_eselect_action_index() {
+ if [[ $service == "eselect" ]] ; then
+ echo 2
+ else
+ echo 1
fi
- _values "opengl options" $common_values \
- "list[List the available OpenGL implementations]" \
- "set[Select the OpenGL implementation]" \
- "show[Print the current OpenGL implementation]" && return 0
+}
+_eselect_get_action () {
+ echo ${line[$(_eselect_action_index)]}
+}
+
+_eselect_action() {
+ _eselect_module_action $(_eselect_get_module)
+}
+
+_eselect_module() {
+ _eselect_parse_generic
}
-_eselect_vi () {
- local vilist
- if (( $words[(I)(set)] )); then
- vilist=(${(f)"$(eselect --brief --color=no vi list)"})
- _values -w "vi implementation" $vilist[@] && return 0
- elif (( $words[(I)(update)] )); then
- _values -w "option" "--if-unset[Do not override existing implementation]" && return 0
+_eselect_complete_action_generic() {
+ local -a sel_items
+ local -a unsel_items
+
+ if (( $NORMARG + $(_eselect_action_index) == $CURRENT )) ; then
+ case "$(_eselect_get_action)" in
+ ("set"|"enable"))
+ _eselect_parse_action_list $1 sel_items unsel_items
+ if (( $#unsel_items + $#sel_items > 0 )) ; then
+ _describe -t eselect_sel -V 'eselect items' unsel_items
+ if (( $#unsel_items + $#sel_items < 10 )) ; then
+ _describe -t eselect_unsel -V 'eselect already selected items' sel_items
+ fi
+ return 0
+ fi
+ ;;
+ ("remove"|"disable"))
+ _eselect_parse_action_list $1 sel_items unsel_items
+ if [[ -n "${sel_items[@]}" ]] ; then
+ _describe -V 'eselect items' sel_items
+ return 0
+ fi
+ ;;
+ esac
fi
- _values "vi options" $common_values \
- "list[List available vi implementations]" \
- "set[Set a new vi implementation provider]" \
- "show[Show the current vi implementation]" \
- "update[Automatically update the vi provider]"
+
+ _nothing
}
-_eselect_news() {
-
- ## TODO: Normal numeric sorting.
- ## I've spent many time on trying to rewrite this
- ## function to normally sort (to DO NOT sort, actually) items,
- ## but it growing bigger and bigger and going to be too complicated.
- ## So, I (mva) either need to help to make it in the "right way".
- ## Or, maybe, to completely rewrite this compdef.
-
- local -a newslist;
- if ((CURRENT == 3)); then
- _values 'news options' $stdopts[@] \
- 'list[List news items]' \
- 'count[Display number of news items]' \
- 'purge[Purge read news]' \
- 'read[Read news items]' \
- 'unread[Mark read news items as unread again]' && return 0
- elif ((CURRENT == 4)); then
- if (( $words[(I)(count)] )); then
- _values -w 'news' 'new[Count only new news items]' 'all[Count all news items]' && return 0
- fi
+# custom completions:
+(( $+functions[_eselect_complete_news_action] )) || _eselect_complete_news_action() {
+ local -a items
- newslist=(${${${${${${${(M)${(f)"$(eselect --color=no news list)"}## *}// \**/}/ \[/}/\] ##/\[}/%/]}/ \[/ (}/\] /) })
+ case "$(_eselect_get_action)" in
+ ("read"|"unread"))
+ local -a extra_items=('all:Read all news items')
+ if [[ $(_eselect_get_action) == "read" ]] ; then
+ extra_items=('new:Read unread news items (default)' "${extra_items[@]}")
+ fi
+ _eselect_parse_action_list news items items
- if (( $words[(I)(read)] )); then
- newslist+=( "new[Read unread news items (default)]" "all[Read all news items]" "--mbox[Output in mbox format]" "--quiet[Suppress output, only change status]" "--raw[Output in raw format]" )
- fi;
+ items=(${(q)extra_items[@]} ${(Oa)items})
+ if [[ -n "${items[@]}" ]] ; then
+ _describe -V 'eselect items' items
+ return 0
+ fi
+ ;;
+ esac
- if (( $words[(I)(unread)] )); then
- newslist+=( "all[Unread all news items]" )
- fi
+ _nothing
+}
- _values -w 'news' $newslist[@] && return 0
+(( $+functions[_eselect_complete_kernel_action] )) || _eselect_complete_kernel_action() {
+ local -a items
+
+ if (( $NORMARG + $(_eselect_action_index) == $CURRENT )) ; then
+ case "$(_eselect_get_action)" in
+ "set")
+ for k in ${(@f)$(eselect --colour=no --brief kernel list)} ; do
+ items+=${k#linux-}
+ done
+ local -a expl=(-P linux-)
+ compadd -V 'eselect kernel' -P linux- ${items[@]}
+ return 0
+ ;;
+ esac
fi
+
+ _nothing
}
-_eselect () {
- local globopts modnames modopts
-
- globopts=(
- "--brief[Make output shorter]"
- "--colour=no[Disable coloured output]"
- "--color=no[Disable coloured output]"
- )
- modnames=(${${${(M)${(f)"$(eselect --brief --color=no modules list)"}## *}// */}// /})
-
- if ((CURRENT == 2)); then
- _arguments -s \
- "$globopts[@]" \
- "*:portage:_values 'eselect modules' \$modnames[@]" && return 0
- elif ((CURRENT == 3)); then
- if [[ $words[2] == --colour=no || $words[2] == --color=no ]]; then
- _arguments -s \
- "*:portage:_values 'eselect modules' \$modnames[@]" && return 0
- elif (( $modnames[(I)$words[2]] )); then
- if [[ "$words[2]" == (env|binutils|kernel|ctags|profile|fontconfig|opengl|vi|news) ]]; then
- _eselect_$words[2] "$@"
- else
- modopts=(${${${(M)${(f)"$(eselect --brief --color=no $words[2] usage)"}## *}// */}// /})
- _arguments -s \
- "*:portage:_values 'eselect $words[2] options' \$modopts[@]" && return 0
- fi
- fi
- elif ((CURRENT >= 4)); then
- if (( $words[(I)(--color=no|--colour=no)] )); then
- if (( $modnames[(I)$words[3]] )); then
- if [[ "$words[3]" == (env|binutils|kernel|ctags|profile|fontconfig|opengl|vi|news) ]]; then
- _eselect_$words[3] "$@"
- else
- modopts=(${${${${(M)${(f)"$(eselect --brief --color=no $words[3] usage)"}## *}// */}// /}// *})
- _arguments -s \
- "*:portage:_values 'eselect $words[3] options' \$modopts[@]" && return 0
- fi
- fi
- else
- if (( $modnames[(I)$words[2]] )); then
- (( $+functions[_eselect_$words[2]] )) && _eselect_$words[2] "$@"
- fi
- fi
+(( $+functions[_eselect_complete_profile_action] )) || _eselect_complete_profile_action() {
+ if (( $NORMARG + $(_eselect_action_index) == $CURRENT )) ; then
+ case "$(_eselect_get_action)" in
+ "set")
+ _values 'eselect profiles' $(eselect --colour=no --brief profile list)
+ return 0
+ ;;
+ esac
fi
+
+ _nothing
+}
+
+(( $+functions[_eselect_complete_timezone_action] )) || _eselect_complete_timezone_action() {
+ if (( $NORMARG + $(_eselect_action_index) == $CURRENT )) ; then
+ case "$(_eselect_get_action)" in
+ "set")
+ _multi_parts / "($(eselect --colour=no --brief timezone list))"
+ return 0
+ ;;
+ esac
+ fi
+
+ _nothing
+}
+
+eselect_comp() {
+ integer NORMARG
+
+ case "$service" in
+ eselect)
+ _arguments -A '-*' -n \
+ '--brief[Make output shorter]' \
+ '(--colour --color)'--colo{,u}r='[Enable or disable colour output]:colour:(yes no)' \
+ '1:eselect_module:_eselect_module' \
+ '2:eselect_action:_eselect_action' \
+ '*:eselect_complete_action:_eselect_complete_action'
+ ;;
+ *-config)
+ _arguments -n \
+ "1:action:_eselect_action" \
+ '*:eselect_complete_action:_eselect_complete_action'
+ ;;
+ esac
}
-_eselect "$@"
+eselect_comp "$@"
# vim: set et sw=2 ts=2 ft=zsh:
diff --git a/src/_gentoo_packages b/src/_gentoo_packages
index 37539c8..c2d9d36 100644
--- a/src/_gentoo_packages
+++ b/src/_gentoo_packages
@@ -58,7 +58,7 @@ _parsesetsconf() {
_gentoo_packages_update_installed_sets() {
local sets
- sets=($(</var/lib/portage/world_sets))
+ sets=($(<${EPREFIX}/var/lib/portage/world_sets))
if [[ ((${#sets} > 0)) ]]; then
_wanted installed_sets expl 'installed set' compadd "$@" "${(o@)^sets}"
fi
@@ -67,7 +67,7 @@ _gentoo_packages_update_installed_sets() {
_gentoo_packages_update_available_sets() {
local dirs dir sets_dir set sets sets_path sets_files
- dirs=($(_gentoo_repos -o) /etc/portage /usr/share/portage/config)
+ dirs=($(_gentoo_repos -o) ${EPREFIX}/etc/portage ${EPREFIX}/usr/share/portage/config)
for dir in ${(@)dirs}; do
if [[ -d ${dir} ]]; then
@@ -104,10 +104,10 @@ _gentoo_packages_update_useflag(){
_gentoo_packages_update_active_useflag(){
local flags USE
var=USE
- [[ -z ${(P)var} && -r /etc/portage/make.conf ]] &&
- local $var="$(. /etc/portage/make.conf 2>/dev/null; echo ${(P)var})"
- [[ -z ${(P)var} && -r /etc/make.conf ]] &&
- local $var="$(. /etc/make.conf 2>/dev/null; echo ${(P)var})"
+ [[ -z ${(P)var} && -r ${EPREFIX}/etc/portage/make.conf ]] &&
+ local $var="$(. ${EPREFIX}/etc/portage/make.conf 2>/dev/null; echo ${(P)var})"
+ [[ -z ${(P)var} && -r ${EPREFIX}/etc/make.conf ]] &&
+ local $var="$(. ${EPREFIX}/etc/make.conf 2>/dev/null; echo ${(P)var})"
flags=(${${${=USE}%-*}%\\*})
compadd $flags
}
@@ -122,7 +122,7 @@ _gentoo_packages_update_category(){
_gentoo_packages_update_installed(){
local installed_dir installed_portage installed_pkgname installed_list
- installed_dir="/var/db/pkg"
+ installed_dir="${EPREFIX}/var/db/pkg"
installed_portage=($installed_dir/*-*/*)
installed_pkgname=(${${installed_portage:t}%%-[0-9]*})
@@ -135,7 +135,7 @@ _gentoo_packages_update_installed(){
_gentoo_packages_update_installed_versions(){
local installed_list installed_portage
- installed_portage=(/var/db/pkg/*-*/*)
+ installed_portage=(${EPREFIX}/var/db/pkg/*-*/*)
_wanted packages expl 'package' compadd "$@" ${installed_portage:t}
installed_list=(${installed_portage##*/pkg/})
@@ -196,12 +196,12 @@ _gentoo_packages_update_available_versions(){
_gentoo_packages_update_binary() {
local PKGDIR
- [[ -z $PKGDIR && -r /etc/portage/make.conf ]] &&
- PKGDIR="$(. /etc/portage/make.conf 2>/dev/null; echo $PKGDIR)"
- [[ -z $PKGDIR && -r /etc/make.conf ]] &&
- PKGDIR="$(. /etc/make.conf 2>/dev/null; echo $PKGDIR)"
- [[ -z $PKGDIR && -r /usr/share/portage/config/make.globals ]] &&
- PKGDIR="$(. /usr/share/portage/config/make.globals 2>/dev/null; echo $PKGDIR)"
+ [[ -z $PKGDIR && -r ${EPREFIX}/etc/portage/make.conf ]] &&
+ PKGDIR="$(. ${EPREFIX}/etc/portage/make.conf 2>/dev/null; echo $PKGDIR)"
+ [[ -z $PKGDIR && -r ${EPREFIX}/etc/make.conf ]] &&
+ PKGDIR="$(. ${EPREFIX}/etc/make.conf 2>/dev/null; echo $PKGDIR)"
+ [[ -z $PKGDIR && -r ${EPREFIX}/usr/share/portage/config/make.globals ]] &&
+ PKGDIR="$(. ${EPREFIX}/usr/share/portage/config/make.globals 2>/dev/null; echo $PKGDIR)"
# this doesn't take care of ${PORTAGE_BINHOST}. If Gentoo official
# binary mirror will be available we should rewrite it accordingly.
diff --git a/src/_gentoo_repos b/src/_gentoo_repos
index 85f3936..e5acf36 100644
--- a/src/_gentoo_repos
+++ b/src/_gentoo_repos
@@ -11,22 +11,22 @@ _gentoo_repos() {
overlay_paths=();
result=();
- if [[ -e /usr/share/portage/config/repos.conf || -e /etc/portage/repos.conf ]]; then
- main_repo=$(_repos_conf DEFAULT main-repo)
- main_repo_path=$(_repos_conf ${main_repo} location)
+ if [[ -e ${EPREFIX}/usr/share/portage/config/repos.conf || -e ${EPREFIX}/etc/portage/repos.conf ]]; then
+ main_repo=$(_gentoo_repos_conf DEFAULT main-repo)
+ main_repo_path=$(_gentoo_repos_conf ${main_repo} location)
- for overlay in $(_repos_conf -l); do
- overlay_paths+=($(_repos_conf ${overlay} location))
+ for overlay in $(_gentoo_repos_conf -l); do
+ overlay_paths+=($(_gentoo_repos_conf ${overlay} location))
done
- source /etc/make.conf 2>/dev/null
- source /etc/portage/make.conf 2>/dev/null
+ source ${EPREFIX}/etc/make.conf 2>/dev/null
+ source ${EPREFIX}/etc/portage/make.conf 2>/dev/null
overlay_paths+=(${(@)PORTDIR_OVERLAY})
else
- source /usr/share/portage/config/make.globals 2>/dev/null
- source /etc/make.conf 2>/dev/null
- source /etc/portage/make.conf 2>/dev/null
+ source ${EPREFIX}/usr/share/portage/config/make.globals 2>/dev/null
+ source ${EPREFIX}/etc/make.conf 2>/dev/null
+ source ${EPREFIX}/etc/portage/make.conf 2>/dev/null
main_repo_path="${PORTDIR}"
overlay_paths=(${(@)PORTDIR_OVERLAY})
@@ -43,50 +43,6 @@ _gentoo_repos() {
echo ${(u)result}
}
-_repos_conf() {
- local v file insection section arr secname
-
- secname=();
-
- for file in /usr/share/portage/config/repos.conf \
- /etc/portage/repos.conf \
- /etc/portage/repos.conf/*.conf; do
-
- [[ -f ${file} ]] || continue
- insection=0
- declare -A arr
- IFS='= '
-
- while read -r name value; do
- [[ -z ${name} || ${name} == '#'* ]] && continue
-
- if [[ (${name} == '['*']') && (-z ${value}) ]]; then
- value=${name//(\]|\[)}
- name="section"
- fi
- arr[${name}]=${value}
-
- if [[ ${insection} == 1 && ${name} == "section" ]]; then
- break
- elif [[ ${name} == "section" ]]; then
- [[ ${value} == ${1} ]] && insection=1
- secname+=(${value})
- elif [[ ${insection} == 1 ]]; then
- if [[ ${name} == ${2} ]]; then
- v=${value}
- fi
- fi
- continue
- done < ${file}
- done
-
- if [[ ${1} == "-l" ]]; then
- echo "${(@u)secname}"
- else
- echo "${v}"
- fi
-}
-
_gentoo_repos "$@"
# vim: set et sw=2 ts=2 ft=zsh:
diff --git a/src/_gentoo_repos_conf b/src/_gentoo_repos_conf
new file mode 100644
index 0000000..3dad709
--- /dev/null
+++ b/src/_gentoo_repos_conf
@@ -0,0 +1,55 @@
+#autoload
+
+# Usage:
+# _gentoo_repos_conf -l -> returns the list of all repos names
+# _gentoo_repos_conf REPO ATTRIBUTE -> returns the VALUE associated
+# with the ATTRIBUTE of the REPO
+
+_gentoo_repos_conf() {
+ local v file insection section arr secname
+
+ secname=();
+
+
+ for file in ${EPREFIX}/usr/share/portage/config/repos.conf \
+ ${EPREFIX}/etc/portage/repos.conf \
+ ${EPREFIX}/etc/portage/repos.conf/*.conf; do
+
+ [[ -f ${file} ]] || continue
+ insection=0
+ declare -A arr
+ IFS='= '
+
+ while read -r name value; do
+ [[ -z ${name} || ${name} == '#'* ]] && continue
+
+ if [[ (${name} == '['*']') && (-z ${value}) ]]; then
+ value=${name//(\]|\[)}
+ name="section"
+ fi
+ arr[${name}]=${value}
+
+ if [[ ${insection} == 1 && ${name} == "section" ]]; then
+ break
+ elif [[ ${name} == "section" ]]; then
+ [[ ${value} == ${1} ]] && insection=1
+ secname+=(${value})
+ elif [[ ${insection} == 1 ]]; then
+ if [[ ${name} == ${2} ]]; then
+ v=${value}
+ fi
+ fi
+ continue
+ done < ${file}
+ done
+
+ if [[ ${1} == "-l" ]]; then
+ echo "${(@u)secname}"
+ else
+ echo "${v}"
+ fi
+}
+
+_gentoo_repos_conf "$@"
+
+# vim: set et sw=2 ts=2 ft=zsh:
diff --git a/src/_gentoolkit b/src/_gentoolkit
index fdad29f..ce5ada4 100644
--- a/src/_gentoolkit
+++ b/src/_gentoolkit
@@ -204,7 +204,7 @@ _equery () {
{size,s}'[print size of files contained in package]'
{uses,u}'[display USE flags for package]'
{which,w}'[print full path to ebuild for package]'
- {has,a}'[list all packages matching ENVIRONMENT data stored in /var/db/pkg]'
+ {has,a}'[list all installed packages where specified KEY matches the specified VALUE]'
{keywords,y}'[display keywords for specified PKG]'
{meta,m}'[display metadata about PKG]'
)
@@ -357,7 +357,7 @@ _glsa_id () {
# will be low. May be we should display only the X previous GLSA,
# or GLSA ids of the X last month.
#
- # start to look at /usr/lib/gentoolkit/pym/glsa.py if GLSA_DIR is still
+ # start to look at ${EPREFIX}/usr/lib/gentoolkit/pym/glsa.py if GLSA_DIR is still
# PORTDIR + "metadata/glsa/"
# and then get the list (it's only xml files in GLSA_DIR, easy!)
diff --git a/src/_portage b/src/_portage
index 1c43ac4..8700829 100644
--- a/src/_portage
+++ b/src/_portage
@@ -1,33 +1,51 @@
#compdef emerge ebuild quickpkg emaint env-update etc-update portageq repoman
_ebuild () {
- if (( CURRENT == 2 )); then
- _files -g \*.ebuild
- elif (( CURRENT > 2 )); then
- _values "ebuild command" \
- 'clean[Cleans the temporary build directory]' \
- 'help[Show help]' \
- 'setup[Run all package specific setup actions and exotic system checks.]' \
- 'fetch[Fetch all necessary files]' \
- 'digest[Creates a digest file for the package]' \
- 'unpack[Extracts the sources to a subdirectory in the build directory]' \
- 'prepare[Prepares the extracted sources by running the src_prepare()]' \
- 'configure[Configures the extracted sources by running the src_configure()]' \
- 'compile[Compiles the extracted sources by running the src_compile()]' \
- 'test[Runs package-specific test cases to verify that everything was built properly]' \
- 'preinst[Run specific actions that need to be done before installation]' \
- 'install[Installs the package to the temporary install directory]' \
- 'postinst[Run specific actions that need to be done after installation]' \
- 'qmerge[Installs the package de the filesystem]' \
- 'merge[perform the following actions: fetch, unpack, compile, install and qmerge.]' \
- 'unmerge[Remove the installed files of the packages]' \
- 'prerm[Run specific actions that need to be executed before unmerge]' \
- 'postrm[Run specific actions that need to be executed after unmerge]' \
- 'config[Run specific actions needed to be executed after the emerge process has completed.]' \
- 'package[This command is a lot like the merge command, but create a .tbz2 package]' \
- 'manifest[Updates the manifest file for the package.]' \
- 'rpm[Builds a RedHat RPM package]'
- fi
+ local state
+ local expl=(-Vx)
+ local optional_args=(
+ '--skip-manifest[skip all manifest checks]'
+ '--debug[run bash with the -x option]'
+ '--color=[enable or disable color output]:yes/no:((y\:yes n\:no))'
+ '--ignore-default-opts[ignore $EBUILD_DEFAULT_OPTS]'
+ '--force[forces regeneration all associated distfiles if used with digest or or manifest command]'
+ )
+
+ _arguments -O expl -C $optional_args "1:ebuild file:_files -g \*.ebuild" "*:ebuild command:->ebuild_cmd"
+
+ case $state in
+ (ebuild_cmd)
+
+ local ebuild_cmds=(
+ 'clean[Cleans the temporary build directory]'
+ 'help[Show help]'
+ 'setup[Run all package specific setup actions and exotic system checks]'
+ 'fetch[Fetch all necessary files]'
+ 'digest[Creates a digest file for the package]'
+ 'unpack[Extracts the sources to a subdirectory in the build directory]'
+ 'prepare[Prepares the extracted sources by running the src_prepare()]'
+ 'configure[Configures the extracted sources by running the src_configure()]'
+ 'compile[Compiles the extracted sources by running the src_compile()]'
+ 'test[Runs package-specific test cases to verify that everything was built properly]'
+ 'preinst[Run specific actions that need to be done before installation]'
+ 'install[Installs the package to the temporary install directory]'
+ 'postinst[Run specific actions that need to be done after installation]'
+ 'qmerge[Installs the package de the filesystem]'
+ 'merge[perform the following actions: fetch, unpack, compile, install and qmerge]'
+ 'unmerge[Remove the installed files of the packages]'
+ 'prerm[Run specific actions that need to be executed before unmerge]'
+ 'postrm[Run specific actions that need to be executed after unmerge]'
+ 'config[Run specific actions needed to be executed after the emerge process has completed]'
+ 'package[This command is a lot like the merge command, but create a .tbz2 package]'
+ 'manifest[Updates the manifest file for the package]'
+ 'rpm[Builds a RedHat RPM package]'
+ )
+
+ local curcontext="ebuild_cmd"
+ zstyle -t ":completion:${curcontext}:values:values" sort || zstyle ":completion:${curcontext}:values:values" sort false
+ _values -w "ebuild command" "$ebuild_cmds[@]"
+ ;;
+ esac
}
_quickpkg () {
@@ -186,6 +204,8 @@ _emerge () {
"(: $all[3,-1])--resume[Resumes the last merge operation]"
"(: $all[3,-1])--skipfirst[Removes the first package in the resume list]"
"($all)--keep-going[Continue merge even if a package fails to build]"
+ "--with-bdeps=[pull in build time dependencies that are not strictly required]:yes/no:((y\:'yes' n\:'no'))"
+ "--with-test-deps=[pull in dependencies that are conditional on the \"testUSE flag]:yes/no:((y\:'yes' n\:'no'))"
)
profiles=(
@@ -235,11 +255,76 @@ _emerge () {
}
_emaint () {
- _arguments -s \
+ local state
+ local chk_opt fix_opt pretend_opt clean_opt purge_opt log_extra_opt repo_opt
+ local sync_opt sync_extra_opt standalone_opt exclusive_cmd_opt repos
+ local allcmd logcmd synccmd mergecmd fixcmds
+ chk_opt=(-c --check)
+ fix_opt=(-f --fix)
+ pretend_opt=(-p --pretend)
+ clean_opt=(-C --clean)
+ purge_opt=(-P --purge)
+ log_extra_opt=(-t --time)
+ repo_opt=(-r --repo)
+ sync_opt=(-a --auto -A --allrepos)
+ sync_extra_opt=(--sync-submodule $repo_opt)
+
+ standalone_opt=(-h --help --version)
+ exclusive_cmd_opt=($chk_opt $fix_opt $sync_opt $purge_opt $pretend_opt $standalone_opt)
+ repos=$(_gentoo_repos_conf -l)
+
+ _arguments -C \
"(: -)"{-h,--help}'[show help message and exit]' \
+ "($sync_extra_opt $log_extra_opt $exclusive_cmd_opt $clean_opt)"{-f,--fix}"[Fix any problems that may exist]" \
"(: -)"--version"[show program's version number and exit]" \
- '(-c --check -f --fix)'{-c,--check}"[Check for any problems that may exist]:emaint:((all\:'check all' world\:'check only world file'))" \
- '(-c --check -f --fix)'{-f,--fix}"[Fix any problems that may exist]:emaint:((all\:'check all' world\:'check only world file'))"
+ "($sync_extra_opt $exclusive_cmd_opt)"{-c,--check}"[check for any problems that may exist]" \
+ "($fix_opt $purge_opt $sync_opt $sync_extra_opt $standalone_opt -t --time)"{-t,--time}"[(cleanlogs only)changes the minimum age NUM (in days) of the logs to be listed or deleted]" \
+ "($sync_extra_opt $exclusive_cmd_opt)"{-p,--pretend}"[output logs that would be deleted (cleanlogs only)]" \
+ "($fix_opt $sync_opt $sync_extra_opt $purge_opt)"{-C,--clean}"[cleans the logs from \$PORT_LOGDIR (cleanlogs only)]" \
+ "($log_extra_opt $sync_extra_opt $exclusive_cmd_opt $clean_opt)"{-P,--purge}"[removes the list of previously failed merges (merges only)]" \
+ "($repo_opt $log_extra_opt $exclusive_cmd_opt $clean_opt)"{-a,--auto}"[sync repositories which have their auto-sync setting set (sync module only)]" \
+ "($chk_opt $fix_opt $purge_opt $pretend_opt $log_extra_opt $clean_opt $standalone_opt)*"{-r,--repo}"=[Sync the specified repo]:gentoo repo:($repos)" \
+ "($repo_opt $log_extra_opt $exclusive_cmd_opt $clean_opt)"{-A,--allrepos}"[Sync all repos that have a sync-url defined (sync module only)]" \
+ "($chk_opt $fix_opt $purge_opt $pretend_opt $log_extra_opt $clean_opt $standalone_opt)*--sync-submodule=[restrict sync to the specified submodule (sync module only)]:portage submodule:(glsa news profiles)" \
+ "1:emaint commands:->emaint_cmd"
+
+ case $state in
+ (emaint_cmd)
+ local descr="emaint commands"
+
+ local cmd=(
+ 'all:perform all supported commands that accept the specified option'
+ 'logs:clean out old logs from the $PORT_LOGDIR'
+ 'sync:perform sync actions on specified repositories'
+ 'merges:scan for failed package merges and attempt to fix those failed packages'
+ 'binhost:generate a metadata index for binary packages located in $PKGDIR'
+ 'cleanconfmem:discard no longer installed config tracker entries'
+ 'cleanresume:discard merge lists saved for the emerge --resume action'
+ 'movebin:perform package move updates for binary packages located in $PKGDIR'
+ 'moveinst:perform package move updates for installed packages'
+ 'world:fix problems in the world file'
+ )
+
+ local -a remove
+ if (( $words[(I)(-f|--fix)] )); then
+ remove=(${cmd[(r)logs:*]} ${cmd[(r)sync:*})
+ elif (( $words[(I)(-c|--check)] )); then
+ remove=(${cmd[(r)sync:*]})
+ elif (( $words[(I)(-p|--pretend|-C|--clean|-t|--time)] )); then
+ cmd=(${cmd[(r)logs:*]})
+ elif (( $words[(I)(-a|--auto|-A|--allrepos|-r=*|--repo=*|-r|--repo|--sync-submodule|--sync-submodule=*)] )); then
+ cmd=(${cmd[(r)sync:*]})
+ elif (( $words[(I)(--purge|-P)] )); then
+ cmd=(${cmd[(r)merges:*]})
+ else
+ remove=(${cmd[(r)sync:*]})
+ fi
+
+ cmd=(${cmd:|remove})
+ _describe $descr cmd
+
+ ;;
+ esac
}
_env-update () {
diff --git a/src/_portage_utils b/src/_portage_utils
index 4c41e16..9077f30 100644
--- a/src/_portage_utils
+++ b/src/_portage_utils
@@ -98,7 +98,7 @@ case $service in
{'(--repo)-R','(-R)--repo'}'[Display installed packages with repository]' \
{'(--umap)-U','(-U)--umap'}'[Display installed packages with flags used]' \
{'(--columns)-c','(-c)--columns'}'[Display column view]' \
- '--show-debug[Show /usr/lib/debug files]' \
+ '--show-debug[Show debug files]' \
{'(--exact)-e','(-e)--exact'}'[Exact match (only CAT/PN or PN without PV)]' \
{'(--all)-a','(-a)--all'}'[Show every installed package]' \
{'(--dir)-d','(-d)--dir'}'[Only show directories]' \
@@ -115,7 +115,7 @@ case $service in
{'(--unlist)-u','(-u)--unlist'}'[Show unmerge history]' \
{'(--sync)-s','(-s)--sync'}'[Show sync history]' \
{'(--current)-c','(-c)--current'}'[Show current emerging packages]' \
- {'(--logfile)-f','(-f)--logfile'}'[Read emerge logfile instead of /var/log/emerge.log]:log:_files' \
+ {'(--logfile)-f','(-f)--logfile'}'[Read emerge logfile instead of $EMERGE_LOG_DIR/emerge.log]:log:_files' \
'*:packages:_gentoo_packages available'
;;
qsearch)
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2020-02-19 18:47 Vadim Misbakh-Soloviov
0 siblings, 0 replies; 52+ messages in thread
From: Vadim Misbakh-Soloviov @ 2020-02-19 18:47 UTC (permalink / raw
To: gentoo-commits
commit: f2a2c5b91f969ad1e620b7975b15774878d9c324
Author: Thomas Rüd <mail <AT> thomas-rued <DOT> com>
AuthorDate: Wed Feb 19 11:08:18 2020 +0000
Commit: Vadim Misbakh-Soloviov <mva <AT> gentoo <DOT> org>
CommitDate: Wed Feb 19 18:47:32 2020 +0000
URL: https://gitweb.gentoo.org/proj/zsh-completion.git/commit/?id=f2a2c5b9
Update portage-utils completion
Signed-off-by: Thomas Rüd <mail <AT> thomas-rued.com>
Signed-off-by: Vadim Misbakh-Soloviov <mva <AT> gentoo.org>
src/_portage_utils | 161 ++++++++++++++++++++++++++++++++---------------------
1 file changed, 98 insertions(+), 63 deletions(-)
diff --git a/src/_portage_utils b/src/_portage_utils
index 9077f30..3508061 100644
--- a/src/_portage_utils
+++ b/src/_portage_utils
@@ -1,4 +1,4 @@
-#compdef qatom qcache qcheck qdepends qfile qgrep qlist qlop qpkg qsearch qsize qtbz2 quse qxpak
+#compdef qatom qcheck qdepends qfile qgrep qkeyword qlist qlop qmanifest qmerge qpkg qsearch qsize qtbz2 quse qxpak
# portage-utils-0.53
@@ -16,68 +16,52 @@ common_args=(
case $service in
qatom)
_arguments -s $common_args \
- {'(--compare)-c','(-c)--compare'}'[Compare two atoms]'
- ;;
- qcache)
- local arches
- arches=( $(_gentoo_arches) )
-
- _arguments -s $common_args \
- {'(--matchpkg)-p','(-p)--matchpkg'}'[match pkgname]:package name:_gentoo_packages available_pkgnames_only' \
- {'(--matchcat)-c','(-c)--matchcat'}'[match catname]:category:_gentoo_packages category' \
- {'(--imlate)-i','(-i)--imlate'}'[list packages that can be marked stable on a given arch]' \
- {'(--dropped)-d','(-d)--dropped'}'[list packages that have dropped keywords on a version bump on a given arch]' \
- {'(--testing)-t','(-t)--testing'}'[list packages that have ~arch versions, but no stable versions on a given arch]' \
- {'(--stats)-s','(-s)--stats'}'[display statistics about the portage tree]' \
- {'(--all)-a','(-a)--all'}'[list packages that have at least one version keyworded for on a given arch]' \
- {'(--not)-n','(-n)--not'}"[list packages that aren't keyworded on a given arch]"
-
- _describe -t available-arches "arch" arches
+ {'(--format)-F','(-F)--format'}'[Custom output format]:format' \
+ {'(--compare)-c','(-c)--compare'}'[Compare two atoms]' \
+ {'(--print)-p','(-p)--print'}'[Print reconstructed atom]' \
+ '*:package-atom'
;;
qcheck)
_arguments -s $common_args \
- {'(--all)-a','(-a)--all'}'[List all packages]' \
- {'(--exact)-e','(-e)--exact'}'[Exact match (only CAT/PN or PN without PV)]' \
+ {'(--format)-F','(-F)--format'}'[Custom output format]:format' \
{'(--skip)-s','(-s)--skip'}'[Ignore files matching regular expression]:regex' \
{'(--update)-u','(-u)--update'}'[Update missing files, chksum and mtimes for packages]' \
{'(--noafk)-A','(-A)--noafk'}'[Ignore missing files]' \
{'(--badonly)-B','(-B)--badonly'}'[Only print pkgs containing bad files]' \
{'(--nohash)-H','(-H)--nohash'}'[Ignore differing/unknown file chksums]' \
{'(--nomtime)-T','(-T)--nomtime'}'[Ignore differing file mtimes]' \
- '--skip-protected[Ignore files in CONFIG_PROTECT-ed paths]' \
+ {'(--skip-protected)-P','(-P)--skin-protected'}'[Ignore files in CONFIG_PROTECT-ed paths]' \
{'(--prelink)-p','(-p)--prelink'}'[Undo prelink when calculating checksums]' \
'*:packages:_gentoo_packages installed'
;;
qdepends)
_arguments -s $common_args \
- {'(--depend)-d','(-d)--depend'}'[Show DEPEND info (default)]' \
+ {'(--depend)-d','(-d)--depend'}'[Show DEPEND info]' \
{'(--rdepend)-r','(-r)--rdepend'}'[Show RDEPEND info]' \
{'(--pdepend)-p','(-p)--pdepend'}'[Show PDEPEND info]' \
- {'(--key)-k','(-k)--key'}'[User defined vdb key]:vdb key' \
+ {'(--bdepend)-b','(-b)--bdepend'}'[Show BDEPEND info]' \
{'(--query)-Q','(-Q)--query'}'[Query reverse deps]' \
- {'(--name-only)-N','(-N)--name-only'}'[Only show package name]' \
- {'(--all)-a','(-a)--all'}'[Show all DEPEND info]' \
- {'(--format)-f','(-f)--format'}'[Pretty format specified depend strings]' \
+ {'(--installed)-i','(-i)--installed'}'[Search installed packages using VDB]' \
+ {'(--tree)-t','(-t)--tree'}'[Search available ebuilds in the tree]:packages:_gentoo_packages available' \
+ {'(--format)-F','(-F)--format'}'[Print matched atom using given format string]:format' \
+ {'(--pretty)-S','(-S)--pretty'}'[Pretty format specified depend strings]' \
'*:packages:_gentoo_packages installed'
;;
qfile)
_arguments -s $common_args \
+ {'(--format)-F','(-F)--format'}'[Print matched atom using given format string]' \
{'(--slots)-S','(-S)--slots'}'[Display installed packages with slots]' \
{'(--root-prefix)-R','(-R)--root-prefix'}'[Assume arguments are already prefixed by $ROOT]' \
- {'(--from)-f','(-f)--from'}'[Read arguments from file <arg> ("-" for stdin)]' \
- {'(--max-args)-m','(-m)--max-args'}'[Treat from file arguments by groups of <arg> (defaults to 5000)]:number' \
- {'(--basename)-b','(-b)--basename'}'[Match any component of the path]' \
+ {'(--dir)-d','(-d)--dir'}'[Also match directories for single component arguments]' \
{'(--orphans)-o','(-o)--orphans'}'[List orphan files]' \
{'(--exclude)-x','(-x)--exclude'}"[Don't look in package <arg> (used with --orphans)]:package:_gentoo_packages installed" \
- {'(--exact)-e','(-e)--exact'}'[Exact match (used with --exclude)]' \
'*:filename:_files'
;;
qgrep)
_arguments -s $common_args \
{'(--invert-match)-I','(-I)--invert-match'}'[Select non-matching lines]' \
{'(--ignore-case)-i','(-i)--ignore-case'}'[Ignore case distinctions]' \
- {'(--with-filename)-H','(-H)--with-filename'}'[Print the filename for each match]' \
- {'(--with-name)-N','(-N)--with-name'}'[Print the package or eclass name for each match]' \
+ {'(--with-name)-N','(-N)--with-name'}'[Print the filename for each match]' \
{'(--count)-c','(-c)--count'}'[Only print a count of matching lines per FILE]' \
{'(--list)-l','(-l)--list'}'[Only print FILE names containing matches]' \
{'(--invert-list)-L','(-L)--invert-list'}'[Only print FILE names containing no match]' \
@@ -86,72 +70,119 @@ case $service in
{'(--installed)-J','(-J)--installed'}'[Search in installed ebuilds instead of the tree]' \
{'(--eclass)-E','(-E)--eclass'}'[Search in eclasses instead of ebuilds]' \
{'(--skip-comments)-s','(-s)--skip-comments'}'[Skip comments lines]' \
+ {'(--repo)-R','(-R)--repo'}'[Print source repository name for each match (implies -N)]' \
{'(--skip)-S','(-S)--skip'}'[Skip lines matching <arg>]:pattern' \
{'(--before)-B','(-B)--before'}'[Print <arg> lines of leading context]:number' \
{'(--after)-A','(-A)--after'}'[Print <arg> lines of trailing context]:number' \
'*:pattern::'
;;
+
+ qkeyword)
+ local arches
+ arches=( $(_gentoo_arches) )
+
+ _arguments -s $common_args \
+ {'(--matchpkg)-p','(-p)--matchpkg'}'[match pkgname]:package name:_gentoo_packages available_pkgnames_only' \
+ {'(--matchcat)-c','(-c)--matchcat'}'[match catname]:category:_gentoo_packages category' \
+ {'(--matchmaint)-m','(-m)--matchmaint'}'[match maintainer email from metadata.xml (slow)]:email' \
+ {'(--imlate)-i','(-i)--imlate'}'[list packages that can be marked stable on a given arch]' \
+ {'(--dropped)-d','(-d)--dropped'}'[list packages that have dropped keywords on a version bump on a given arch]' \
+ {'(--testing)-t','(-t)--testing'}'[list packages that have ~arch versions, but no stable versions on a given arch]' \
+ {'(--stats)-s','(-s)--stats'}'[display statistics about the portage tree]' \
+ {'(--all)-a','(-a)--all'}'[list packages that have at least one version keyworded for on a given arch]' \
+ {'(--not)-n','(-n)--not'}"[list packages that aren't keyworded on a given arch]"
+
+ _describe -t available-arches "arch" arches
+ ;;
qlist)
_arguments -s $common_args \
{'(--installed)-I','(-I)--installed'}'[Just show installed packages]' \
- {'(--slots)-S','(-S)--slots'}'[Display installed packages with slots]' \
+ {'(--slots)-S','(-S)--slots'}'[Display installed packages with slots (use twice for subslots)]' \
{'(--repo)-R','(-R)--repo'}'[Display installed packages with repository]' \
{'(--umap)-U','(-U)--umap'}'[Display installed packages with flags used]' \
{'(--columns)-c','(-c)--columns'}'[Display column view]' \
- '--show-debug[Show debug files]' \
+ '--show-debug[Show /usr/lib/debug and /usr/src/debug files]' \
{'(--exact)-e','(-e)--exact'}'[Exact match (only CAT/PN or PN without PV)]' \
{'(--all)-a','(-a)--all'}'[Show every installed package]' \
{'(--dir)-d','(-d)--dir'}'[Only show directories]' \
{'(--obj)-o','(-o)--obj'}'[Only show objects]' \
{'(--sym)-s','(-s)--sym'}'[Only show symlinks]' \
+ {'(--format)-F','(-F)--format'}'[Print matched atom using given format string]:format' \
'*:packages:_gentoo_packages installed'
;;
qlop)
_arguments -s $common_args \
- {'(--gauge)-g','(-g)--gauge'}'[Gauge number of times a package has been merged]' \
- {'(--time)-t','(-t)--time'}'[Calculate merge time for a specific package]' \
- {'(--human)-H','(-H)--human'}'[Print seconds in human readable format (needs -t)]' \
- {'(--list)-l','(-l)--list'}'[Show merge history]' \
- {'(--unlist)-u','(-u)--unlist'}'[Show unmerge history]' \
+ {'(--summary)-c','(-c)--summary'}'[Print summary of average merges (implies -a)]' \
+ {'(--time()-t','(-t)--time'}'[Print time taken to complete action]' \
+ {'(--average)-a','(-a)--average'}'[Print average time taken to complete action]' \
+ {'(--human)-H','(-H)--human'}'[Print elapsed time in human readable format (use with -t or -a)]' \
+ {'(--machine)-M','(-M)--machine'}'[Print elapsed time as seconds with no formatting]' \
+ {'(--merge)-m','(-m)--merge'}'[Show merge history]' \
+ {'(--unmerge)-u','(-u)--unmerge'}'[Show unmerge history]' \
+ {'(--autoclean)-U','(-U)--autoclean'}'[Show autoclean unmerge history]' \
{'(--sync)-s','(-s)--sync'}'[Show sync history]' \
- {'(--current)-c','(-c)--current'}'[Show current emerging packages]' \
- {'(--logfile)-f','(-f)--logfile'}'[Read emerge logfile instead of $EMERGE_LOG_DIR/emerge.log]:log:_files' \
+ {'(--endtime)-e','(-e)--endtime'}'[Report time at which the operation finished (iso started)]' \
+ {'(--running)-r','(-r)--running'}'[Show current emerging packages]' \
+ {'(--date)-d','(-d)--date'}'[Limit selection to this time (1st -d is start, 2nd -d is end)]:date' \
+ {'(--lastmerge)-l','(-l)--lastmerge'}'[Limit selection to last Portage emerge action]' \
+ {'(--logfile)-f','(-f)--logfile'}'[Read emerge logfile instead of $EMERGE_LOG_DIR/emerge.log]:filename:_files' \
+ {'(--atoms)-w','(-w)--atoms'}'[Read package atoms to report from file]:filename:_files' \
+ {'(--format)-F','(-F)--format'}'[Print matched atom using given format string]:format' \
+ '*:packages:_gentoo_packages available'
+ ;;
+ qmanifest)
+ _arguments -s $common_args \
+ {'(--generate)-g','(-g)--generate'}'[Generate thick Manifests]' \
+ {'(--signas)-s','(-s)--signas'}'[Sign generated Manifest using GPG key]:public key:_gpg public-keys' \
+ {'(--passphrase)-p','(-p)--passphrase'}'[Ask for GPG key password (instead of relying on gpg-agent)]' \
+ {'(--dir)-d','(-d)--dir'}'[Tread arguments as directories]:directory:_files -/' \
+ {'(--overlay)-o','(-o)--overlay'}'[Treat arguments as overlay names]:overlay:_gentoo_repos -o' \
+ ;;
+ qmerge)
+ _arguments -s $common_args \
+ {'(--fetch)-f','(-f)--fetch'}'[Fetch package and newest Packages metadata]' \
+ {'(--force)-F','(-F)--force'}'[Fetch package (skipping Packages)]' \
+ {'(--search)-s','(-s)--search'}'[Search available packages]' \
+ {'(--instal)-K','(-K)--install'}'[Install package]' \
+ {'(--unmerge)-U','(-U)--unmerge'}'[Uninstall package]' \
+ {'(--pretent)-p','(-p)--pretend'}'[Pretend only]' \
+ {'(--update)-u','(-u)--update'}'[Update only]' \
+ {'(--yes)-y','(-y)--yes'}"[Don't prompt before overwriting]" \
+ {'(--nodeps)-O','(-O)--nodeps'}"[Don't merge dependencies]" \
+ '--debug[Run shell funcs with `set -x`]' \
'*:packages:_gentoo_packages available'
;;
+ qpkg)
+ _arguments -s $common_args \
+ {'(--clean)-c','(-c)--clean'}'[clean pkgdir of unused binary files]' \
+ {'(--eclean)-E','(-E)--eclean'}'[clean pkgdir of files not in the tree anymore (slow)]' \
+ {'(--pretend)-p','(-p)--pretend'}'[pretend only]' \
+ {'(--pkgdir)-P','(-P)--pkgdir'}'[alternate package directory]:alternate pkgdir:_files -/' \
+ '*:Installed packages:_gentoo_packages installed_versions'
+ ;;
qsearch)
_arguments -s $common_args \
{'(--all)-a','(-a)--all'}'[List the descriptions of every package in the cache]' \
- {'(--cache)-c','(-c)--cache'}'[Use the portage cache]' \
- {'(--ebuilds)-e','(-e)--ebuilds'}'[Use the portage ebuild tree]' \
{'(--search)-s','(-s)--search'}'[Regex search package basenames]' \
- {'(--desc)-S','(-S)--desc'}'[Regex search package descriptions]' \
+ {'(--desc)-S','(-S)--desc'}'[Regex search package descriptions (or homepage when using -H)]' \
{'(--name-only)-N','(-N)--name-only'}'[Only show package name]' \
- {'(--homepage)-H','(-H)--homepage'}'[Show homepage info]' \
+ {'(--homepage)-H','(-H)--homepage'}'[Show homepage info instead of description]' \
+ {'(--repo)-R','(-R)--repo'}'[Show repository the ebuild originates from]' \
+ {'(--format)-F','(-F)--format'}'[Print matched atom using given format string]:format' \
'*:pattern::'
;;
qsize)
_arguments -s $common_args \
{'(--filesystem)-f','(-f)--filesystem'}'[Show size used on disk]' \
- {'(--all)-a','(-a)--all'}'[Size all installed packages]' \
{'(--sum)-s','(-s)--sum'}'[Include a summary]' \
{'(--sum-only)-S','(-S)--sum-only'}'[Show just the summary]' \
{'(--megabytes)-m','(-m)--megabytes'}'[Display size in megabytes]' \
{'(--kilobytes)-k','(-k)--kilobytes'}'[Display size in kilobytes]' \
{'(--bytes)-b','(-b)--bytes'}'[Display size in bytes]' \
{'(--ignore)-i','(-i)--ignore'}'[Ignore regexp string]:pattern' \
+ {'(--format)-F','(-F)--format'}'[Print matched atom using given format string]:format' \
'*:packages:_gentoo_packages installed'
;;
- quse)
- _arguments -s $common_args \
- {'(--exact)-e','(-e)--exact'}'[Show exact non regexp matching using strcmp]' \
- {'(--all)-a','(-a)--all'}'[Show annoying things in IUSE]' \
- {'(--keywords)-K','(-K)--keywords'}'[Use the KEYWORDS vs IUSE]' \
- {'(--license)-L','(-L)--license'}'[Use the LICENSE vs IUSE]' \
- {'(--describe)-D','(-D)--describe'}'[Describe the USE flag]' \
- {'(--format)-F','(-F)--format'}'[Use your own variable formats: -F NAME=]:format' \
- {'(--name-only)-N','(-N)--name-only'}'[Only show package name]' \
- '*:use flag:_gentoo_packages useflag'
- ;;
qtbz2)
_arguments -s $common_args \
{'(--dir)-d','(-d)--dir'}'[Change to specified directory]:directory:_files -/' \
@@ -161,13 +192,17 @@ case $service in
{'(--xpak)-x','(-x)--xpak'}'[Just split the xpak]:tbz2 file:_files -g \*.tbz2' \
{'(--stdout)-O','(-O)--stdout'}'[Write files to stdout]'
;;
- qpkg)
+ quse)
_arguments -s $common_args \
- {'(--clean)-c','(-c)--clean'}'[clean pkgdir of unused binary files]' \
- {'(--eclean)-E','(-E)--eclean'}'[clean pkgdir of files not in the tree anymore (slow)]' \
- {'(--pretend)-p','(-p)--pretend'}'[pretend only]' \
- {'(--pkgdir)-P','(-P)--pkgdir'}'[alternate package directory]:alternate pkgdir:_files -/' \
- '*:Installed packages:_gentoo_packages installed_versions'
+ {'(--exact)-e','(-e)--exact'}'[Show exact non regexp matching using strcmp]' \
+ {'(--all)-a','(-a)--all'}"[List all ebuilds, don't match anything]" \
+ {'(--license)-L','(-L)--license'}'[Use the LICENSE vs IUSE]' \
+ {'(--describe)-D','(-D)--describe'}'[Describe the USE flag]' \
+ {'(--installed)-I','(-I)--installed'}'[Only search installed packages]' \
+ {'(--package)-p','(-p)--package'}'[Restrict matching to package or category]:package:gentoo_packages available' \
+ {'(--repo)-R','(-R)--repo'}'[Show repository the ebuild originates from]' \
+ {'(--format)-F','(-F)--format'}'[Print matched atom using given format string]:format' \
+ '*:useflag:_gentoo_packages useflag'
;;
qxpak)
_arguments -s $common_args \
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2020-02-19 18:47 Vadim Misbakh-Soloviov
0 siblings, 0 replies; 52+ messages in thread
From: Vadim Misbakh-Soloviov @ 2020-02-19 18:47 UTC (permalink / raw
To: gentoo-commits
commit: b33fbd445ab0014be633d8935ec08d1799900448
Author: Felix Neumärker <xdch47 <AT> posteo <DOT> de>
AuthorDate: Wed Feb 19 16:44:18 2020 +0000
Commit: Vadim Misbakh-Soloviov <mva <AT> gentoo <DOT> org>
CommitDate: Wed Feb 19 18:47:38 2020 +0000
URL: https://gitweb.gentoo.org/proj/zsh-completion.git/commit/?id=b33fbd44
Merge PR #22 (eselect fixes #22
[PATCH 1/6] _eselect: php-module completion
[PATCH 2/6] _eselect: generic uses _describe instead of values
[PATCH 3/6] _ekeyword: inital completion
[PATCH 4/6] _eselect: news modules - fix order
[PATCH 5/6] _eselect: completion for rc module / rc-config
[PATCH 6/6] _eselect: repository fixes + options
Signed-off-by: Felix Neumärker <xdch47 <AT> posteo.de>
Signed-off-by: Vadim Misbakh-Soloviov <mva <AT> gentoo.org>
src/_ekeyword | 23 +++++++++
src/_eselect | 161 ++++++++++++++++++++++++++++++++++++++++++----------------
2 files changed, 139 insertions(+), 45 deletions(-)
diff --git a/src/_ekeyword b/src/_ekeyword
new file mode 100644
index 0000000..c86ebb0
--- /dev/null
+++ b/src/_ekeyword
@@ -0,0 +1,23 @@
+#compdef ekeyword
+
+local -a arguments=(
+ '(- :)'{-h,--help}'[Show this help message and exit]'
+ '(-m --manifest)'{-m,--manifest}'[Run `ebuild manifest` on the ebuild after modifying it]'
+ '(-n --dry-run)'{-n,--dry-run}'[Show what would be changed, but do not commit]'
+ '(-v --verbose)'{-v,--verbose}'[Be verbose while processing things]'
+ '(-q --quiet)'{-q,--quiet}'[Be quiet while processing things (only show errors)]'
+ '(--format)'--format':Select output format for showing differences:_values -V ekeywordsfmt "ekeywords formats" auto color-inline inline short-multi long-multi'
+ '(- :)'{-V,--version}'[Show version information]'
+)
+
+(( $+functions[_ekeywordargs] )) || _ekeywordargs() {
+ _files -g \*.ebuild
+
+ local -a keywords=(all $(_gentoo_arches))
+
+ compset -P '(\^|\~)'
+ _values -V "keywords" "gentoo arches" ${keywords[@]}
+}
+
+_arguments ${arguments[@]} "*:ekeywordargs:_ekeywordargs"
+
diff --git a/src/_eselect b/src/_eselect
index 77b9fd6..ce185a8 100644
--- a/src/_eselect
+++ b/src/_eselect
@@ -45,25 +45,24 @@ _eselect_parse_generic() {
}
_eselect_parse_action_list() {
- local eselect_list
- local idx descr
- local arr_items_selected=$2
- local arr_items_unselected=$3
-
- eselect_list="$(LANG=C COLUMNS=100 eselect --colour=no $1 list 2> /dev/null)"
- while IFS="" read -r ele ; do
- echo "$ele" | read idx descr
- idx=${idx#*\[}
- idx=${idx%\]*}
- if [[ "$idx" =~ '^[0-9]+$' ]]; then
- local stripped_descr="${descr% *\**}"
- if [[ "${stripped_descr}" != "${descr}" ]] ; then
- set -A $arr_items_selected ${(P)arr_items_selected} "$idx:${(q)descr}"
- else
- set -A $arr_items_unselected ${(P)arr_items_unselected} "$idx:${(q)descr}"
- fi
+ local idx item tag
+ local -a _sel_items
+ local -a _unsel_items
+
+ while read idx item tag descr ; do
+ if [[ "$idx" == '[' && "$item" == ']' ]] ; then
+ continue
+ fi
+ if [[ ${tag} =~ '^[*@#]$' ]] ; then
+ _sel_items+=($item)
+ else
+ _unsel_items+=($item)
fi
- done <<< "$eselect_list"
+ done <<< $(LANG=C COLUMNS=100 eselect --colour=no $1 list 2> /dev/null | tail -n +2)
+
+ set -A $2 ${_sel_items[@]}
+ set -A $3 ${_unsel_items[@]}
+
}
_eselect_module_action() {
@@ -78,9 +77,15 @@ _eselect_complete_action() {
local actionname=$(_eselect_get_module)
if (( $+functions[_eselect_complete_${actionname}_action] )) ; then
_eselect_complete_${actionname}_action
- else
+ return 0
+ fi
+
+ if (( $NORMARG + $(_eselect_action_index) == $CURRENT )) ; then
_eselect_complete_action_generic ${actionname}
+ return 0
fi
+
+ _nothing
}
_eselect_get_module() {
@@ -110,31 +115,29 @@ _eselect_module() {
_eselect_parse_generic
}
-_eselect_complete_action_generic() {
+(( $+function[_eselect_complete_action_generic] )) || _eselect_complete_action_generic() {
local -a sel_items
local -a unsel_items
- if (( $NORMARG + $(_eselect_action_index) == $CURRENT )) ; then
- case "$(_eselect_get_action)" in
- ("set"|"enable"))
- _eselect_parse_action_list $1 sel_items unsel_items
- if (( $#unsel_items + $#sel_items > 0 )) ; then
- _describe -t eselect_sel -V 'eselect items' unsel_items
- if (( $#unsel_items + $#sel_items < 10 )) ; then
- _describe -t eselect_unsel -V 'eselect already selected items' sel_items
- fi
- return 0
- fi
- ;;
- ("remove"|"disable"))
- _eselect_parse_action_list $1 sel_items unsel_items
- if [[ -n "${sel_items[@]}" ]] ; then
- _describe -V 'eselect items' sel_items
- return 0
+ case "$(_eselect_get_action)" in
+ ("set"|"enable"))
+ _eselect_parse_action_list $1 sel_items unsel_items
+ if (( $#unsel_items + $#sel_items > 0 )) ; then
+ _describe -t eselect_sel -V 'eselect items' unsel_items
+ if (( $#unsel_items + $#sel_items < 10 )) ; then
+ _describe -t eselect_unsel -V 'eselect already selected items' sel_items
fi
- ;;
- esac
- fi
+ return 0
+ fi
+ ;;
+ ("remove"|"disable"))
+ _eselect_parse_action_list $1 sel_items unsel_items
+ if [[ -n "${sel_items[@]}" ]] ; then
+ _describe -V 'eselect items' sel_items
+ return 0
+ fi
+ ;;
+ esac
_nothing
}
@@ -145,15 +148,19 @@ _eselect_complete_action_generic() {
case "$(_eselect_get_action)" in
("read"|"unread"))
- local -a extra_items=('all:Read all news items')
+ local idx descr
+ while read idx descr ; do
+ idx=${idx#'['}
+ idx=${idx%']'}
+ items=(${idx}:${(q)descr} ${items[@]})
+ done <<< $(eselect --colour=no news list 2> /dev/null | tail -n +2)
+ items+=('all:Read all news items')
if [[ $(_eselect_get_action) == "read" ]] ; then
- extra_items=('new:Read unread news items (default)' "${extra_items[@]}")
+ items+=('new:Read unread news items (default)')
fi
- _eselect_parse_action_list news items items
- items=(${(q)extra_items[@]} ${(Oa)items})
if [[ -n "${items[@]}" ]] ; then
- _describe -V 'eselect items' items
+ _describe -V 'eselect news' items
return 0
fi
;;
@@ -207,6 +214,70 @@ _eselect_complete_action_generic() {
_nothing
}
+(( $+functions[_eselect_complete_php_action] )) || _eselect_complete_php_action() {
+ if (( $NORMARG + $(_eselect_action_index) == $CURRENT )) ; then
+ case "$(_eselect_get_action)" in
+ ("list"|"set"|"show"|"update"))
+ _values 'eselect php modules' $(eselect --colour=no --brief php list-modules)
+ return 0
+ ;;
+ esac
+ elif (( $NORMARG + $(_eselect_action_index) + 1 == $CURRENT )) ; then
+ case "$words[$CURRENT-2]" in
+ "set")
+ local targets=($(eselect --colour=no --brief php list "$words[$CURRENT-1]" 2> /dev/null))
+ if [ -n "$targets" ]; then
+ _values 'eselect php modules' ${targets[@]}
+ return 0
+ fi
+ ;;
+ esac
+ fi
+
+ _nothing
+}
+
+(( $+functions[_eselect_complete_rc_action] )) || _eselect_complete_rc_action() {
+ if (( $NORMARG + $(_eselect_action_index) == $CURRENT )) ; then
+ case "$(_eselect_get_action)" in
+ ("list"|"show"))
+ _values 'runlevels' $(command ls --color=never ${EPREFIX}/etc/runlevels)
+ return 0
+ ;;
+ ("add"|"delete"|"pause"|"reload"|"restart"|"start"|"stop"))
+ _values 'scripts' $(rc-service -l)
+ return 0
+ ;;
+ esac
+ elif (( $NORMARG + $(_eselect_action_index) + 1 == $CURRENT )) ; then
+ case "$words[$CURRENT-2]" in
+ ("add"|"delete"))
+ _values 'runlevels' $(command ls --color=never ${EPREFIX}/etc/runlevels)
+ return 0
+ ;;
+ esac
+ fi
+
+ _nothing
+}
+
+
+(( $+functions[_eselect_complete_repository_action] )) || _eselect_complete_repository_action() {
+ local -a opts
+
+ case "$(_eselect_get_action)" in
+ ("disable"|"remove"))
+ opts=('-f:Force potentially dangerous removals')
+ ;;
+ "list")
+ opts=('-i:Only list installed')
+ ;;
+ esac
+
+ _describe -o 'options' opts
+ _eselect_complete_action_generic repository
+}
+
eselect_comp() {
integer NORMARG
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2020-02-19 18:47 Vadim Misbakh-Soloviov
0 siblings, 0 replies; 52+ messages in thread
From: Vadim Misbakh-Soloviov @ 2020-02-19 18:47 UTC (permalink / raw
To: gentoo-commits
commit: 3b8349dcfadc625dd859b78cfeb054c5f6bfff12
Author: otakuto <otakuto893 <AT> gmail <DOT> com>
AuthorDate: Mon Nov 13 07:12:08 2017 +0000
Commit: Vadim Misbakh-Soloviov <mva <AT> gentoo <DOT> org>
CommitDate: Wed Feb 19 18:46:56 2020 +0000
URL: https://gitweb.gentoo.org/proj/zsh-completion.git/commit/?id=3b8349dc
_portage: add configure and prepare,test completions
Signed-off-by: Vadim Misbakh-Soloviov <mva <AT> gentoo.org>
src/_portage | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/_portage b/src/_portage
index ed2ade5..1c43ac4 100644
--- a/src/_portage
+++ b/src/_portage
@@ -11,7 +11,10 @@ _ebuild () {
'fetch[Fetch all necessary files]' \
'digest[Creates a digest file for the package]' \
'unpack[Extracts the sources to a subdirectory in the build directory]' \
+ 'prepare[Prepares the extracted sources by running the src_prepare()]' \
+ 'configure[Configures the extracted sources by running the src_configure()]' \
'compile[Compiles the extracted sources by running the src_compile()]' \
+ 'test[Runs package-specific test cases to verify that everything was built properly]' \
'preinst[Run specific actions that need to be done before installation]' \
'install[Installs the package to the temporary install directory]' \
'postinst[Run specific actions that need to be done after installation]' \
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2020-02-19 17:53 Vadim Misbakh-Soloviov
0 siblings, 0 replies; 52+ messages in thread
From: Vadim Misbakh-Soloviov @ 2020-02-19 17:53 UTC (permalink / raw
To: gentoo-commits
commit: ba66a09a2469e12799995a24b5f59aa718df8f38
Author: =?UTF-8?q?Felix=20Neum=C3=A4rker?= <xdch47 <AT> posteo <DOT> de>
AuthorDate: Wed Feb 20 20:18:05 2019 +0000
Commit: Vadim Misbakh-Soloviov <mva <AT> gentoo <DOT> org>
CommitDate: Wed Feb 19 17:51:33 2020 +0000
URL: https://gitweb.gentoo.org/proj/zsh-completion.git/commit/?id=ba66a09a
Merge Pull Request #18 (squashed)
[PATCH 1/6] _gentoo_repos: split functions into 2 files
[PATCH 2/6] _portage: improve completion for ebuild and emaint
[PATCH 3/6] _eselect: rewrite for more generic completion
[PATCH 4/6] add EPREFIX support
[PATCH 5/6] _eselect: multi_parts timezone completion
[PATCH 6/6] _eselect: set/enable filter for lists > 10
Signed-off-by: Vadim A. Misbakh-Soloviov <git <AT> mva.name>
src/_eselect | 363 +++++++++++++++++++++++++++----------------------
src/_gentoo_packages | 28 ++--
src/_gentoo_repos | 64 ++-------
src/_gentoo_repos_conf | 55 ++++++++
src/_gentoolkit | 4 +-
src/_portage | 145 ++++++++++++++++----
src/_portage_utils | 4 +-
7 files changed, 396 insertions(+), 267 deletions(-)
diff --git a/src/_eselect b/src/_eselect
index 46b8477..77b9fd6 100644
--- a/src/_eselect
+++ b/src/_eselect
@@ -1,199 +1,232 @@
-#compdef eselect
-
-common_values=(
- "help[Display help text]"
- "usage[Display usage information]"
- "version[Display version information]"
-)
-
-_eselect_env () {
- if (( $words[(I)(update)] )); then
- _values "update options" \
- "makelinks[force updating of links]" \
- "noldconfig[Do not alter the ld.so cache or configuration]" && return 0
+#compdef eselect kernel-config profile-config rc-config
+
+_eselect_parse_generic() {
+ local -a mod_std mod_extra
+ local -a eselect_args
+ local mod_cur eselect_descr
+ local mod descr etype
+
+ eselect_args=($@)
+ if [[ $1 == "modules" ]] ; then
+ eselect_args=($1 usage)
fi
- _values "env options" $common_values \
- 'update[Collect environment variables from all scripts in /etc/env.d/]' && return 0
-}
+ mod_cur="mod_extra"
+ eselect_descr="$(LANG=C COLUMNS=100 eselect --colour=no ${eselect_args[@]} 2> /dev/null)"
+
+ while IFS="" read -r helpdesc ; do
+ case "$helpdesc" in
+ ("Built-in modules:"|"Standard actions:"))
+ mod_cur="mod_std"
+ ;;
+ ("Extra modules:"|"Extra actions:"))
+ mod_cur="mod_extra"
+ ;;
+ esac
+
+ if [[ "$helpdesc" =~ '^ [A-Za-z]' ]] ; then
+ echo "$helpdesc" | read mod descr
+ descr="$(echo "$descr" | sed -r -e 's/.*\s\s\s+//')"
+ set -A $mod_cur ${(P)mod_cur} ${mod}:${(q)descr}
+ fi
+ done <<< "$eselect_descr"
-_eselect_binutils () {
- local binutilslist
- if (( $words[(I)(set)] )); then
- binutilslist=(${(f)"$(eselect --brief --color=no binutils list)"})
- _values "available binutils version" $binutilslist[@] && return 0
+ if [[ -z "${eselect_args[@]}" ]] ; then
+ etype="modules"
+ else
+ etype="actions"
fi
- _values "binutils options" $common_values \
- "list[List all installed version of binutils]" \
- "show[Print the currently active binutils version]" \
- "set[Activate one of the installed binutils]" && return 0
-}
-_eselect_kernel () {
- local kernellist
- if (( $words[(I)(set)] )); then
- kernellist=(${(f)"$(eselect --brief --color=no kernel list)"})
- _values "available kernel version" $kernellist[@] && return 0
+ if [[ -z "${mod_extra}" && -z "${mod_std}" ]] ; then
+ _nothing
+ else
+ _describe -t eselect_extra -V "eselect extra $etype" mod_extra
+ _describe -t eselect_standard -V "eselect standard $etype" mod_std
fi
- _values "kernel options" $common_values \
- "list[List available kernel symlink targets]" \
- "show[Show the current kernel symlink]" \
- "set[Set a new kernel symlink target]" && return 0
}
-_eselect_ctags () {
- local ctagslist
- if (( $words[(I)(set)] )); then
- ctagslist=(${(f)"$(eselect --brief --color=no ctags list)"})
- _values "available ctags version" $ctagslist[@] && return 0
+_eselect_parse_action_list() {
+ local eselect_list
+ local idx descr
+ local arr_items_selected=$2
+ local arr_items_unselected=$3
+
+ eselect_list="$(LANG=C COLUMNS=100 eselect --colour=no $1 list 2> /dev/null)"
+ while IFS="" read -r ele ; do
+ echo "$ele" | read idx descr
+ idx=${idx#*\[}
+ idx=${idx%\]*}
+ if [[ "$idx" =~ '^[0-9]+$' ]]; then
+ local stripped_descr="${descr% *\**}"
+ if [[ "${stripped_descr}" != "${descr}" ]] ; then
+ set -A $arr_items_selected ${(P)arr_items_selected} "$idx:${(q)descr}"
+ else
+ set -A $arr_items_unselected ${(P)arr_items_unselected} "$idx:${(q)descr}"
+ fi
+ fi
+ done <<< "$eselect_list"
+}
+
+_eselect_module_action() {
+ if (( $+functions[_eselect_${1}_action] )) ; then
+ _eselect_${1}_action
+ else
+ _eselect_parse_generic ${1}
fi
- _values "ctags options" $common_values \
- "list[List available ctags symlink targets]" \
- "show[Show the current target of the ctags symlink]" \
- "update[Automatically update the ctags symlink]" \
- "set[Set a new ctags symlink target]" && return 0
}
-_eselect_profile () {
- local profilelist
- if (( $words[(I)(set)] )); then
- profilelist=(${${(f)"$(eselect --brief --color=no profile list)"}/:/\\:})
- _values -w "available profiles" $profilelist[@] \
- "--force[Forcibly set the symlink]" && return 0
+_eselect_complete_action() {
+ local actionname=$(_eselect_get_module)
+ if (( $+functions[_eselect_complete_${actionname}_action] )) ; then
+ _eselect_complete_${actionname}_action
+ else
+ _eselect_complete_action_generic ${actionname}
fi
- _values "profile options" $common_values \
- "list[List available profile symlink targets]" \
- "show[Show the current make.profile symlink]" \
- "set[Set a new profile symlink target]" && return 0
}
-_eselect_fontconfig () {
- local fclistenabled fclistdisabled
- if (( $words[(I)(enable)] )); then
- fclistdisabled=(${${${${(M)${(f)"$(eselect --color=no fontconfig list)"}## *}#*\*}// \**/}//( \[*\] | \[*\] )/})
- _values -w ".conf to enable" $fclistdisabled[@] && return 0
- elif (( $words[(I)(disable)] )); then
- fclistenabled=(${${${(M)${(M)${(f)"$(eselect --color=no fontconfig list)"}## *}#*\*}// \**/}//( \[*\] | \[*\] )/})
- _values -w ".conf to disable" $fclistenabled[@] && return 0
+_eselect_get_module() {
+ if [[ $service == "eselect" ]] ; then
+ echo $line[1]
+ else
+ echo ${service%-config}
fi
- _values "fontconfig options" $common_values \
- "list[List available fontconfig .conf files]" \
- "disable[Disable specified fontconfig .conf file(s)]" \
- "enable[Enable specified fontconfig .conf file(s)]" && return 0
}
-_eselect_opengl () {
- local opengllist
- if (( $words[(I)(set)] )); then
- opengllist=(${(f)"$(eselect --brief --color=no opengl list)"})
- _values -w "opengl implementations and options" $opengllist[@] \
- "--use-old[If an implementation is already set, use that one instead]" \
- "--prefix[Set the source prefix]:path:_files -/" \
- "--dst-prefix[Set the destination prefix]:path:_files -/" \
- "--ignore-missing[Ignore missing files when setting a new implementation]" && return 0
+_eselect_action_index() {
+ if [[ $service == "eselect" ]] ; then
+ echo 2
+ else
+ echo 1
fi
- _values "opengl options" $common_values \
- "list[List the available OpenGL implementations]" \
- "set[Select the OpenGL implementation]" \
- "show[Print the current OpenGL implementation]" && return 0
+}
+_eselect_get_action () {
+ echo ${line[$(_eselect_action_index)]}
+}
+
+_eselect_action() {
+ _eselect_module_action $(_eselect_get_module)
+}
+
+_eselect_module() {
+ _eselect_parse_generic
}
-_eselect_vi () {
- local vilist
- if (( $words[(I)(set)] )); then
- vilist=(${(f)"$(eselect --brief --color=no vi list)"})
- _values -w "vi implementation" $vilist[@] && return 0
- elif (( $words[(I)(update)] )); then
- _values -w "option" "--if-unset[Do not override existing implementation]" && return 0
+_eselect_complete_action_generic() {
+ local -a sel_items
+ local -a unsel_items
+
+ if (( $NORMARG + $(_eselect_action_index) == $CURRENT )) ; then
+ case "$(_eselect_get_action)" in
+ ("set"|"enable"))
+ _eselect_parse_action_list $1 sel_items unsel_items
+ if (( $#unsel_items + $#sel_items > 0 )) ; then
+ _describe -t eselect_sel -V 'eselect items' unsel_items
+ if (( $#unsel_items + $#sel_items < 10 )) ; then
+ _describe -t eselect_unsel -V 'eselect already selected items' sel_items
+ fi
+ return 0
+ fi
+ ;;
+ ("remove"|"disable"))
+ _eselect_parse_action_list $1 sel_items unsel_items
+ if [[ -n "${sel_items[@]}" ]] ; then
+ _describe -V 'eselect items' sel_items
+ return 0
+ fi
+ ;;
+ esac
fi
- _values "vi options" $common_values \
- "list[List available vi implementations]" \
- "set[Set a new vi implementation provider]" \
- "show[Show the current vi implementation]" \
- "update[Automatically update the vi provider]"
+
+ _nothing
}
-_eselect_news() {
-
- ## TODO: Normal numeric sorting.
- ## I've spent many time on trying to rewrite this
- ## function to normally sort (to DO NOT sort, actually) items,
- ## but it growing bigger and bigger and going to be too complicated.
- ## So, I (mva) either need to help to make it in the "right way".
- ## Or, maybe, to completely rewrite this compdef.
-
- local -a newslist;
- if ((CURRENT == 3)); then
- _values 'news options' $stdopts[@] \
- 'list[List news items]' \
- 'count[Display number of news items]' \
- 'purge[Purge read news]' \
- 'read[Read news items]' \
- 'unread[Mark read news items as unread again]' && return 0
- elif ((CURRENT == 4)); then
- if (( $words[(I)(count)] )); then
- _values -w 'news' 'new[Count only new news items]' 'all[Count all news items]' && return 0
- fi
+# custom completions:
+(( $+functions[_eselect_complete_news_action] )) || _eselect_complete_news_action() {
+ local -a items
- newslist=(${${${${${${${(M)${(f)"$(eselect --color=no news list)"}## *}// \**/}/ \[/}/\] ##/\[}/%/]}/ \[/ (}/\] /) })
+ case "$(_eselect_get_action)" in
+ ("read"|"unread"))
+ local -a extra_items=('all:Read all news items')
+ if [[ $(_eselect_get_action) == "read" ]] ; then
+ extra_items=('new:Read unread news items (default)' "${extra_items[@]}")
+ fi
+ _eselect_parse_action_list news items items
- if (( $words[(I)(read)] )); then
- newslist+=( "new[Read unread news items (default)]" "all[Read all news items]" "--mbox[Output in mbox format]" "--quiet[Suppress output, only change status]" "--raw[Output in raw format]" )
- fi;
+ items=(${(q)extra_items[@]} ${(Oa)items})
+ if [[ -n "${items[@]}" ]] ; then
+ _describe -V 'eselect items' items
+ return 0
+ fi
+ ;;
+ esac
- if (( $words[(I)(unread)] )); then
- newslist+=( "all[Unread all news items]" )
- fi
+ _nothing
+}
- _values -w 'news' $newslist[@] && return 0
+(( $+functions[_eselect_complete_kernel_action] )) || _eselect_complete_kernel_action() {
+ local -a items
+
+ if (( $NORMARG + $(_eselect_action_index) == $CURRENT )) ; then
+ case "$(_eselect_get_action)" in
+ "set")
+ for k in ${(@f)$(eselect --colour=no --brief kernel list)} ; do
+ items+=${k#linux-}
+ done
+ local -a expl=(-P linux-)
+ compadd -V 'eselect kernel' -P linux- ${items[@]}
+ return 0
+ ;;
+ esac
fi
+
+ _nothing
}
-_eselect () {
- local globopts modnames modopts
-
- globopts=(
- "--brief[Make output shorter]"
- "--colour=no[Disable coloured output]"
- "--color=no[Disable coloured output]"
- )
- modnames=(${${${(M)${(f)"$(eselect --brief --color=no modules list)"}## *}// */}// /})
-
- if ((CURRENT == 2)); then
- _arguments -s \
- "$globopts[@]" \
- "*:portage:_values 'eselect modules' \$modnames[@]" && return 0
- elif ((CURRENT == 3)); then
- if [[ $words[2] == --colour=no || $words[2] == --color=no ]]; then
- _arguments -s \
- "*:portage:_values 'eselect modules' \$modnames[@]" && return 0
- elif (( $modnames[(I)$words[2]] )); then
- if [[ "$words[2]" == (env|binutils|kernel|ctags|profile|fontconfig|opengl|vi|news) ]]; then
- _eselect_$words[2] "$@"
- else
- modopts=(${${${(M)${(f)"$(eselect --brief --color=no $words[2] usage)"}## *}// */}// /})
- _arguments -s \
- "*:portage:_values 'eselect $words[2] options' \$modopts[@]" && return 0
- fi
- fi
- elif ((CURRENT >= 4)); then
- if (( $words[(I)(--color=no|--colour=no)] )); then
- if (( $modnames[(I)$words[3]] )); then
- if [[ "$words[3]" == (env|binutils|kernel|ctags|profile|fontconfig|opengl|vi|news) ]]; then
- _eselect_$words[3] "$@"
- else
- modopts=(${${${${(M)${(f)"$(eselect --brief --color=no $words[3] usage)"}## *}// */}// /}// *})
- _arguments -s \
- "*:portage:_values 'eselect $words[3] options' \$modopts[@]" && return 0
- fi
- fi
- else
- if (( $modnames[(I)$words[2]] )); then
- (( $+functions[_eselect_$words[2]] )) && _eselect_$words[2] "$@"
- fi
- fi
+(( $+functions[_eselect_complete_profile_action] )) || _eselect_complete_profile_action() {
+ if (( $NORMARG + $(_eselect_action_index) == $CURRENT )) ; then
+ case "$(_eselect_get_action)" in
+ "set")
+ _values 'eselect profiles' $(eselect --colour=no --brief profile list)
+ return 0
+ ;;
+ esac
fi
+
+ _nothing
+}
+
+(( $+functions[_eselect_complete_timezone_action] )) || _eselect_complete_timezone_action() {
+ if (( $NORMARG + $(_eselect_action_index) == $CURRENT )) ; then
+ case "$(_eselect_get_action)" in
+ "set")
+ _multi_parts / "($(eselect --colour=no --brief timezone list))"
+ return 0
+ ;;
+ esac
+ fi
+
+ _nothing
+}
+
+eselect_comp() {
+ integer NORMARG
+
+ case "$service" in
+ eselect)
+ _arguments -A '-*' -n \
+ '--brief[Make output shorter]' \
+ '(--colour --color)'--colo{,u}r='[Enable or disable colour output]:colour:(yes no)' \
+ '1:eselect_module:_eselect_module' \
+ '2:eselect_action:_eselect_action' \
+ '*:eselect_complete_action:_eselect_complete_action'
+ ;;
+ *-config)
+ _arguments -n \
+ "1:action:_eselect_action" \
+ '*:eselect_complete_action:_eselect_complete_action'
+ ;;
+ esac
}
-_eselect "$@"
+eselect_comp "$@"
# vim: set et sw=2 ts=2 ft=zsh:
diff --git a/src/_gentoo_packages b/src/_gentoo_packages
index 37539c8..c2d9d36 100644
--- a/src/_gentoo_packages
+++ b/src/_gentoo_packages
@@ -58,7 +58,7 @@ _parsesetsconf() {
_gentoo_packages_update_installed_sets() {
local sets
- sets=($(</var/lib/portage/world_sets))
+ sets=($(<${EPREFIX}/var/lib/portage/world_sets))
if [[ ((${#sets} > 0)) ]]; then
_wanted installed_sets expl 'installed set' compadd "$@" "${(o@)^sets}"
fi
@@ -67,7 +67,7 @@ _gentoo_packages_update_installed_sets() {
_gentoo_packages_update_available_sets() {
local dirs dir sets_dir set sets sets_path sets_files
- dirs=($(_gentoo_repos -o) /etc/portage /usr/share/portage/config)
+ dirs=($(_gentoo_repos -o) ${EPREFIX}/etc/portage ${EPREFIX}/usr/share/portage/config)
for dir in ${(@)dirs}; do
if [[ -d ${dir} ]]; then
@@ -104,10 +104,10 @@ _gentoo_packages_update_useflag(){
_gentoo_packages_update_active_useflag(){
local flags USE
var=USE
- [[ -z ${(P)var} && -r /etc/portage/make.conf ]] &&
- local $var="$(. /etc/portage/make.conf 2>/dev/null; echo ${(P)var})"
- [[ -z ${(P)var} && -r /etc/make.conf ]] &&
- local $var="$(. /etc/make.conf 2>/dev/null; echo ${(P)var})"
+ [[ -z ${(P)var} && -r ${EPREFIX}/etc/portage/make.conf ]] &&
+ local $var="$(. ${EPREFIX}/etc/portage/make.conf 2>/dev/null; echo ${(P)var})"
+ [[ -z ${(P)var} && -r ${EPREFIX}/etc/make.conf ]] &&
+ local $var="$(. ${EPREFIX}/etc/make.conf 2>/dev/null; echo ${(P)var})"
flags=(${${${=USE}%-*}%\\*})
compadd $flags
}
@@ -122,7 +122,7 @@ _gentoo_packages_update_category(){
_gentoo_packages_update_installed(){
local installed_dir installed_portage installed_pkgname installed_list
- installed_dir="/var/db/pkg"
+ installed_dir="${EPREFIX}/var/db/pkg"
installed_portage=($installed_dir/*-*/*)
installed_pkgname=(${${installed_portage:t}%%-[0-9]*})
@@ -135,7 +135,7 @@ _gentoo_packages_update_installed(){
_gentoo_packages_update_installed_versions(){
local installed_list installed_portage
- installed_portage=(/var/db/pkg/*-*/*)
+ installed_portage=(${EPREFIX}/var/db/pkg/*-*/*)
_wanted packages expl 'package' compadd "$@" ${installed_portage:t}
installed_list=(${installed_portage##*/pkg/})
@@ -196,12 +196,12 @@ _gentoo_packages_update_available_versions(){
_gentoo_packages_update_binary() {
local PKGDIR
- [[ -z $PKGDIR && -r /etc/portage/make.conf ]] &&
- PKGDIR="$(. /etc/portage/make.conf 2>/dev/null; echo $PKGDIR)"
- [[ -z $PKGDIR && -r /etc/make.conf ]] &&
- PKGDIR="$(. /etc/make.conf 2>/dev/null; echo $PKGDIR)"
- [[ -z $PKGDIR && -r /usr/share/portage/config/make.globals ]] &&
- PKGDIR="$(. /usr/share/portage/config/make.globals 2>/dev/null; echo $PKGDIR)"
+ [[ -z $PKGDIR && -r ${EPREFIX}/etc/portage/make.conf ]] &&
+ PKGDIR="$(. ${EPREFIX}/etc/portage/make.conf 2>/dev/null; echo $PKGDIR)"
+ [[ -z $PKGDIR && -r ${EPREFIX}/etc/make.conf ]] &&
+ PKGDIR="$(. ${EPREFIX}/etc/make.conf 2>/dev/null; echo $PKGDIR)"
+ [[ -z $PKGDIR && -r ${EPREFIX}/usr/share/portage/config/make.globals ]] &&
+ PKGDIR="$(. ${EPREFIX}/usr/share/portage/config/make.globals 2>/dev/null; echo $PKGDIR)"
# this doesn't take care of ${PORTAGE_BINHOST}. If Gentoo official
# binary mirror will be available we should rewrite it accordingly.
diff --git a/src/_gentoo_repos b/src/_gentoo_repos
index 85f3936..e5acf36 100644
--- a/src/_gentoo_repos
+++ b/src/_gentoo_repos
@@ -11,22 +11,22 @@ _gentoo_repos() {
overlay_paths=();
result=();
- if [[ -e /usr/share/portage/config/repos.conf || -e /etc/portage/repos.conf ]]; then
- main_repo=$(_repos_conf DEFAULT main-repo)
- main_repo_path=$(_repos_conf ${main_repo} location)
+ if [[ -e ${EPREFIX}/usr/share/portage/config/repos.conf || -e ${EPREFIX}/etc/portage/repos.conf ]]; then
+ main_repo=$(_gentoo_repos_conf DEFAULT main-repo)
+ main_repo_path=$(_gentoo_repos_conf ${main_repo} location)
- for overlay in $(_repos_conf -l); do
- overlay_paths+=($(_repos_conf ${overlay} location))
+ for overlay in $(_gentoo_repos_conf -l); do
+ overlay_paths+=($(_gentoo_repos_conf ${overlay} location))
done
- source /etc/make.conf 2>/dev/null
- source /etc/portage/make.conf 2>/dev/null
+ source ${EPREFIX}/etc/make.conf 2>/dev/null
+ source ${EPREFIX}/etc/portage/make.conf 2>/dev/null
overlay_paths+=(${(@)PORTDIR_OVERLAY})
else
- source /usr/share/portage/config/make.globals 2>/dev/null
- source /etc/make.conf 2>/dev/null
- source /etc/portage/make.conf 2>/dev/null
+ source ${EPREFIX}/usr/share/portage/config/make.globals 2>/dev/null
+ source ${EPREFIX}/etc/make.conf 2>/dev/null
+ source ${EPREFIX}/etc/portage/make.conf 2>/dev/null
main_repo_path="${PORTDIR}"
overlay_paths=(${(@)PORTDIR_OVERLAY})
@@ -43,50 +43,6 @@ _gentoo_repos() {
echo ${(u)result}
}
-_repos_conf() {
- local v file insection section arr secname
-
- secname=();
-
- for file in /usr/share/portage/config/repos.conf \
- /etc/portage/repos.conf \
- /etc/portage/repos.conf/*.conf; do
-
- [[ -f ${file} ]] || continue
- insection=0
- declare -A arr
- IFS='= '
-
- while read -r name value; do
- [[ -z ${name} || ${name} == '#'* ]] && continue
-
- if [[ (${name} == '['*']') && (-z ${value}) ]]; then
- value=${name//(\]|\[)}
- name="section"
- fi
- arr[${name}]=${value}
-
- if [[ ${insection} == 1 && ${name} == "section" ]]; then
- break
- elif [[ ${name} == "section" ]]; then
- [[ ${value} == ${1} ]] && insection=1
- secname+=(${value})
- elif [[ ${insection} == 1 ]]; then
- if [[ ${name} == ${2} ]]; then
- v=${value}
- fi
- fi
- continue
- done < ${file}
- done
-
- if [[ ${1} == "-l" ]]; then
- echo "${(@u)secname}"
- else
- echo "${v}"
- fi
-}
-
_gentoo_repos "$@"
# vim: set et sw=2 ts=2 ft=zsh:
diff --git a/src/_gentoo_repos_conf b/src/_gentoo_repos_conf
new file mode 100644
index 0000000..3dad709
--- /dev/null
+++ b/src/_gentoo_repos_conf
@@ -0,0 +1,55 @@
+#autoload
+
+# Usage:
+# _gentoo_repos_conf -l -> returns the list of all repos names
+# _gentoo_repos_conf REPO ATTRIBUTE -> returns the VALUE associated
+# with the ATTRIBUTE of the REPO
+
+_gentoo_repos_conf() {
+ local v file insection section arr secname
+
+ secname=();
+
+
+ for file in ${EPREFIX}/usr/share/portage/config/repos.conf \
+ ${EPREFIX}/etc/portage/repos.conf \
+ ${EPREFIX}/etc/portage/repos.conf/*.conf; do
+
+ [[ -f ${file} ]] || continue
+ insection=0
+ declare -A arr
+ IFS='= '
+
+ while read -r name value; do
+ [[ -z ${name} || ${name} == '#'* ]] && continue
+
+ if [[ (${name} == '['*']') && (-z ${value}) ]]; then
+ value=${name//(\]|\[)}
+ name="section"
+ fi
+ arr[${name}]=${value}
+
+ if [[ ${insection} == 1 && ${name} == "section" ]]; then
+ break
+ elif [[ ${name} == "section" ]]; then
+ [[ ${value} == ${1} ]] && insection=1
+ secname+=(${value})
+ elif [[ ${insection} == 1 ]]; then
+ if [[ ${name} == ${2} ]]; then
+ v=${value}
+ fi
+ fi
+ continue
+ done < ${file}
+ done
+
+ if [[ ${1} == "-l" ]]; then
+ echo "${(@u)secname}"
+ else
+ echo "${v}"
+ fi
+}
+
+_gentoo_repos_conf "$@"
+
+# vim: set et sw=2 ts=2 ft=zsh:
diff --git a/src/_gentoolkit b/src/_gentoolkit
index fdad29f..ce5ada4 100644
--- a/src/_gentoolkit
+++ b/src/_gentoolkit
@@ -204,7 +204,7 @@ _equery () {
{size,s}'[print size of files contained in package]'
{uses,u}'[display USE flags for package]'
{which,w}'[print full path to ebuild for package]'
- {has,a}'[list all packages matching ENVIRONMENT data stored in /var/db/pkg]'
+ {has,a}'[list all installed packages where specified KEY matches the specified VALUE]'
{keywords,y}'[display keywords for specified PKG]'
{meta,m}'[display metadata about PKG]'
)
@@ -357,7 +357,7 @@ _glsa_id () {
# will be low. May be we should display only the X previous GLSA,
# or GLSA ids of the X last month.
#
- # start to look at /usr/lib/gentoolkit/pym/glsa.py if GLSA_DIR is still
+ # start to look at ${EPREFIX}/usr/lib/gentoolkit/pym/glsa.py if GLSA_DIR is still
# PORTDIR + "metadata/glsa/"
# and then get the list (it's only xml files in GLSA_DIR, easy!)
diff --git a/src/_portage b/src/_portage
index 1c43ac4..8700829 100644
--- a/src/_portage
+++ b/src/_portage
@@ -1,33 +1,51 @@
#compdef emerge ebuild quickpkg emaint env-update etc-update portageq repoman
_ebuild () {
- if (( CURRENT == 2 )); then
- _files -g \*.ebuild
- elif (( CURRENT > 2 )); then
- _values "ebuild command" \
- 'clean[Cleans the temporary build directory]' \
- 'help[Show help]' \
- 'setup[Run all package specific setup actions and exotic system checks.]' \
- 'fetch[Fetch all necessary files]' \
- 'digest[Creates a digest file for the package]' \
- 'unpack[Extracts the sources to a subdirectory in the build directory]' \
- 'prepare[Prepares the extracted sources by running the src_prepare()]' \
- 'configure[Configures the extracted sources by running the src_configure()]' \
- 'compile[Compiles the extracted sources by running the src_compile()]' \
- 'test[Runs package-specific test cases to verify that everything was built properly]' \
- 'preinst[Run specific actions that need to be done before installation]' \
- 'install[Installs the package to the temporary install directory]' \
- 'postinst[Run specific actions that need to be done after installation]' \
- 'qmerge[Installs the package de the filesystem]' \
- 'merge[perform the following actions: fetch, unpack, compile, install and qmerge.]' \
- 'unmerge[Remove the installed files of the packages]' \
- 'prerm[Run specific actions that need to be executed before unmerge]' \
- 'postrm[Run specific actions that need to be executed after unmerge]' \
- 'config[Run specific actions needed to be executed after the emerge process has completed.]' \
- 'package[This command is a lot like the merge command, but create a .tbz2 package]' \
- 'manifest[Updates the manifest file for the package.]' \
- 'rpm[Builds a RedHat RPM package]'
- fi
+ local state
+ local expl=(-Vx)
+ local optional_args=(
+ '--skip-manifest[skip all manifest checks]'
+ '--debug[run bash with the -x option]'
+ '--color=[enable or disable color output]:yes/no:((y\:yes n\:no))'
+ '--ignore-default-opts[ignore $EBUILD_DEFAULT_OPTS]'
+ '--force[forces regeneration all associated distfiles if used with digest or or manifest command]'
+ )
+
+ _arguments -O expl -C $optional_args "1:ebuild file:_files -g \*.ebuild" "*:ebuild command:->ebuild_cmd"
+
+ case $state in
+ (ebuild_cmd)
+
+ local ebuild_cmds=(
+ 'clean[Cleans the temporary build directory]'
+ 'help[Show help]'
+ 'setup[Run all package specific setup actions and exotic system checks]'
+ 'fetch[Fetch all necessary files]'
+ 'digest[Creates a digest file for the package]'
+ 'unpack[Extracts the sources to a subdirectory in the build directory]'
+ 'prepare[Prepares the extracted sources by running the src_prepare()]'
+ 'configure[Configures the extracted sources by running the src_configure()]'
+ 'compile[Compiles the extracted sources by running the src_compile()]'
+ 'test[Runs package-specific test cases to verify that everything was built properly]'
+ 'preinst[Run specific actions that need to be done before installation]'
+ 'install[Installs the package to the temporary install directory]'
+ 'postinst[Run specific actions that need to be done after installation]'
+ 'qmerge[Installs the package de the filesystem]'
+ 'merge[perform the following actions: fetch, unpack, compile, install and qmerge]'
+ 'unmerge[Remove the installed files of the packages]'
+ 'prerm[Run specific actions that need to be executed before unmerge]'
+ 'postrm[Run specific actions that need to be executed after unmerge]'
+ 'config[Run specific actions needed to be executed after the emerge process has completed]'
+ 'package[This command is a lot like the merge command, but create a .tbz2 package]'
+ 'manifest[Updates the manifest file for the package]'
+ 'rpm[Builds a RedHat RPM package]'
+ )
+
+ local curcontext="ebuild_cmd"
+ zstyle -t ":completion:${curcontext}:values:values" sort || zstyle ":completion:${curcontext}:values:values" sort false
+ _values -w "ebuild command" "$ebuild_cmds[@]"
+ ;;
+ esac
}
_quickpkg () {
@@ -186,6 +204,8 @@ _emerge () {
"(: $all[3,-1])--resume[Resumes the last merge operation]"
"(: $all[3,-1])--skipfirst[Removes the first package in the resume list]"
"($all)--keep-going[Continue merge even if a package fails to build]"
+ "--with-bdeps=[pull in build time dependencies that are not strictly required]:yes/no:((y\:'yes' n\:'no'))"
+ "--with-test-deps=[pull in dependencies that are conditional on the \"testUSE flag]:yes/no:((y\:'yes' n\:'no'))"
)
profiles=(
@@ -235,11 +255,76 @@ _emerge () {
}
_emaint () {
- _arguments -s \
+ local state
+ local chk_opt fix_opt pretend_opt clean_opt purge_opt log_extra_opt repo_opt
+ local sync_opt sync_extra_opt standalone_opt exclusive_cmd_opt repos
+ local allcmd logcmd synccmd mergecmd fixcmds
+ chk_opt=(-c --check)
+ fix_opt=(-f --fix)
+ pretend_opt=(-p --pretend)
+ clean_opt=(-C --clean)
+ purge_opt=(-P --purge)
+ log_extra_opt=(-t --time)
+ repo_opt=(-r --repo)
+ sync_opt=(-a --auto -A --allrepos)
+ sync_extra_opt=(--sync-submodule $repo_opt)
+
+ standalone_opt=(-h --help --version)
+ exclusive_cmd_opt=($chk_opt $fix_opt $sync_opt $purge_opt $pretend_opt $standalone_opt)
+ repos=$(_gentoo_repos_conf -l)
+
+ _arguments -C \
"(: -)"{-h,--help}'[show help message and exit]' \
+ "($sync_extra_opt $log_extra_opt $exclusive_cmd_opt $clean_opt)"{-f,--fix}"[Fix any problems that may exist]" \
"(: -)"--version"[show program's version number and exit]" \
- '(-c --check -f --fix)'{-c,--check}"[Check for any problems that may exist]:emaint:((all\:'check all' world\:'check only world file'))" \
- '(-c --check -f --fix)'{-f,--fix}"[Fix any problems that may exist]:emaint:((all\:'check all' world\:'check only world file'))"
+ "($sync_extra_opt $exclusive_cmd_opt)"{-c,--check}"[check for any problems that may exist]" \
+ "($fix_opt $purge_opt $sync_opt $sync_extra_opt $standalone_opt -t --time)"{-t,--time}"[(cleanlogs only)changes the minimum age NUM (in days) of the logs to be listed or deleted]" \
+ "($sync_extra_opt $exclusive_cmd_opt)"{-p,--pretend}"[output logs that would be deleted (cleanlogs only)]" \
+ "($fix_opt $sync_opt $sync_extra_opt $purge_opt)"{-C,--clean}"[cleans the logs from \$PORT_LOGDIR (cleanlogs only)]" \
+ "($log_extra_opt $sync_extra_opt $exclusive_cmd_opt $clean_opt)"{-P,--purge}"[removes the list of previously failed merges (merges only)]" \
+ "($repo_opt $log_extra_opt $exclusive_cmd_opt $clean_opt)"{-a,--auto}"[sync repositories which have their auto-sync setting set (sync module only)]" \
+ "($chk_opt $fix_opt $purge_opt $pretend_opt $log_extra_opt $clean_opt $standalone_opt)*"{-r,--repo}"=[Sync the specified repo]:gentoo repo:($repos)" \
+ "($repo_opt $log_extra_opt $exclusive_cmd_opt $clean_opt)"{-A,--allrepos}"[Sync all repos that have a sync-url defined (sync module only)]" \
+ "($chk_opt $fix_opt $purge_opt $pretend_opt $log_extra_opt $clean_opt $standalone_opt)*--sync-submodule=[restrict sync to the specified submodule (sync module only)]:portage submodule:(glsa news profiles)" \
+ "1:emaint commands:->emaint_cmd"
+
+ case $state in
+ (emaint_cmd)
+ local descr="emaint commands"
+
+ local cmd=(
+ 'all:perform all supported commands that accept the specified option'
+ 'logs:clean out old logs from the $PORT_LOGDIR'
+ 'sync:perform sync actions on specified repositories'
+ 'merges:scan for failed package merges and attempt to fix those failed packages'
+ 'binhost:generate a metadata index for binary packages located in $PKGDIR'
+ 'cleanconfmem:discard no longer installed config tracker entries'
+ 'cleanresume:discard merge lists saved for the emerge --resume action'
+ 'movebin:perform package move updates for binary packages located in $PKGDIR'
+ 'moveinst:perform package move updates for installed packages'
+ 'world:fix problems in the world file'
+ )
+
+ local -a remove
+ if (( $words[(I)(-f|--fix)] )); then
+ remove=(${cmd[(r)logs:*]} ${cmd[(r)sync:*})
+ elif (( $words[(I)(-c|--check)] )); then
+ remove=(${cmd[(r)sync:*]})
+ elif (( $words[(I)(-p|--pretend|-C|--clean|-t|--time)] )); then
+ cmd=(${cmd[(r)logs:*]})
+ elif (( $words[(I)(-a|--auto|-A|--allrepos|-r=*|--repo=*|-r|--repo|--sync-submodule|--sync-submodule=*)] )); then
+ cmd=(${cmd[(r)sync:*]})
+ elif (( $words[(I)(--purge|-P)] )); then
+ cmd=(${cmd[(r)merges:*]})
+ else
+ remove=(${cmd[(r)sync:*]})
+ fi
+
+ cmd=(${cmd:|remove})
+ _describe $descr cmd
+
+ ;;
+ esac
}
_env-update () {
diff --git a/src/_portage_utils b/src/_portage_utils
index 4c41e16..9077f30 100644
--- a/src/_portage_utils
+++ b/src/_portage_utils
@@ -98,7 +98,7 @@ case $service in
{'(--repo)-R','(-R)--repo'}'[Display installed packages with repository]' \
{'(--umap)-U','(-U)--umap'}'[Display installed packages with flags used]' \
{'(--columns)-c','(-c)--columns'}'[Display column view]' \
- '--show-debug[Show /usr/lib/debug files]' \
+ '--show-debug[Show debug files]' \
{'(--exact)-e','(-e)--exact'}'[Exact match (only CAT/PN or PN without PV)]' \
{'(--all)-a','(-a)--all'}'[Show every installed package]' \
{'(--dir)-d','(-d)--dir'}'[Only show directories]' \
@@ -115,7 +115,7 @@ case $service in
{'(--unlist)-u','(-u)--unlist'}'[Show unmerge history]' \
{'(--sync)-s','(-s)--sync'}'[Show sync history]' \
{'(--current)-c','(-c)--current'}'[Show current emerging packages]' \
- {'(--logfile)-f','(-f)--logfile'}'[Read emerge logfile instead of /var/log/emerge.log]:log:_files' \
+ {'(--logfile)-f','(-f)--logfile'}'[Read emerge logfile instead of $EMERGE_LOG_DIR/emerge.log]:log:_files' \
'*:packages:_gentoo_packages available'
;;
qsearch)
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2020-02-19 17:53 Vadim Misbakh-Soloviov
0 siblings, 0 replies; 52+ messages in thread
From: Vadim Misbakh-Soloviov @ 2020-02-19 17:53 UTC (permalink / raw
To: gentoo-commits
commit: d6623d289f0ab014cdff8fce69ab277bb125d424
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Thu Dec 7 19:32:25 2017 +0000
Commit: Vadim Misbakh-Soloviov <mva <AT> gentoo <DOT> org>
CommitDate: Wed Feb 19 16:57:33 2020 +0000
URL: https://gitweb.gentoo.org/proj/zsh-completion.git/commit/?id=d6623d28
remove OpenRC completions
OpenRC will provide these completions starting with version 0.35.
Signed-off-by: Vadim A. Misbakh-Soloviov <git <AT> mva.name>
src/_openrc | 87 -------------------------------------------------------------
1 file changed, 87 deletions(-)
diff --git a/src/_openrc b/src/_openrc
deleted file mode 100644
index f467f1a..0000000
--- a/src/_openrc
+++ /dev/null
@@ -1,87 +0,0 @@
-#compdef rc-update rc-status rc rc-service
-
-# openrc-0.12.4
-
-local gentoo_runlevels
-gentoo_runlevels=(/etc/runlevels/*(:t))
-
-case "$service" in
- rc-service)
- if (( CURRENT == 2 )); then
- _arguments -s \
- '(-e --exists)'{-e,--exists}"[tests if the service exists or not]" \
- '(-l --list)'{-l,--list}'[list all available services]' \
- '(-r --resolve)'{-r,--resolve}'[resolve the service name to an init script]' \
- '(-C --nocolor)'{-C,--nocolor}'[Disable color output]' \
- '(-v --verbose)'{-v,--verbose}'[Run verbosely]' \
- '(-q --quiet)'{-q,--quiet}'[Run quietly]'
- _values "service" /etc/init.d/*~*.sh(:t)
- else
- case $words[2] in
- -e|--exists|-r|--resolve)
- (( CURRENT > 3 )) && return 0
- _values "service" /etc/init.d/*~*.sh(:t)
- ;;
- -*)
- return 0
- ;;
- *)
- _values "action" stop start restart describe zap
- ;;
- esac
- fi
- ;;
- rc-update)
- local used_init
- used_init=(${=${(M)${(f)"$(/sbin/rc-update show 2>/dev/null)"}:#*|*[a-z]*}% |*})
-
- if (( CURRENT == 2 )); then
- _values "rc-update actions" \
- 'add[Add script to a runlevel]' \
- 'del[Delete script from a runlevel]' \
- 'show[Show scripts lanched at a runlevel]' \
- '-a[Add script to a runlevel]' \
- '-d[Delete script from a runlevel]' \
- '-s[Show scripts lanched at a runlevel]'
- elif (( CURRENT == 3 )); then
- case "$words[2]" in
- add|-a)
- _values "service" /etc/init.d/*~*.sh(:t)
- ;;
- del|-d)
- _values "service" $used_init
- ;;
- show|-s)
- _values "runlevels" $gentoo_runlevels \
- '-v[Show all init scripts]' \
- '--verbose[Show all init scripts]'
- ;;
- esac
- elif (( CURRENT == 4 )); then
- _values "runlevels" $gentoo_runlevels
- fi
- ;;
- rc-status)
- _arguments -s \
- {'(--all)-a','(-a)--all'}'[Show services at all runlevels]' \
- {'(--crashed)-c','(-c)--crashed'}'[Show crashed services]' \
- {'(--list)-l','(-l)--list'}'[Show list of runlevels]' \
- {'(--runlevel)-r','(-r)--runlevel'}'[Show the name of the current runlevel]' \
- {'(--servicelist)-s','(-s)--servicelist'}'[Show all services]' \
- {'(--unused)-u','(-u)--unused'}'[Show services not assigned to any run level]' \
- {'(--help)-h','(-h)--help'}'[Print this help output]' \
- {'(--nocolor)-C','(-C)--nocolor'}'[Disable color output]' \
- {'(--version)-V','(-V)--version'}'[Display software version]' \
- {'(--verbose)-v','(-v)--verbose'}'[Run verbosely]' \
- {'(--quiet)-q','(-q)--quiet'}'[Run quietly (Does not affect errors)]'
-
- _values 'runlevels' $gentoo_runlevels
- ;;
- rc)
- if (( CURRENT == 2 )); then
- _values "runlevels" $gentoo_runlevels
- fi
- ;;
-esac
-
-# vim: set et sw=2 ts=2 ft=zsh:
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2020-02-19 17:53 Vadim Misbakh-Soloviov
0 siblings, 0 replies; 52+ messages in thread
From: Vadim Misbakh-Soloviov @ 2020-02-19 17:53 UTC (permalink / raw
To: gentoo-commits
commit: d58e7b56793b1bf5efce066d9a6c549b8d495700
Author: otakuto <otakuto893 <AT> gmail <DOT> com>
AuthorDate: Mon Nov 13 07:12:08 2017 +0000
Commit: Vadim Misbakh-Soloviov <mva <AT> gentoo <DOT> org>
CommitDate: Wed Feb 19 17:46:38 2020 +0000
URL: https://gitweb.gentoo.org/proj/zsh-completion.git/commit/?id=d58e7b56
_portage: add configure and prepare,test completions
Signed-off-by: Vadim A. Misbakh-Soloviov <git <AT> mva.name>
src/_portage | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/_portage b/src/_portage
index ed2ade5..1c43ac4 100644
--- a/src/_portage
+++ b/src/_portage
@@ -11,7 +11,10 @@ _ebuild () {
'fetch[Fetch all necessary files]' \
'digest[Creates a digest file for the package]' \
'unpack[Extracts the sources to a subdirectory in the build directory]' \
+ 'prepare[Prepares the extracted sources by running the src_prepare()]' \
+ 'configure[Configures the extracted sources by running the src_configure()]' \
'compile[Compiles the extracted sources by running the src_compile()]' \
+ 'test[Runs package-specific test cases to verify that everything was built properly]' \
'preinst[Run specific actions that need to be done before installation]' \
'install[Installs the package to the temporary install directory]' \
'postinst[Run specific actions that need to be done after installation]' \
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2015-04-28 14:56 Vadim A. Misbakh-Soloviov
0 siblings, 0 replies; 52+ messages in thread
From: Vadim A. Misbakh-Soloviov @ 2015-04-28 14:56 UTC (permalink / raw
To: gentoo-commits
commit: 9737be28efe8cf3668d4f0625382f9184db4c49a
Author: Vadim A. Misbakh-Soloviov <git <AT> mva <DOT> name>
AuthorDate: Tue Apr 28 14:55:39 2015 +0000
Commit: Vadim A. Misbakh-Soloviov <mva <AT> mva <DOT> name>
CommitDate: Tue Apr 28 14:55:39 2015 +0000
URL: https://gitweb.gentoo.org/proj/zsh-completion.git/commit/?id=9737be28
_gentoo_repos: some algo rework. Probably fixes #3
Signed-off-by: Vadim A. Misbakh-Soloviov <git <AT> mva.name>
src/_gentoo_repos | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/src/_gentoo_repos b/src/_gentoo_repos
index 7f88a64..85f3936 100644
--- a/src/_gentoo_repos
+++ b/src/_gentoo_repos
@@ -6,9 +6,12 @@
# _gentoo_repos -o -> returns the list of non-main repos
_gentoo_repos() {
- local main_repo main_repo_path overlay overlay_paths
+ local main_repo main_repo_path overlay overlay_paths result
- if [[ -e /usr/share/portage/config/repos.conf ]]; then
+ overlay_paths=();
+ result=();
+
+ if [[ -e /usr/share/portage/config/repos.conf || -e /etc/portage/repos.conf ]]; then
main_repo=$(_repos_conf DEFAULT main-repo)
main_repo_path=$(_repos_conf ${main_repo} location)
@@ -30,16 +33,20 @@ _gentoo_repos() {
fi
if [[ $1 == "-m" ]]; then
- echo "${main_repo_path}"
+ result+=(${main_repo_path})
elif [[ $1 == "-o" ]]; then
- echo "${(@u)overlay_paths}"
+ result+=(${(@)overlay_paths})
else
- echo "${main_repo_path} ${(@u)overlay_paths}"
+ result+=(${main_repo_path} ${(@)overlay_paths})
fi
+
+ echo ${(u)result}
}
_repos_conf() {
- local v file insection section arr
+ local v file insection section arr secname
+
+ secname=();
for file in /usr/share/portage/config/repos.conf \
/etc/portage/repos.conf \
@@ -74,7 +81,7 @@ _repos_conf() {
done
if [[ ${1} == "-l" ]]; then
- echo "${(@)secname}"
+ echo "${(@u)secname}"
else
echo "${v}"
fi
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2015-04-28 12:07 Vadim A. Misbakh-Soloviov
0 siblings, 0 replies; 52+ messages in thread
From: Vadim A. Misbakh-Soloviov @ 2015-04-28 12:07 UTC (permalink / raw
To: gentoo-commits
commit: 0371426220fd99b10cdb3b598dfa5055544ecc46
Author: Vadim A. Misbakh-Soloviov <git <AT> mva <DOT> name>
AuthorDate: Tue Apr 28 12:07:25 2015 +0000
Commit: Vadim A. Misbakh-Soloviov <mva <AT> mva <DOT> name>
CommitDate: Tue Apr 28 12:07:25 2015 +0000
URL: https://gitweb.gentoo.org/proj/zsh-completion.git/commit/?id=03714262
_gentoolkit: fixed #5
Signed-off-by: Vadim A. Misbakh-Soloviov <git <AT> mva.name>
src/_gentoolkit | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/_gentoolkit b/src/_gentoolkit
index acba5f6..fdad29f 100644
--- a/src/_gentoolkit
+++ b/src/_gentoolkit
@@ -128,7 +128,7 @@ _equery () {
'(-s --timestamp)'{-s,--timestamp}'[include timestamp in output]' \
'(-t --type)'{-t,--type}'[include file type in output]' \
'--tree[display results in a tree (turns off other options)]' \
- '--filter=[filter output]:filter(s):_values -s , '' dir obj sym dev fifo path conf cmd doc man info' \
+ '--filter=[filter output]:filter(s):_values -s , "" dir obj sym dev fifo path conf cmd doc man info' \
':installed pkgname:_packages installed' && ret=0
;;
has|a)
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2015-04-28 12:07 Vadim A. Misbakh-Soloviov
0 siblings, 0 replies; 52+ messages in thread
From: Vadim A. Misbakh-Soloviov @ 2015-04-28 12:07 UTC (permalink / raw
To: gentoo-commits
commit: 5dc6b103e872997880554c1eb5544d50898e9892
Author: ncaq <ncaq <AT> ncaq <DOT> net>
AuthorDate: Wed Apr 1 02:29:31 2015 +0000
Commit: Vadim A. Misbakh-Soloviov <mva <AT> mva <DOT> name>
CommitDate: Wed Apr 1 02:29:31 2015 +0000
URL: https://gitweb.gentoo.org/proj/zsh-completion.git/commit/?id=5dc6b103
_gentoolkit: add missing equery arg -N or --no-pipe
fix Zsh can't complete when use -N option.
src/_gentoolkit | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/_gentoolkit b/src/_gentoolkit
index 4d24688..acba5f6 100644
--- a/src/_gentoolkit
+++ b/src/_gentoolkit
@@ -59,6 +59,7 @@ _equery () {
start_args=(
{'(--nocolor)-C','(-C)--nocolor'}'[turns off colors]'
+ {'(--no-pipe)-N','(-N)--no-pipe'}'[turn off pipe detection]'
{'(--quiet)-q','(-q)--quiet'}'[minimal output]'
{'(--help)-h','(-h)--help'}'[show help]'
{'(--version)-V','(-V)--version'}'[show version]'
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-12-22 22:57 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-12-22 22:57 UTC (permalink / raw
To: gentoo-commits
commit: 4a07d0a65ab3f4f8a23f396d63ecacee9e0cc257
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 22 22:54:40 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Mon Dec 22 22:54:40 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=4a07d0a6
_gentoolkit: add eshowkw completion support for comma-separated arch vals
---
src/_gentoo_arches | 3 ++-
src/_gentoolkit | 2 +-
src/_portage_utils | 8 ++++++--
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/_gentoo_arches b/src/_gentoo_arches
index 7206ea3..c5df979 100644
--- a/src/_gentoo_arches
+++ b/src/_gentoo_arches
@@ -6,6 +6,7 @@ arches=(${(f)"$(<$(_gentoo_repos -m)/profiles/arch.list)"})
for arch in $arches; do
[[ $arch =~ '^[^#]' ]] && allarches+=( $arch )
done
-_describe -t available-arches "arch" allarches
+
+echo "${allarches[@]}"
# vim: ft=zsh sw=2 ts=2 et
diff --git a/src/_gentoolkit b/src/_gentoolkit
index b6a73b8..4d24688 100644
--- a/src/_gentoolkit
+++ b/src/_gentoolkit
@@ -308,7 +308,7 @@ _eshowkw () {
_arguments -s \
'(: -)'{-h,--help}'[Display help and exit]' \
'(: -)'{-v,--version}'[Show package version and exit]' \
- {'(--arch)-a','(-a)--arch'}'[Display only specified arch(es)]:arch(es):_gentoo_arches' \
+ {'(--arch)-a','(-a)--arch'}'[Display only specified arch(es)]:arch:_values -s , "arch" $(_gentoo_arches)' \
{'(--align)-A','(-A)--align'}'[Specify alignment for descriptions (default: bottom)]:alignment:((top bottom))' \
{'(--top-position)-T','(-T)--top-position'}'[Specify which fields we want to have in top listing (default: archlist)]:field:((archlist versionlist))' \
{'(--bold)-B','(-B)--bold'}'[Print out each other column in bold for easier visual separation]' \
diff --git a/src/_portage_utils b/src/_portage_utils
index 3e483a6..4c41e16 100644
--- a/src/_portage_utils
+++ b/src/_portage_utils
@@ -19,6 +19,9 @@ case $service in
{'(--compare)-c','(-c)--compare'}'[Compare two atoms]'
;;
qcache)
+ local arches
+ arches=( $(_gentoo_arches) )
+
_arguments -s $common_args \
{'(--matchpkg)-p','(-p)--matchpkg'}'[match pkgname]:package name:_gentoo_packages available_pkgnames_only' \
{'(--matchcat)-c','(-c)--matchcat'}'[match catname]:category:_gentoo_packages category' \
@@ -27,8 +30,9 @@ case $service in
{'(--testing)-t','(-t)--testing'}'[list packages that have ~arch versions, but no stable versions on a given arch]' \
{'(--stats)-s','(-s)--stats'}'[display statistics about the portage tree]' \
{'(--all)-a','(-a)--all'}'[list packages that have at least one version keyworded for on a given arch]' \
- {'(--not)-n','(-n)--not'}"[list packages that aren't keyworded on a given arch]" \
- '*:arch:_gentoo_arches'
+ {'(--not)-n','(-n)--not'}"[list packages that aren't keyworded on a given arch]"
+
+ _describe -t available-arches "arch" arches
;;
qcheck)
_arguments -s $common_args \
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-12-21 9:51 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-12-21 9:51 UTC (permalink / raw
To: gentoo-commits
commit: 14ad3adb3606e7d7f7d538ae8f7cda2f8b11d93c
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 21 09:33:06 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Sun Dec 21 09:33:06 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=14ad3adb
split out arches list into it's own completion file
This might be combined later on with _gentoo_repos to form a _gentoo
file that accepts command args related to the completion function
requested.
---
src/_gentoo_arches | 11 +++++++++++
src/_portage_utils | 13 +------------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/_gentoo_arches b/src/_gentoo_arches
new file mode 100644
index 0000000..7206ea3
--- /dev/null
+++ b/src/_gentoo_arches
@@ -0,0 +1,11 @@
+#autoload
+
+local arches arch allarches
+
+arches=(${(f)"$(<$(_gentoo_repos -m)/profiles/arch.list)"})
+for arch in $arches; do
+ [[ $arch =~ '^[^#]' ]] && allarches+=( $arch )
+done
+_describe -t available-arches "arch" allarches
+
+# vim: ft=zsh sw=2 ts=2 et
diff --git a/src/_portage_utils b/src/_portage_utils
index cab73f9..3e483a6 100644
--- a/src/_portage_utils
+++ b/src/_portage_utils
@@ -19,17 +19,6 @@ case $service in
{'(--compare)-c','(-c)--compare'}'[Compare two atoms]'
;;
qcache)
- local arch
- local -a arches allarches
-
- show_archs(){
- arches=(${(f)"$(<$(_gentoo_repos -m)/profiles/arch.list)"})
- for arch in $arches; do
- [[ $arch =~ '^[^#]' ]] && allarches+=( $arch )
- done
- _describe -t available-arches "arch" allarches
- }
-
_arguments -s $common_args \
{'(--matchpkg)-p','(-p)--matchpkg'}'[match pkgname]:package name:_gentoo_packages available_pkgnames_only' \
{'(--matchcat)-c','(-c)--matchcat'}'[match catname]:category:_gentoo_packages category' \
@@ -39,7 +28,7 @@ case $service in
{'(--stats)-s','(-s)--stats'}'[display statistics about the portage tree]' \
{'(--all)-a','(-a)--all'}'[list packages that have at least one version keyworded for on a given arch]' \
{'(--not)-n','(-n)--not'}"[list packages that aren't keyworded on a given arch]" \
- '*:arch:show_archs'
+ '*:arch:_gentoo_arches'
;;
qcheck)
_arguments -s $common_args \
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-12-21 9:51 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-12-21 9:51 UTC (permalink / raw
To: gentoo-commits
commit: ce83f20e491242aabe4be81a6c6a5169c6eda3a7
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 21 09:48:58 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Sun Dec 21 09:48:58 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=ce83f20e
_gentoolkit: initial eshowkw completion support
Still need to work on completing comma separated arches for the '--arch'
option. We currently only take one arch completion.
---
src/_gentoolkit | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/src/_gentoolkit b/src/_gentoolkit
index 7ed5ceb..b6a73b8 100644
--- a/src/_gentoolkit
+++ b/src/_gentoolkit
@@ -1,4 +1,4 @@
-#compdef equery euse eclean eclean-dist eclean-pkg epkginfo genpkgindex glsa-check revdep-rebuild
+#compdef equery euse eclean eclean-dist eclean-pkg epkginfo eshowkw genpkgindex glsa-check revdep-rebuild
# XXX: shouldn't this go to _gentoo_package?
_packages () {
@@ -304,6 +304,21 @@ _epkginfo () {
'*:package:_gentoo_packages available'
}
+_eshowkw () {
+ _arguments -s \
+ '(: -)'{-h,--help}'[Display help and exit]' \
+ '(: -)'{-v,--version}'[Show package version and exit]' \
+ {'(--arch)-a','(-a)--arch'}'[Display only specified arch(es)]:arch(es):_gentoo_arches' \
+ {'(--align)-A','(-A)--align'}'[Specify alignment for descriptions (default: bottom)]:alignment:((top bottom))' \
+ {'(--top-position)-T','(-T)--top-position'}'[Specify which fields we want to have in top listing (default: archlist)]:field:((archlist versionlist))' \
+ {'(--bold)-B','(-B)--bold'}'[Print out each other column in bold for easier visual separation]' \
+ {'(--color)-C','(-C)--color'}'[Force colored output]' \
+ {'(--overlays)-O','(-O)--overlays'}'[Include overlays in search]' \
+ {'(--prefix)-P','(-P)--prefix'}'[Display prefix keywords in output]' \
+ {'(--ignore-slot)-S','(-S)--ignore-slot'}'[Treat slots as irelevant during detection of redundant packages]' \
+ '*:package:_gentoo_packages available'
+}
+
_genpkgindex () {
_arguments -s \
'(: -)'{-h,--help}'[Display help and exit]' \
@@ -385,6 +400,9 @@ case "$service" in
epkginfo)
_epkginfo "$@" && return 0
;;
+ eshowkw)
+ _eshowkw "$@" && return 0
+ ;;
genpkgindex)
_genpkgindex "$@" && return 0
;;
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-12-20 23:22 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-12-20 23:22 UTC (permalink / raw
To: gentoo-commits
commit: a32312a914dc67d4122332f7e990cbb2a43556b4
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 20 23:13:37 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Sat Dec 20 23:18:00 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=a32312a9
_gentoo_packages: drop PORTDIR and PORTDIR_OVERLAY usage
Both variables are slowly being deprecated as we move towards a more
multi-repo friendly future.
Also, this does various other variable naming and scope cleanup.
---
src/_gentoo_packages | 92 ++++++++++++++++++++++++++++------------------------
src/_portage_utils | 6 ++--
2 files changed, 51 insertions(+), 47 deletions(-)
diff --git a/src/_gentoo_packages b/src/_gentoo_packages
index f15487c..37539c8 100644
--- a/src/_gentoo_packages
+++ b/src/_gentoo_packages
@@ -65,17 +65,20 @@ _gentoo_packages_update_installed_sets() {
}
_gentoo_packages_update_available_sets() {
- trees=($(_gentoo_repos -o) /etc/portage /usr/share/portage/config)
- for PORTDIR in ${(@)trees}; do
- if [[ -d ${PORTDIR} ]]; then
- setsdir="$(_parsesetsconf ${PORTDIR})"
- [[ ! -z "${setsdir}" ]] && setspath="${PORTDIR}/${setsdir}" || setspath="${PORTDIR}/sets"
- if [[ -d "${setspath}" ]]; then
- setsfiles=(${setspath}/*~*.conf(N))
- for set in ${setsfiles[@]}; do
+ local dirs dir sets_dir set sets sets_path sets_files
+
+ dirs=($(_gentoo_repos -o) /etc/portage /usr/share/portage/config)
+
+ for dir in ${(@)dirs}; do
+ if [[ -d ${dir} ]]; then
+ sets_dir="$(_parsesetsconf ${dir})"
+ [[ ! -z "${sets_dir}" ]] && sets_path="${dir}/${sets_dir}" || sets_path="${dir}/sets"
+ if [[ -d "${sets_path}" ]]; then
+ sets_files=(${sets_path}/*~*.conf(N))
+ for set in ${sets_files[@]}; do
sets+=(${set}(:t))
done
- sets+=($(_parsesetsconf ${PORTDIR} sets))
+ sets+=($(_parsesetsconf ${dir} sets))
fi
fi
done
@@ -86,16 +89,13 @@ _gentoo_packages_update_available_sets() {
# Completion function to show useflags.
_gentoo_packages_update_useflag(){
- local flags trees
+ local flags repo
- flags=()
- trees=($(_gentoo_repos))
-
- for PORTDIR in ${trees[@]}; do
- [[ -r ${PORTDIR}/profiles/use.desc ]] &&
- flags+=(${${(M)${(f)"$(<$PORTDIR/profiles/use.desc)"}:#* - *}%% - *})
- [[ -r ${PORTDIR}/profiles/use.local.desc ]] &&
- flags+=(${${${(M)${(f)"$(<$PORTDIR/profiles/use.local.desc)"}#* - *}%% - *}#*:})
+ for repo in $(_gentoo_repos); do
+ [[ -r ${repo}/profiles/use.desc ]] &&
+ flags+=(${${(M)${(f)"$(<${repo}/profiles/use.desc)"}:#* - *}%% - *})
+ [[ -r ${repo}/profiles/use.local.desc ]] &&
+ flags+=(${${${(M)${(f)"$(<${repo}/profiles/use.local.desc)"}#* - *}%% - *}#*:})
done
compadd $flags
@@ -111,16 +111,17 @@ _gentoo_packages_update_active_useflag(){
flags=(${${${=USE}%-*}%\\*})
compadd $flags
}
+
_gentoo_packages_update_category(){
- local trees category
+ local repos category
- trees=($(_gentoo_repos))
- category=( $trees/*-*(/:t) )
+ repos=($(_gentoo_repos))
+ category=( $repos/*-*(/:t) )
_wanted cat_packages expl 'category' compadd "$@" $category
}
_gentoo_packages_update_installed(){
- local installed_dir installed_portage installed_list expl
+ local installed_dir installed_portage installed_pkgname installed_list
installed_dir="/var/db/pkg"
installed_portage=($installed_dir/*-*/*)
@@ -132,7 +133,7 @@ _gentoo_packages_update_installed(){
}
_gentoo_packages_update_installed_versions(){
- local installed_list installed_portage expl
+ local installed_list installed_portage
installed_portage=(/var/db/pkg/*-*/*)
_wanted packages expl 'package' compadd "$@" ${installed_portage:t}
@@ -142,21 +143,21 @@ _gentoo_packages_update_installed_versions(){
}
_gentoo_packages_update_available_pkgnames_only(){
- local trees packages
+ local repos packages
- trees=($(_gentoo_repos))
+ repos=($(_gentoo_repos))
- packages=($trees/*-*/*(:t))
+ packages=($repos/*-*/*(:t))
_wanted packages expl 'package' compadd - "${(@)packages}"
}
_gentoo_packages_update_available(){
- local trees category packages pkg expl
+ local repos category packages pkg expl
- trees=($(_gentoo_repos))
- category=($trees/*-*(/:t))
+ repos=($(_gentoo_repos))
+ category=($repos/*-*(/:t))
- packages=($trees/*-*/*(:t))
+ packages=($repos/*-*/*(:t))
_wanted packages expl 'package' compadd - "${(@)packages}"
# Complete cat/pkg. _multi_parts is much to slow for such a large task,
@@ -167,38 +168,40 @@ _gentoo_packages_update_available(){
_wanted cat_packages expl 'category/package' compadd -S '/' $category
else
compset -P '*/'
- pkg=($trees/$IPREFIX/*(:t))
+ pkg=($repos/$IPREFIX/*(:t))
_wanted cat_packages expl 'category/package' compadd $pkg
fi
}
_gentoo_packages_update_available_versions(){
- local var overlay_ebuilds portage_ebuilds expl trees category
+ local main_repo overlays overlay_ebuilds gentoo_ebuilds repos category pkg
- PORTDIR=$(_gentoo_repos -m)
- PORTDIR_OVERLAY=$(_gentoo_repos -o)
+ main_repo=$(_gentoo_repos -m)
+ overlays=$(_gentoo_repos -o)
- trees=($PORTDIR $=PORTDIR_OVERLAY)
- category=($trees/*-*(/:t))
+ repos=($main_repo $=overlays)
+ category=($repos/*-*(/:t))
typeset -U category
if [[ $#PREFIX -ge 1 && -z $words[(r)(--inject|-i)] ]]; then
- overlay_ebuilds=($=PORTDIR_OVERLAY/*-*/${PREFIX%%-[0-9]#*}*/*.ebuild(:t:r) )
- portage_ebuilds=($PORTDIR/metadata/cache/*-*/${PREFIX%%-[0-9]#*}*(:t))
- _wanted packages expl 'package' compadd $portage_ebuilds $overlay_ebuilds
+ overlay_ebuilds=($=overlays/*-*/${PREFIX%%-[0-9]#*}*/*.ebuild(:t:r) )
+ gentoo_ebuilds=($main_repo/metadata/cache/*-*/${PREFIX%%-[0-9]#*}*(:t))
+ _wanted packages expl 'package' compadd $gentoo_ebuilds $overlay_ebuilds
fi
- pkg=( $trees/${PREFIX%%/*}/*/*.ebuild(:t:r) )
+ pkg=( $repos/${PREFIX%%/*}/*/*.ebuild(:t:r) )
_wanted cat_packages expl 'category/package' _sep_parts category / pkg
}
#Function to show tbz2 files available
_gentoo_packages_update_binary() {
+ local PKGDIR
+
[[ -z $PKGDIR && -r /etc/portage/make.conf ]] &&
- local PKGDIR="$(. /etc/portage/make.conf 2>/dev/null; echo $PKGDIR)"
+ PKGDIR="$(. /etc/portage/make.conf 2>/dev/null; echo $PKGDIR)"
[[ -z $PKGDIR && -r /etc/make.conf ]] &&
- local PKGDIR="$(. /etc/make.conf 2>/dev/null; echo $PKGDIR)"
+ PKGDIR="$(. /etc/make.conf 2>/dev/null; echo $PKGDIR)"
[[ -z $PKGDIR && -r /usr/share/portage/config/make.globals ]] &&
- local PKGDIR="$(. /usr/share/portage/config/make.globals 2>/dev/null; echo $PKGDIR)"
+ PKGDIR="$(. /usr/share/portage/config/make.globals 2>/dev/null; echo $PKGDIR)"
# this doesn't take care of ${PORTAGE_BINHOST}. If Gentoo official
# binary mirror will be available we should rewrite it accordingly.
@@ -207,6 +210,7 @@ _gentoo_packages_update_binary() {
_gentoo_packages () {
local command="$argv[$#]" expl cachevar pkgset update_policy
+
zstyle -s ":completion:*:*:$service:*" cache-policy update_policy
if [[ -z "$update_policy" ]]; then
zstyle ":completion:*:*:$service:*" cache-policy _gentoo_cache_policy
@@ -223,6 +227,8 @@ _gentoo_packages () {
}
_gentoo_cache_policy () {
+ local oldp
+
# rebuild if cache is more than a week old
oldp=( "$1"(mw+1) )
(( $#oldp )) && return 0
diff --git a/src/_portage_utils b/src/_portage_utils
index 7fdb828..cab73f9 100644
--- a/src/_portage_utils
+++ b/src/_portage_utils
@@ -2,9 +2,7 @@
# portage-utils-0.53
-local common_args PORTDIR
-
-PORTDIR="$(_gentoo_repos -m)"
+local common_args
common_args=(
'--root[Set the ROOT env var]:root directory:_files -/' \
@@ -25,7 +23,7 @@ case $service in
local -a arches allarches
show_archs(){
- arches=(${(f)"$(<$PORTDIR/profiles/arch.list)"})
+ arches=(${(f)"$(<$(_gentoo_repos -m)/profiles/arch.list)"})
for arch in $arches; do
[[ $arch =~ '^[^#]' ]] && allarches+=( $arch )
done
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-12-20 22:29 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-12-20 22:29 UTC (permalink / raw
To: gentoo-commits
commit: fabda847f4690cac36728ec8372f4fe82a8ba9f1
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 20 22:27:43 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Sat Dec 20 22:27:43 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=fabda847
_gentoo_repos: drop duplicated output functionality
Also, calling _gentoo_repos with no arguments returns all configured
repos instead of just the main repo. To get the path for the main repo
use `_gentoo_repos -m`.
---
src/_gentoo_packages | 10 +++++-----
src/_gentoo_repos | 44 ++++++++++++++++++++++----------------------
src/_portage_utils | 2 +-
3 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/src/_gentoo_packages b/src/_gentoo_packages
index fa782e4..f15487c 100644
--- a/src/_gentoo_packages
+++ b/src/_gentoo_packages
@@ -89,7 +89,7 @@ _gentoo_packages_update_useflag(){
local flags trees
flags=()
- trees=($(_gentoo_repos) $(_gentoo_repos -o))
+ trees=($(_gentoo_repos))
for PORTDIR in ${trees[@]}; do
[[ -r ${PORTDIR}/profiles/use.desc ]] &&
@@ -114,7 +114,7 @@ _gentoo_packages_update_active_useflag(){
_gentoo_packages_update_category(){
local trees category
- trees=($(_gentoo_repos) $(_gentoo_repos -o))
+ trees=($(_gentoo_repos))
category=( $trees/*-*(/:t) )
_wanted cat_packages expl 'category' compadd "$@" $category
}
@@ -144,7 +144,7 @@ _gentoo_packages_update_installed_versions(){
_gentoo_packages_update_available_pkgnames_only(){
local trees packages
- trees=($(_gentoo_repos) $(_gentoo_repos -o))
+ trees=($(_gentoo_repos))
packages=($trees/*-*/*(:t))
_wanted packages expl 'package' compadd - "${(@)packages}"
@@ -153,7 +153,7 @@ _gentoo_packages_update_available_pkgnames_only(){
_gentoo_packages_update_available(){
local trees category packages pkg expl
- trees=($(_gentoo_repos) $(_gentoo_repos -o))
+ trees=($(_gentoo_repos))
category=($trees/*-*(/:t))
packages=($trees/*-*/*(:t))
@@ -175,7 +175,7 @@ _gentoo_packages_update_available(){
_gentoo_packages_update_available_versions(){
local var overlay_ebuilds portage_ebuilds expl trees category
- PORTDIR=$(_gentoo_repos)
+ PORTDIR=$(_gentoo_repos -m)
PORTDIR_OVERLAY=$(_gentoo_repos -o)
trees=($PORTDIR $=PORTDIR_OVERLAY)
diff --git a/src/_gentoo_repos b/src/_gentoo_repos
index 3419cdc..7f88a64 100644
--- a/src/_gentoo_repos
+++ b/src/_gentoo_repos
@@ -1,40 +1,40 @@
#autoload
# Usage:
-# _gentoo_repos -> returns the main repo (with PORTDIR fallback)
-# _gentoo_repos -o -> returns the list of non-main repos (with PORTDIR_OVERLAY fallback)
+# _gentoo_repos -> returns the list of all repos
+# _gentoo_repos -m -> returns the main repo
+# _gentoo_repos -o -> returns the list of non-main repos
_gentoo_repos() {
- local main_repo main_repo_path overlay overlay_path
+ local main_repo main_repo_path overlay overlay_paths
if [[ -e /usr/share/portage/config/repos.conf ]]; then
- if [[ ${1} == "-o" ]]; then
- for overlay in $(_repos_conf -l); do
- overlay_path+=($(_repos_conf ${overlay} location))
- done
+ main_repo=$(_repos_conf DEFAULT main-repo)
+ main_repo_path=$(_repos_conf ${main_repo} location)
- source /etc/make.conf 2>/dev/null
- source /etc/portage/make.conf 2>/dev/null
+ for overlay in $(_repos_conf -l); do
+ overlay_paths+=($(_repos_conf ${overlay} location))
+ done
- overlay_path+=(${(@)PORTDIR_OVERLAY})
-
- echo "${(@u)overlay_path}"
- else
- main_repo=$(_repos_conf DEFAULT main-repo)
- main_repo_path=$(_repos_conf ${main_repo} location)
+ source /etc/make.conf 2>/dev/null
+ source /etc/portage/make.conf 2>/dev/null
- echo "${main_repo_path}"
- fi
+ overlay_paths+=(${(@)PORTDIR_OVERLAY})
else
source /usr/share/portage/config/make.globals 2>/dev/null
source /etc/make.conf 2>/dev/null
source /etc/portage/make.conf 2>/dev/null
- if [[ ${1} == "-o" ]]; then
- echo "${(@u)PORTDIR_OVERLAY}"
- else
- echo "${PORTDIR}"
- fi
+ main_repo_path="${PORTDIR}"
+ overlay_paths=(${(@)PORTDIR_OVERLAY})
+ fi
+
+ if [[ $1 == "-m" ]]; then
+ echo "${main_repo_path}"
+ elif [[ $1 == "-o" ]]; then
+ echo "${(@u)overlay_paths}"
+ else
+ echo "${main_repo_path} ${(@u)overlay_paths}"
fi
}
diff --git a/src/_portage_utils b/src/_portage_utils
index acff1a6..7fdb828 100644
--- a/src/_portage_utils
+++ b/src/_portage_utils
@@ -4,7 +4,7 @@
local common_args PORTDIR
-PORTDIR="$(_gentoo_repos)"
+PORTDIR="$(_gentoo_repos -m)"
common_args=(
'--root[Set the ROOT env var]:root directory:_files -/' \
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-12-20 20:04 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-12-20 20:04 UTC (permalink / raw
To: gentoo-commits
commit: c3db411de95081fdafa9cf06e78a304ad3454b58
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 20 09:40:04 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Sat Dec 20 09:40:04 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=c3db411d
_gentoolkit: remove old revdep-rebuild util option
---
src/_gentoolkit | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/src/_gentoolkit b/src/_gentoolkit
index c901712..7ed5ceb 100644
--- a/src/_gentoolkit
+++ b/src/_gentoolkit
@@ -369,11 +369,7 @@ _revdep-rebuild () {
'(-p --pretend)'{-p,--pretend}'[Do a trial run without actually emerging anything (also passed to emerge command)]' \
'(-P --no-progress)'{-P,--no-progress}'[Turn off the progress meter]' \
'(-q --quiet)'{-q,--quiet}'[Be less verbose (also passed to emerge command)]' \
- '(-v --verbose)'{-v,--verbose}'[Be more verbose (also passed to emerge command)]' \
- '(-u --no-util)'{-u,--no-util}'[<UTIL> Do not use features provided by UTIL]:file:_files'
- # XXX: does someone really use -u|--no-util option?
- # we can check packages installed (like portage-utils etc) to see
- # which "UTIL" is avaiable.
+ '(-v --verbose)'{-v,--verbose}'[Be more verbose (also passed to emerge command)]'
}
case "$service" in
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-12-20 20:04 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-12-20 20:04 UTC (permalink / raw
To: gentoo-commits
commit: cb616f0cdcbcb4038bd2ab95218dc9277160a683
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 20 09:35:51 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Sat Dec 20 09:35:51 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=cb616f0c
_gentoolkit: add epkginfo option completions
---
src/_gentoolkit | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/src/_gentoolkit b/src/_gentoolkit
index 1b09c4a..c901712 100644
--- a/src/_gentoolkit
+++ b/src/_gentoolkit
@@ -1,16 +1,5 @@
#compdef equery euse eclean eclean-dist eclean-pkg epkginfo genpkgindex glsa-check revdep-rebuild
-# gentoolkit-0.2.4-rc3
-#
-# euse (fully done)
-# equery (fully done)
-# eclean* (fully done)
-# epkginfo (fully done)
-# genpkgindex (fully done)
-# glsa-check (fully done)
-# revdep-rebuild (partial)
-# eread *nothing todo*
-
# XXX: shouldn't this go to _gentoo_package?
_packages () {
if compset -P '(\\|)(>=|<=|<|>|=)'; then
@@ -301,9 +290,18 @@ _eclean_size () {
}
_epkginfo () {
- if (( CURRENT == 2 )); then
- _arguments -s '*:package:_gentoo_packages available'
- fi
+ _arguments -s \
+ '(: -)'{-h,--help}'[Display help and exit]' \
+ {'(--description)-d','(-d)--description'}'[show an extended package description]' \
+ {'(--herd)-H','(-H)--herd'}'[show the herd(s) for the package]' \
+ {'(--keywords)-k','(-k)--keywords'}'[show keywords for all matching package versions]' \
+ {'(--license)-l','(-l)--license'}'[show licenses for the best maching version]' \
+ {'(--maintainer)-m','(-m)--maintainer'}'[show the maintainer(s) for the package]' \
+ {'(--stablreq)-S','(-S)--stablreq'}"[show STABLEREQ arches (cc's) for all matching package versions]" \
+ {'(--useflags)-u','(-u)--useflags'}'[show per-package USE flag descriptions]' \
+ {'(--upstream)-U','(-U)--upstream'}"[show package's upstream information]" \
+ {'(--xml)-x','(-x)--xml'}'[show the plain metadata.xml file]' \
+ '*:package:_gentoo_packages available'
}
_genpkgindex () {
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-12-20 20:04 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-12-20 20:04 UTC (permalink / raw
To: gentoo-commits
commit: 6225b1fdb933487077903ac867bf71979da5045b
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 20 10:05:01 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Sat Dec 20 10:06:02 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=6225b1fd
_gentoo_repos: use more apt variable names
---
src/_gentoo_repos | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/_gentoo_repos b/src/_gentoo_repos
index ff4136b..3419cdc 100644
--- a/src/_gentoo_repos
+++ b/src/_gentoo_repos
@@ -5,25 +5,25 @@
# _gentoo_repos -o -> returns the list of non-main repos (with PORTDIR_OVERLAY fallback)
_gentoo_repos() {
- local mainreponame mainrepopath overlayname overlaypath
+ local main_repo main_repo_path overlay overlay_path
if [[ -e /usr/share/portage/config/repos.conf ]]; then
if [[ ${1} == "-o" ]]; then
- for overlayname in $(_parsereposconf -l); do
- overlaypath+=($(_parsereposconf ${overlayname} location))
+ for overlay in $(_repos_conf -l); do
+ overlay_path+=($(_repos_conf ${overlay} location))
done
source /etc/make.conf 2>/dev/null
source /etc/portage/make.conf 2>/dev/null
- overlaypath+=(${(@)PORTDIR_OVERLAY})
+ overlay_path+=(${(@)PORTDIR_OVERLAY})
- echo "${(@u)overlaypath}"
+ echo "${(@u)overlay_path}"
else
- mainreponame=$(_parsereposconf DEFAULT main-repo)
- mainrepopath=$(_parsereposconf ${mainreponame} location)
+ main_repo=$(_repos_conf DEFAULT main-repo)
+ main_repo_path=$(_repos_conf ${main_repo} location)
- echo "${mainrepopath}"
+ echo "${main_repo_path}"
fi
else
source /usr/share/portage/config/make.globals 2>/dev/null
@@ -38,14 +38,14 @@ _gentoo_repos() {
fi
}
-_parsereposconf() {
- local v f insection section arr
+_repos_conf() {
+ local v file insection section arr
- for f in /usr/share/portage/config/repos.conf \
+ for file in /usr/share/portage/config/repos.conf \
/etc/portage/repos.conf \
/etc/portage/repos.conf/*.conf; do
- [[ -f ${f} ]] || continue
+ [[ -f ${file} ]] || continue
insection=0
declare -A arr
IFS='= '
@@ -70,7 +70,7 @@ _parsereposconf() {
fi
fi
continue
- done < ${f}
+ done < ${file}
done
if [[ ${1} == "-l" ]]; then
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-12-20 5:31 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-12-20 5:31 UTC (permalink / raw
To: gentoo-commits
commit: 5cc6721ec88af48b1f5ba27d142e3258c80d6320
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 20 05:29:22 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Sat Dec 20 05:30:48 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=5cc6721e
_g-cpan: add initial g-cpan completion support
---
src/_g-cpan | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/src/_g-cpan b/src/_g-cpan
new file mode 100644
index 0000000..5cee5b5
--- /dev/null
+++ b/src/_g-cpan
@@ -0,0 +1,25 @@
+#compdef g-cpan
+# g-cpan-0.16.6
+
+local arguments
+
+arguments=(
+ '(- :)'{--help,-h}'[Show help]'
+ {'(--generate)-g','(-g)--generate'}'[Generate ebuilds only (Requires working overlays)]'
+ {'(--install)-i','(-i)--install'}'[Try to generate ebuild for the given module name and, if successful, emerge it. Important : installation requires exact CPAN Module Name.]'
+ {'(--list)-l','(-l)--list'}'[This command generates a list of the Perl modules and ebuilds handled by g-cpan.]'
+ {'(--log)-L','(-L)--log'}'[Log the output of g-cpan]'
+ {'(--search)-s','(-s)--search'}'[Search CPAN for the given expression (similar to the "m /EXPR/" from the CPAN Shell). Searches are case insensitive.]'
+ {'(--upgrade)-u','(-u)--upgrade'}'[Try to list and upgrade all Perl modules managed by g-cpan. It generate up-to-date ebuilds, then emerge then.]'
+ {'(--verbose)-v','(-v)--verbose'}'[Enable (some) verbose output.]'
+ "--cpan_reload[Reload the CPAN index]"
+ {'(--ask)-a','(-a)--ask'}'[Ask before installing]'
+ {'(--buildpkg)-b','(-b)--buildpkg'}'[Tells emerge to build binary packages for all ebuilds processed in addition to actually merging the packages.]'
+ {'(--buildpkgonly)-B','(-B)--buildpkgonly'}'[Creates binary packages for all ebuilds processed without actually mering the packages.]'
+ {'(--pretend)-p','(-p)--pretend'}"[Pretend (show actions, but don't emerge). This still generates new ebuilds.]"
+ '*:modules:'
+)
+
+_arguments $arguments
+
+# vim: set et sw=2 ts=2 ft=zsh:
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-12-20 4:54 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-12-20 4:54 UTC (permalink / raw
To: gentoo-commits
commit: 1858c7ba7dbae7f3424ba304b3b176a18add56af
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 20 04:54:01 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Sat Dec 20 04:54:01 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=1858c7ba
_portage: remove old tbz2tool completion support
The related utility was removed from portage ~4 years ago.
---
src/_portage | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/src/_portage b/src/_portage
index 1c1831c..ed2ade5 100644
--- a/src/_portage
+++ b/src/_portage
@@ -1,4 +1,4 @@
-#compdef emerge ebuild quickpkg emaint env-update etc-update portageq repoman tbz2tool
+#compdef emerge ebuild quickpkg emaint env-update etc-update portageq repoman
_ebuild () {
if (( CURRENT == 2 )); then
@@ -333,14 +333,6 @@ _repoman () {
fi
}
-_tbz2tool () {
- if (( CURRENT == 2 )); then
- _values 'action' 'join' 'split'
- elif (( CURRENT > 2 )) && (( CURRENT < 6 )); then
- _arguments -s '*:file:_files'
- fi
-}
-
zparseopts -D -E -A Args -- -emerge
if (( ${+Args[--emerge]} )); then
_emerge "$@" && return 0
@@ -371,9 +363,6 @@ case "$service" in
repoman)
_repoman "$@" && return 0
;;
- tbz2tool)
- _tbz2tool "$@" && return 0
- ;;
esac
# vim: set et sw=2 ts=2 ft=zsh:
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-12-20 4:39 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-12-20 4:39 UTC (permalink / raw
To: gentoo-commits
commit: ef58d52de7c3c828e5fe9db4667dc1fd18f3b418
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 20 04:36:59 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Sat Dec 20 04:36:59 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=ef58d52d
fix singular argument forcing
This allows multiples of the same option to be completed in certain
cases (increasing/decreasing verbosity for perl-cleaner) and fixes
several cases where arguments shouldn't stop additional arguments from
being completed.
---
src/_binutils-config | 4 ++--
src/_gcc-config | 6 +++---
src/_perl-cleaner | 6 +++---
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/_binutils-config b/src/_binutils-config
index 30064b3..1dd7bb9 100644
--- a/src/_binutils-config
+++ b/src/_binutils-config
@@ -5,8 +5,8 @@ local arguments
arguments=(
'(- :)'{--get-current-profile,-c}'[print current profile]'
'(- :)'{--list-profiles,-l}'[print a list of available profiles]'
- '(- :)'{--uninstall,-u}'[remove all signs of specified target]'
- '(- :)'{--debug,-d}'[execute with debug output]'
+ {'(--uninstall)-u','(-u)--uninstall'}'[remove all signs of specified target]'
+ {'(--debug)-d','(-d)--debug'}'[execute with debug output]'
'(- :)'{--help,-h}'[show help]'
'(- :):profiles:_binutils_profiles'
)
diff --git a/src/_gcc-config b/src/_gcc-config
index e4dfb51..e292e6c 100644
--- a/src/_gcc-config
+++ b/src/_gcc-config
@@ -4,12 +4,12 @@
local arguments
arguments=(
- '(- :)'{--nocolor,-C}'[disable colored output]'
+ {'(--nocolor)-C','(-C)--nocolor'}'[disable colored output]'
'(- :)'{--use-old,-O}'[use the old profile if one was selected]'
- '(- :)'{--force,-f}'[make sure all config files are regenerated]'
+ {'(--force)-f','(-f)--force'}'[make sure all config files are regenerated]'
'(- :)'{--get-current-profile,-c}'[print current used gcc profile]'
'(- :)'{--list-profiles,-l}'[print a list of available profiles]'
- '(- :)'{--split-profile,-S}'[split profiles into their components]'
+ {'(--split-profile)-S','(-S)--split-profile'}'[split profiles into their components]'
'(- :)'{--print-environ,-E}'[print environment of the given/current profile]:profiles:_gcc_profiles'
'(- :)'{--get-bin-path,-B}'[print binary path of given/current profile]:profiles:_gcc_profiles'
'(- :)'{--get-lib-path,-L}'[print library path of given/current profile]:profiles:_gcc_profiles'
diff --git a/src/_perl-cleaner b/src/_perl-cleaner
index 5f25aaf..c9e7434 100644
--- a/src/_perl-cleaner
+++ b/src/_perl-cleaner
@@ -6,9 +6,9 @@ local arguments
arguments=(
'(- :)'{--help,-h}'[show help]'
'(- :)'{--version,-V}'[show version]'
- '(- :)'{--pretend,-p}"[pretend (don't do anything)]"
- '(- :)'{--verbose,-v}'[increase verbosity (may be specified multiple times)]'
- '(- :)'{--quiet,-q}'[decrease verbosity]'
+ {'(--pretend)-p','(-p)--pretend'}"[pretend (don't do anything)]"
+ '*'{-v,--verbose}'[increase verbosity (may be specified multiple times)]'
+ '*'{-q,--quiet}'[decrease verbosity]'
"--modules[rebuild perl modules for old installs of perl]"
"--allmodules[rebuild all perl modules]"
"--libperl[rebuild anything linked against libperl]"
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-12-20 4:39 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-12-20 4:39 UTC (permalink / raw
To: gentoo-commits
commit: 4eae2e161562993cc343bbc2ebbfdb2287e68a06
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 20 04:10:00 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Sat Dec 20 04:10:00 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=4eae2e16
_portage: add etc-update support
---
src/_portage | 33 ++++++++++++++++++++-------------
1 file changed, 20 insertions(+), 13 deletions(-)
diff --git a/src/_portage b/src/_portage
index 15a9560..1c1831c 100644
--- a/src/_portage
+++ b/src/_portage
@@ -1,16 +1,4 @@
-#compdef emerge ebuild quickpkg emaint env-update portageq repoman tbz2tool
-
-# Already done:
-# emerge (fully done)
-# ebuild (fully done)
-# emaint (fully done)
-# env-update (fully done)
-# portageq (fully done)
-# repoman (fully done)
-# tbz2tool (fully done)
-#
-# Still TODO:
-# xpak
+#compdef emerge ebuild quickpkg emaint env-update etc-update portageq repoman tbz2tool
_ebuild () {
if (( CURRENT == 2 )); then
@@ -255,6 +243,22 @@ _env-update () {
_arguments -s '(: -)--no-ldconfig[Do not run ldconfig]'
}
+_etc-update () {
+ _arguments -s \
+ {'(--debug)-d','(-d)--debug'}'[Enable shell debugging]' \
+ {'(--help)-h','(-h)--help'}'[Show help message and exit]' \
+ {'(--preen)-p','(-p)--preen'}'[Auto-merge trivial changes only and exit]' \
+ {'(--quiet)-q','(-q)--quiet'}'[Show only essential output]' \
+ {'(--verbose)-v','(-v)--verbose'}'[Show settings and such along the way]' \
+ {'(--version)-V','(-V)--version'}'[Show version and exit]' \
+ "--automode[automatically perform operation on all files]:mode:(( \
+ -3\:'auto-merge all files' \
+ -5\:'auto-merge all files without using \"mv -i\"' \
+ -7\:'discard all updates' \
+ -9\:'discard all updates without using \"rm -i\"' ))" \
+ '*:paths to scan:_files -/'
+}
+
_portageq () {
local action
@@ -358,6 +362,9 @@ case "$service" in
env-update)
_env-update "$@" && return 0
;;
+ etc-update)
+ _etc-update "$@" && return 0
+ ;;
portageq)
_portageq "$@" && return 0
;;
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-12-20 3:21 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-12-20 3:21 UTC (permalink / raw
To: gentoo-commits
commit: 468796ec7a55ac15601adc9ee9086daaf01b94c3
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 20 03:19:42 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Sat Dec 20 03:19:42 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=468796ec
_perl-cleaner: initial completion support for perl-cleaner
Based off perl-cleaner-2.18 options.
---
src/_perl-cleaner | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/src/_perl-cleaner b/src/_perl-cleaner
new file mode 100644
index 0000000..5f25aaf
--- /dev/null
+++ b/src/_perl-cleaner
@@ -0,0 +1,26 @@
+#compdef perl-cleaner
+# perl-cleaner-2.18
+
+local arguments
+
+arguments=(
+ '(- :)'{--help,-h}'[show help]'
+ '(- :)'{--version,-V}'[show version]'
+ '(- :)'{--pretend,-p}"[pretend (don't do anything)]"
+ '(- :)'{--verbose,-v}'[increase verbosity (may be specified multiple times)]'
+ '(- :)'{--quiet,-q}'[decrease verbosity]'
+ "--modules[rebuild perl modules for old installs of perl]"
+ "--allmodules[rebuild all perl modules]"
+ "--libperl[rebuild anything linked against libperl]"
+ "--ph-clean[clean out old ph files from a previous perl]"
+ "--phupdate[update existing ph files, useful after an upgrade to system parts like the kernel]"
+ "--phall[short for '--ph-clean --phupdate']"
+ "--all[short for '--modules --libperl --phall']"
+ "--reallyall[short for '--allmodules --libperl --phall']"
+ "--leftovers[shows all files that were not rebuilt]"
+ '(- :)'{--package-manager,-P}'[use package manager]:package manager:((portage pkgcore paludis))'
+)
+
+_arguments $arguments
+
+# vim: set et sw=2 ts=2 ft=zsh:
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-12-20 3:08 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-12-20 3:08 UTC (permalink / raw
To: gentoo-commits
commit: 708df14d7aa473c8eafdccadc71ab557146646b4
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 20 02:56:16 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Sat Dec 20 02:56:56 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=708df14d
_binutils-config: add initial completions for binutils-config
Mostly based off _gcc-config.
---
src/_binutils-config | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/src/_binutils-config b/src/_binutils-config
new file mode 100644
index 0000000..30064b3
--- /dev/null
+++ b/src/_binutils-config
@@ -0,0 +1,23 @@
+#compdef binutils-config
+
+local arguments
+
+arguments=(
+ '(- :)'{--get-current-profile,-c}'[print current profile]'
+ '(- :)'{--list-profiles,-l}'[print a list of available profiles]'
+ '(- :)'{--uninstall,-u}'[remove all signs of specified target]'
+ '(- :)'{--debug,-d}'[execute with debug output]'
+ '(- :)'{--help,-h}'[show help]'
+ '(- :):profiles:_binutils_profiles'
+)
+
+_binutils_profiles() {
+ local profiles
+ profiles=(${(f)"$(_call_program binutils-installed RC_NOCOLOR=yes binutils-config --list-profiles)"})
+ profiles=${${profiles/\[([^]]*)\]/}/\*}
+ _tags profiles && { compadd "$@" -k profiles || compadd "$@" ${(kv)=profiles} }
+}
+
+_arguments $arguments
+
+# vim: set et sw=2 ts=2 ft=zsh:
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-12-20 3:08 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-12-20 3:08 UTC (permalink / raw
To: gentoo-commits
commit: 524e4a3e05aebb8aa7aab93468178ad599291fbd
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 20 03:05:04 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Sat Dec 20 03:07:51 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=524e4a3e
_gcc-config: update for gcc-config-1.8 options
---
src/_gcc-config | 27 +++++++++++++--------------
1 file changed, 13 insertions(+), 14 deletions(-)
diff --git a/src/_gcc-config b/src/_gcc-config
index 4f89485..e4dfb51 100644
--- a/src/_gcc-config
+++ b/src/_gcc-config
@@ -1,28 +1,27 @@
#compdef gcc-config
-
-# Author oberyno <oberyno@gmail.com>
+# gcc-config-1.8
local arguments
arguments=(
+ '(- :)'{--nocolor,-C}'[disable colored output]'
'(- :)'{--use-old,-O}'[use the old profile if one was selected]'
- '(- :)'{--use-portage-chost,-P}'[only set profile if its CHOST matches /etc/{portage/}make.conf]:profiles:_gcc_profile'
+ '(- :)'{--force,-f}'[make sure all config files are regenerated]'
'(- :)'{--get-current-profile,-c}'[print current used gcc profile]'
'(- :)'{--list-profiles,-l}'[print a list of available profiles]'
- '(- :)'{--print-environ,-E}'[print environment of the given/current profile]:profiles:_gcc_profile'
- '(- :)'{--get-bin-path,-B}'[print binary path of given/current profile]:profiles:_gcc_profile'
- '(- :)'{--get-lib-path,-L}'[print library path of given/current profile]:profiles:_gcc_profile'
- '(- :)'{--get-stdcxx-incdir,-X}'[print g++ include path of given/current profile]:profiles:_gcc_profile'
+ '(- :)'{--split-profile,-S}'[split profiles into their components]'
+ '(- :)'{--print-environ,-E}'[print environment of the given/current profile]:profiles:_gcc_profiles'
+ '(- :)'{--get-bin-path,-B}'[print binary path of given/current profile]:profiles:_gcc_profiles'
+ '(- :)'{--get-lib-path,-L}'[print library path of given/current profile]:profiles:_gcc_profiles'
'(- :)'{--help,-h}'[show help]'
- '(- :)'{--version,-v}'[show version info]'
- '(- :):profiles:_gcc_profile'
+ '(- :):profiles:_gcc_profiles'
)
-_gcc_profile(){
- local profile
- profile=(${(f)"$(_call_program gcc-installed RC_NOCOLOR=yes gcc-config --list-profiles)"})
- profile=${${profile/\[([^]]*)\]/}/\*}
- _tags profile && { compadd "$@" -k profile || compadd "$@" ${(kv)=profile} }
+_gcc_profiles(){
+ local profiles
+ profiles=(${(f)"$(_call_program gcc-installed RC_NOCOLOR=yes gcc-config --list-profiles)"})
+ profiles=${${profiles/\[([^]]*)\]/}/\*}
+ _tags profiles && { compadd "$@" -k profiles || compadd "$@" ${(kv)=profiles} }
}
_arguments $arguments
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-12-20 3:08 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-12-20 3:08 UTC (permalink / raw
To: gentoo-commits
commit: c1fd6c1b4b85b2359264dceadd75fd15cdc64e38
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 20 02:48:03 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Sat Dec 20 02:48:03 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=c1fd6c1b
drop unnecessary softtabstop setting for vim
---
src/_eselect | 2 +-
src/_gcc-config | 2 +-
src/_genlop | 2 +-
src/_gentoo_packages | 2 +-
src/_gentoo_repos | 2 +-
src/_gentoolkit | 2 +-
src/_layman | 2 +-
src/_openrc | 2 +-
src/_portage | 2 +-
src/_portage_utils | 2 +-
10 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/_eselect b/src/_eselect
index 21d0d09..46b8477 100644
--- a/src/_eselect
+++ b/src/_eselect
@@ -196,4 +196,4 @@ _eselect () {
_eselect "$@"
-# vim: set et sw=2 sts=2 ts=2 ft=zsh:
+# vim: set et sw=2 ts=2 ft=zsh:
diff --git a/src/_gcc-config b/src/_gcc-config
index ce61113..4f89485 100644
--- a/src/_gcc-config
+++ b/src/_gcc-config
@@ -27,4 +27,4 @@ _gcc_profile(){
_arguments $arguments
-# vim: set et sw=2 sts=2 ts=2 ft=zsh:
+# vim: set et sw=2 ts=2 ft=zsh:
diff --git a/src/_genlop b/src/_genlop
index 420c8c5..176916c 100644
--- a/src/_genlop
+++ b/src/_genlop
@@ -100,4 +100,4 @@ _months() {
fi
}
-# vim: set et sw=2 sts=2 ts=2 ft=zsh:
+# vim: set et sw=2 ts=2 ft=zsh:
diff --git a/src/_gentoo_packages b/src/_gentoo_packages
index ab21f33..fa782e4 100644
--- a/src/_gentoo_packages
+++ b/src/_gentoo_packages
@@ -230,4 +230,4 @@ _gentoo_cache_policy () {
_gentoo_packages "$@"
-# vim: set et sw=2 sts=2 ts=2 ft=zsh:
+# vim: set et sw=2 ts=2 ft=zsh:
diff --git a/src/_gentoo_repos b/src/_gentoo_repos
index 27e98dd..ff4136b 100644
--- a/src/_gentoo_repos
+++ b/src/_gentoo_repos
@@ -82,4 +82,4 @@ _parsereposconf() {
_gentoo_repos "$@"
-# vim: set et sw=2 sts=2 ts=2 ft=zsh:
+# vim: set et sw=2 ts=2 ft=zsh:
diff --git a/src/_gentoolkit b/src/_gentoolkit
index 903e4b6..1b09c4a 100644
--- a/src/_gentoolkit
+++ b/src/_gentoolkit
@@ -402,4 +402,4 @@ case "$service" in
;;
esac
-# vim: set et sw=2 sts=2 ts=2 ft=zsh:
+# vim: set et sw=2 ts=2 ft=zsh:
diff --git a/src/_layman b/src/_layman
index bf22ded..75070f0 100644
--- a/src/_layman
+++ b/src/_layman
@@ -56,4 +56,4 @@ actions_args=(
_arguments $global_opts[@] $actions_args[@]
-# vim: set et sw=2 sts=2 ts=2 ft=zsh:
+# vim: set et sw=2 ts=2 ft=zsh:
diff --git a/src/_openrc b/src/_openrc
index 3a250f4..f467f1a 100644
--- a/src/_openrc
+++ b/src/_openrc
@@ -84,4 +84,4 @@ case "$service" in
;;
esac
-# vim: set et sw=2 sts=2 ts=2 ft=zsh:
+# vim: set et sw=2 ts=2 ft=zsh:
diff --git a/src/_portage b/src/_portage
index 7610937..15a9560 100644
--- a/src/_portage
+++ b/src/_portage
@@ -369,4 +369,4 @@ case "$service" in
;;
esac
-# vim: set et sw=2 sts=2 ts=2 ft=zsh:
+# vim: set et sw=2 ts=2 ft=zsh:
diff --git a/src/_portage_utils b/src/_portage_utils
index 962cc62..acff1a6 100644
--- a/src/_portage_utils
+++ b/src/_portage_utils
@@ -188,4 +188,4 @@ case $service in
;;
esac
-# vim: set et sw=2 sts=2 ts=2 ft=zsh:
+# vim: set et sw=2 ts=2 ft=zsh:
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-12-20 2:35 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-12-20 2:35 UTC (permalink / raw
To: gentoo-commits
commit: 52d16f8a397b247a1e2e662827507b7f86d77fc6
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 20 02:20:38 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Sat Dec 20 02:32:52 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=52d16f8a
array formatting, whitespace consistency, and other minor cleanups
---
src/_genlop | 85 ++++++++++++++++++++++++++++-----------------------------
src/_gentoolkit | 9 ++++--
src/_portage | 36 ++++++++++++++----------
3 files changed, 68 insertions(+), 62 deletions(-)
diff --git a/src/_genlop b/src/_genlop
index 92c844b..420c8c5 100644
--- a/src/_genlop
+++ b/src/_genlop
@@ -3,73 +3,70 @@
#genlop 0.30.8
_genlop () {
-local prev1="$words[CURRENT-1]" prev2="$words[CURRENT-2]" days months arg single state lstate
-days=(monday tuesday wednesday thursday friday saturday sunday)
-months=(january february march april may june july august september october november december)
-arg=( --current -c --time -t --gmt -g --info -i --file -f --rsync -r --unmerge -u --date --search -s --list -l )
-single=( --current -c --pretend -p --help -h --version -v )
+ local prev1="$words[CURRENT-1]" prev2="$words[CURRENT-2]" days months arg single state lstate
+ days=(monday tuesday wednesday thursday friday saturday sunday)
+ months=(january february march april may june july august september october november december)
+ arg=( --current -c --time -t --gmt -g --info -i --file -f --rsync -r --unmerge -u --date --search -s --list -l )
+ single=( --current -c --pretend -p --help -h --version -v )
[[ ${prev2} == (1st|2nd|3rd|4th|5th) ]] &&
- compadd in\ $months && return 0
+ compadd $months && return 0
[[ ${prev1} == ([2-9]|[1-9][0-9]*) && ${prev2} != \
- (january|february|march|april|may|june|july|august|september|october|november|december) ]] &&
+ (january|february|march|april|may|june|july|august|september|october|november|december) ]] &&
_values '' 'days ago' 'months ago' 'years ago' 'weeks ago' && return 0
[[ ${prev1} == (1) && ${prev2} != \
- (january|february|march|april|may|june|july|august|september|october|november|december) ]] &&
+ (january|february|march|april|may|june|july|august|september|october|november|december) ]] &&
_values '' 'day ago' 'month ago' 'year ago' 'week ago' && return 0
case "$prev1" in
last)
_values '' month week
- compadd $days && return 0
- ;;
+ compadd $days && return 0
+ ;;
1st|2nd|3rd|4th|5th)
- compadd $days && return 0
- ;;
+ compadd $days && return 0
+ ;;
january|february|march|april|may|june|july|august|september|october|november|december)
- compadd {1..31} && return 0
- ;;
+ compadd {1..31} && return 0
+ ;;
--date)
_message 'enter number for more options or use mm/dd/yyyy format'
- _values '' \
- last yesterday 1st 2nd 3rd 4th 5th
- _alternative \
- '*:*:_days' '*:*:_months' && return 0
- ;;
+ _values '' last yesterday 1st 2nd 3rd 4th 5th
+ _alternative '*:*:_days' '*:*:_months' && return 0
+ ;;
--file|-f)
_arguments '*:logfile:_files' && return 0
- ;;
+ ;;
*)
- _arguments \
- "($single $arg *)"{--current,-c}"[display the current merge in action]" \
- "($single)*--date[specify date of event]:date:->date" \
- "($single)*-f[specify the logfile to use]:logfile:_files" \
- "($single --gmt -g)"{--gmt,-g}"[display time in GMT/UTC format (default is local time)]" \
- "($single $arg *)"{--help,-h}"[display help information]" \
- "($single --info -i --list -l)"{--info,-i}"[print brief summary about installed ebuild]" \
- "($single --search -s --info -i --list -l *)"{--list,-l}"[list merge history]" \
- "(--nocolor -n)"{--nocolor,-n}"[disable colored output]" \
- "($single $arg *)"{--pretend,-p}"[estimate build time of a piped emerge -p]" \
- "($single --search -s --info -i --time -t --unmerge -u --rsync -r *)"{--rsync,-r}"[display rsync history]" \
- "($single --rsync -r --search -s --list -l *)"{--search,-s}"[select ebuilds matching the provided regular expression]:pattern:" \
- "($single --time -t)"{--time,-t}"[display merge time]" \
- "($single --rsync -r --unmerge -u)"{--unmerge,-u}"[display when packages have been unmerged]" \
- "($single $arg *)"{--version,-v}"[display version information]" \
- "($single)*:package:_gentoo_packages available"
- ;;
+ _arguments \
+ "($single $arg *)"{--current,-c}"[display the current merge in action]" \
+ "($single)*--date[specify date of event]:date:->date" \
+ "($single)*-f[specify the logfile to use]:logfile:_files" \
+ "($single --gmt -g)"{--gmt,-g}"[display time in GMT/UTC format (default is local time)]" \
+ "($single $arg *)"{--help,-h}"[display help information]" \
+ "($single --info -i --list -l)"{--info,-i}"[print brief summary about installed ebuild]" \
+ "($single --search -s --info -i --list -l *)"{--list,-l}"[list merge history]" \
+ "(--nocolor -n)"{--nocolor,-n}"[disable colored output]" \
+ "($single $arg *)"{--pretend,-p}"[estimate build time of a piped emerge -p]" \
+ "($single --search -s --info -i --time -t --unmerge -u --rsync -r *)"{--rsync,-r}"[display rsync history]" \
+ "($single --rsync -r --search -s --list -l *)"{--search,-s}"[select ebuilds matching the provided regular expression]:pattern:" \
+ "($single --time -t)"{--time,-t}"[display merge time]" \
+ "($single --rsync -r --unmerge -u)"{--unmerge,-u}"[display when packages have been unmerged]" \
+ "($single $arg *)"{--version,-v}"[display version information]" \
+ "($single)*:package:_gentoo_packages available"
+ ;;
esac
while [[ -n "$state" ]]; do
lstate=$state
state=''
case "$lstate" in
- date) _message 'enter number for more options or use mm/dd/yyyy format'
- _values '' \
- last yesterday 1st 2nd 3rd 4th 5th
- _alternative \
- ':*:_days' ':*:_months' && return 0
- ;;
- esac
+ date)
+ _message 'enter number for more options or use mm/dd/yyyy format'
+ _values '' last yesterday 1st 2nd 3rd 4th 5th
+ _alternative ':*:_days' ':*:_months' && return 0
+ ;;
+ esac
done
}
diff --git a/src/_gentoolkit b/src/_gentoolkit
index 0b0d956..903e4b6 100644
--- a/src/_gentoolkit
+++ b/src/_gentoolkit
@@ -22,6 +22,7 @@ _packages () {
_euse () {
local state tmp start_args suboptions_args
+
start_args=(
{'(--help)-h','(-h)--help'}'[show help]'
{'(--version)-v','(-v)--version'}'[show version]'
@@ -34,10 +35,12 @@ _euse () {
{'(--prune)-P','(-P)--prune'}'[alias for --remove]'
{'(--package)-p','(-p)--package'}'[used with -E, -D, and -R to apply to a specific package only]'
)
+
suboptions_args=(
{'(--global)-g','(-g)--global'}'[show only global use flags]'
{'(--local)-l','(-l)--local'}'[show only local use flags]'
)
+
if (( CURRENT == 2 )); then
_arguments -s $start_args
elif (( CURRENT == 3 )); then
@@ -236,10 +239,12 @@ _eclean_wrapper () {
'(: -)'{-h,--help}'[show help]'
'(: -)'{-V,--version}'[show version]'
)
+
dist_opts=(
'(-s,--size-limit)'{-s,--size-limit}'[do not delete disfiles bigger than <size>]:size:_eclean_size'
'(-f,--fetch-restricted)'{-f,--fetch-restricted}'[protect fetch-restricted files]'
)
+
# XXX: If you add options here make sure that it'll work.
# since there isn't any option *right* now, $pkg_opts
# is never used.
@@ -258,11 +263,9 @@ _eclean_wrapper () {
# global_opts and packages|distfiles otherwhise.
if (( $words[(I)(packages)] )); then
# Currently no options so return 0
- #_values "packages options" $pkg_opts &&
return 0
elif (( $words[(I)(distfiles)] )); then
- _values "distfiles options" $dist_opts &&
- return 0
+ _values "distfiles options" $dist_opts && return 0
else
_arguments -s $global_opts
# complete packages|distfiles only if CURRENT-1 don't need an arg
diff --git a/src/_portage b/src/_portage
index efa3c0e..7610937 100644
--- a/src/_portage
+++ b/src/_portage
@@ -12,7 +12,6 @@
# Still TODO:
# xpak
-# Stuff for ebuild
_ebuild () {
if (( CURRENT == 2 )); then
_files -g \*.ebuild
@@ -38,7 +37,6 @@ _ebuild () {
'manifest[Updates the manifest file for the package.]' \
'rpm[Builds a RedHat RPM package]'
fi
-
}
_quickpkg () {
@@ -65,24 +63,30 @@ _quickpkg () {
fi
}
-# Stuff for emerge
-
_emerge () {
- local nopkg_opts all noask_opts bopts install_args common_args profiles
+ local noask_opts nopkg_opts bopts all common_args install_args profiles
- noask_opts=(-p -a --pretend --ask --regen --info --search -s --searchdesc \
- -S --version -V --help -h --metadata --check-news)
+ noask_opts=(
+ -p -a --pretend --ask --regen --info --search -s --searchdesc
+ -S --version -V --help -h --metadata --check-news
+ )
- nopkg_opts=(--resume --skipfirst -c --clean -h --help --depclean --info \
- --metadata -P --prune --regen -s --search -S --searchdesc --sync -C \
- --unmerge -V --version -i --inject --list-sets --deselect --check-news)
+ nopkg_opts=(
+ --resume --skipfirst -c --clean -h --help --depclean --info
+ --metadata -P --prune --regen -s --search -S --searchdesc --sync -C
+ --unmerge -V --version -i --inject --list-sets --deselect --check-news
+ )
- bopts=($nopkg_opts -b --buildpkg -B --buildpkgonly -G --getbinpkgonly -g \
- --getbinpkg -k --usepkg -K --usepkgonly --fetch-all-uri -f -F --fetchonly)
+ bopts=(
+ $nopkg_opts -b --buildpkg -B --buildpkgonly -G --getbinpkgonly -g
+ --getbinpkg -k --usepkg -K --usepkgonly --fetch-all-uri -f -F --fetchonly
+ )
- all=($bopts -l --changelog --columns --deep -D --emptytree -e --newuse \
- --noconfmem --nodeps -O --noreplace -n --oneshot -1 -o --onlydeps --tree -t \
- -u --update -U --upgradeonly --config)
+ all=(
+ $bopts -l --changelog --columns --deep -D --emptytree -e --newuse
+ --noconfmem --nodeps -O --noreplace -n --oneshot -1 -o --onlydeps --tree -t
+ -u --update -U --upgradeonly --config
+ )
common_args=(
"($noask_opts --sync)"{-p,--pretend}"[Simply display what would be done]"
@@ -102,6 +106,7 @@ _emerge () {
"--moo[Have you mooed today?]"
"(--jobs)--jobs[Number of packages to build simultaneously]:jobs:({1.."${#${$(</proc/cpuinfo)/^processor}}"})"
)
+
install_args=(
"--deselect[Remove atom from world file]"
"--alphabetical[Sort use/other flags output alphabetically despite of status]"
@@ -191,6 +196,7 @@ _emerge () {
"(: $all[3,-1])--skipfirst[Removes the first package in the resume list]"
"($all)--keep-going[Continue merge even if a package fails to build]"
)
+
profiles=(
'world[All packages in the world profile]'
'system[All packages in the system profile]'
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-12-20 2:15 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-12-20 2:15 UTC (permalink / raw
To: gentoo-commits
commit: 210cbb7c3cf71e2d7da85c4e167ce2bdd265da3a
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 20 02:12:28 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Sat Dec 20 02:13:45 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=210cbb7c
_portage: add optional arguments for quickpkg
---
src/_portage | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/src/_portage b/src/_portage
index e9639d8..efa3c0e 100644
--- a/src/_portage
+++ b/src/_portage
@@ -41,16 +41,27 @@ _ebuild () {
}
-# Stuff for quickpkg
-
_quickpkg () {
+ local optional_args
+
+ optional_args=(
+ "(: -)"{-h,--help}'[show this help message and exit]'
+ "--umask[umask used during package creation (default is 0077)]:umask (octal)"
+ "--ignore-default-opts[do not use the QUICKPKG_DEFAULT_OPTS environment variable]"
+ "--include-config[include all files protected by CONFIG_PROTECT (as a security precaution, default is 'n')]:y or n:((y n))"
+ "--include-unmodified-config[include files protected by CONFIG_PROTECT that have not been modified since installation (as a security precaution, default is 'n')]:y or n:((y n))"
+ )
+
if compset -P '(\\|)(>=|<=|<|>|=)'; then
- _arguments -s \
- '*:installed package:_gentoo_packages installed_versions'
+ _arguments -s \
+ "$optional_args[@]" \
+ '*:installed package:_gentoo_packages installed_versions'
elif compset -P '(\\|)[/]'; then
_path_files -W / -/
else
- _arguments '*:installed package:_gentoo_packages installed'
+ _arguments \
+ "$optional_args[@]" \
+ '*:installed package:_gentoo_packages installed'
fi
}
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-12-20 2:15 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-12-20 2:15 UTC (permalink / raw
To: gentoo-commits
commit: 6a8e0ecd0c8ff254df250bd2f6f8dd4166795219
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 20 01:47:00 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Sat Dec 20 01:47:55 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=6a8e0ecd
move duplicated repos functionality to _gentoo_repos
For dependent scripts, it only requires renaming `_portdir` calls to use
`_gentoo_repos` instead, optional arguments (-o) remain the same for
now.
---
src/_gentoo_packages | 90 ++++------------------------------------------------
src/_gentoo_repos | 85 +++++++++++++++++++++++++++++++++++++++++++++++++
src/_portage_utils | 78 +--------------------------------------------
3 files changed, 93 insertions(+), 160 deletions(-)
diff --git a/src/_gentoo_packages b/src/_gentoo_packages
index e96eac8..ab21f33 100644
--- a/src/_gentoo_packages
+++ b/src/_gentoo_packages
@@ -6,82 +6,6 @@ setopt extendedglob bareglobqual
# inspired by _deb_packages
#Usage: _gentoo_packages installed|available|installed_versions|available_versions|binary|category|useflag
-_portdir() {
- local mainreponame mainrepopath overlayname overlaypath
-
- if [[ -e /usr/share/portage/config/repos.conf ]]; then
- if [[ ${1} == "-o" ]]; then
- for overlayname in $(_parsereposconf -l); do
- overlaypath+=($(_parsereposconf ${overlayname} location))
- done
-
- source /etc/make.conf 2>/dev/null
- source /etc/portage/make.conf 2>/dev/null
-
- overlaypath+=(${(@)PORTDIR_OVERLAY})
-
- echo "${(@u)overlaypath}"
- else
- mainreponame=$(_parsereposconf DEFAULT main-repo)
- mainrepopath=$(_parsereposconf ${mainreponame} location)
-
- echo "${mainrepopath}"
- fi
- else
- source /usr/share/portage/config/make.globals 2>/dev/null
- source /etc/make.conf 2>/dev/null
- source /etc/portage/make.conf 2>/dev/null
-
- if [[ ${1} == "-o" ]]; then
- echo "${(@u)PORTDIR_OVERLAY}"
- else
- echo "${PORTDIR}"
- fi
- fi
-}
-
-_parsereposconf() {
- local v f insection section arr
-
- for f in /usr/share/portage/config/repos.conf \
- /etc/portage/repos.conf \
- /etc/portage/repos.conf/*.conf; do
-
- [[ -f ${f} ]] || continue
- insection=0
- declare -A arr
- IFS='= '
-
- while read -r name value; do
- [[ -z ${name} || ${name} == '#'* ]] && continue
-
- if [[ (${name} == '['*']') && (-z ${value}) ]]; then
- value=${name//(\]|\[)}
- name="section"
- fi
- arr[${name}]=${value}
-
- if [[ ${insection} == 1 && ${name} == "section" ]]; then
- break
- elif [[ ${name} == "section" ]]; then
- [[ ${value} == ${1} ]] && insection=1
- secname+=(${value})
- elif [[ ${insection} == 1 ]]; then
- if [[ ${name} == ${2} ]]; then
- v=${value}
- fi
- fi
- continue
- done < ${f}
- done
-
- if [[ ${1} == "-l" ]]; then
- echo "${(@)secname}"
- else
- echo "${v}"
- fi
-}
-
_parsesetsconf() {
[[ -d ${1} ]] || continue
@@ -141,7 +65,7 @@ _gentoo_packages_update_installed_sets() {
}
_gentoo_packages_update_available_sets() {
- trees=($(_portdir -o) /etc/portage /usr/share/portage/config)
+ trees=($(_gentoo_repos -o) /etc/portage /usr/share/portage/config)
for PORTDIR in ${(@)trees}; do
if [[ -d ${PORTDIR} ]]; then
setsdir="$(_parsesetsconf ${PORTDIR})"
@@ -165,7 +89,7 @@ _gentoo_packages_update_useflag(){
local flags trees
flags=()
- trees=($(_portdir) $(_portdir -o))
+ trees=($(_gentoo_repos) $(_gentoo_repos -o))
for PORTDIR in ${trees[@]}; do
[[ -r ${PORTDIR}/profiles/use.desc ]] &&
@@ -190,7 +114,7 @@ _gentoo_packages_update_active_useflag(){
_gentoo_packages_update_category(){
local trees category
- trees=($(_portdir) $(_portdir -o))
+ trees=($(_gentoo_repos) $(_gentoo_repos -o))
category=( $trees/*-*(/:t) )
_wanted cat_packages expl 'category' compadd "$@" $category
}
@@ -220,7 +144,7 @@ _gentoo_packages_update_installed_versions(){
_gentoo_packages_update_available_pkgnames_only(){
local trees packages
- trees=($(_portdir) $(_portdir -o))
+ trees=($(_gentoo_repos) $(_gentoo_repos -o))
packages=($trees/*-*/*(:t))
_wanted packages expl 'package' compadd - "${(@)packages}"
@@ -229,7 +153,7 @@ _gentoo_packages_update_available_pkgnames_only(){
_gentoo_packages_update_available(){
local trees category packages pkg expl
- trees=($(_portdir) $(_portdir -o))
+ trees=($(_gentoo_repos) $(_gentoo_repos -o))
category=($trees/*-*(/:t))
packages=($trees/*-*/*(:t))
@@ -251,8 +175,8 @@ _gentoo_packages_update_available(){
_gentoo_packages_update_available_versions(){
local var overlay_ebuilds portage_ebuilds expl trees category
- PORTDIR=$(_portdir)
- PORTDIR_OVERLAY=$(_portdir -o)
+ PORTDIR=$(_gentoo_repos)
+ PORTDIR_OVERLAY=$(_gentoo_repos -o)
trees=($PORTDIR $=PORTDIR_OVERLAY)
category=($trees/*-*(/:t))
diff --git a/src/_gentoo_repos b/src/_gentoo_repos
new file mode 100644
index 0000000..27e98dd
--- /dev/null
+++ b/src/_gentoo_repos
@@ -0,0 +1,85 @@
+#autoload
+
+# Usage:
+# _gentoo_repos -> returns the main repo (with PORTDIR fallback)
+# _gentoo_repos -o -> returns the list of non-main repos (with PORTDIR_OVERLAY fallback)
+
+_gentoo_repos() {
+ local mainreponame mainrepopath overlayname overlaypath
+
+ if [[ -e /usr/share/portage/config/repos.conf ]]; then
+ if [[ ${1} == "-o" ]]; then
+ for overlayname in $(_parsereposconf -l); do
+ overlaypath+=($(_parsereposconf ${overlayname} location))
+ done
+
+ source /etc/make.conf 2>/dev/null
+ source /etc/portage/make.conf 2>/dev/null
+
+ overlaypath+=(${(@)PORTDIR_OVERLAY})
+
+ echo "${(@u)overlaypath}"
+ else
+ mainreponame=$(_parsereposconf DEFAULT main-repo)
+ mainrepopath=$(_parsereposconf ${mainreponame} location)
+
+ echo "${mainrepopath}"
+ fi
+ else
+ source /usr/share/portage/config/make.globals 2>/dev/null
+ source /etc/make.conf 2>/dev/null
+ source /etc/portage/make.conf 2>/dev/null
+
+ if [[ ${1} == "-o" ]]; then
+ echo "${(@u)PORTDIR_OVERLAY}"
+ else
+ echo "${PORTDIR}"
+ fi
+ fi
+}
+
+_parsereposconf() {
+ local v f insection section arr
+
+ for f in /usr/share/portage/config/repos.conf \
+ /etc/portage/repos.conf \
+ /etc/portage/repos.conf/*.conf; do
+
+ [[ -f ${f} ]] || continue
+ insection=0
+ declare -A arr
+ IFS='= '
+
+ while read -r name value; do
+ [[ -z ${name} || ${name} == '#'* ]] && continue
+
+ if [[ (${name} == '['*']') && (-z ${value}) ]]; then
+ value=${name//(\]|\[)}
+ name="section"
+ fi
+ arr[${name}]=${value}
+
+ if [[ ${insection} == 1 && ${name} == "section" ]]; then
+ break
+ elif [[ ${name} == "section" ]]; then
+ [[ ${value} == ${1} ]] && insection=1
+ secname+=(${value})
+ elif [[ ${insection} == 1 ]]; then
+ if [[ ${name} == ${2} ]]; then
+ v=${value}
+ fi
+ fi
+ continue
+ done < ${f}
+ done
+
+ if [[ ${1} == "-l" ]]; then
+ echo "${(@)secname}"
+ else
+ echo "${v}"
+ fi
+}
+
+_gentoo_repos "$@"
+
+# vim: set et sw=2 sts=2 ts=2 ft=zsh:
diff --git a/src/_portage_utils b/src/_portage_utils
index 95811c8..962cc62 100644
--- a/src/_portage_utils
+++ b/src/_portage_utils
@@ -2,85 +2,9 @@
# portage-utils-0.53
-_portdir() {
- local mainreponame mainrepopath overlayname overlaypath
-
- if [[ -e /usr/share/portage/config/repos.conf ]]; then
- if [[ ${1} == "-o" ]]; then
- for overlayname in $(_parsereposconf -l); do
- overlaypath+=($(_parsereposconf ${overlayname} location))
- done
-
- source /etc/make.conf 2>/dev/null
- source /etc/portage/make.conf 2>/dev/null
-
- overlaypath+=(${(@)PORTDIR_OVERLAY})
-
- echo "${(@u)overlaypath}"
- else
- mainreponame=$(_parsereposconf DEFAULT main-repo)
- mainrepopath=$(_parsereposconf ${mainreponame} location)
-
- echo "${mainrepopath}"
- fi
- else
- source /usr/share/portage/config/make.globals 2>/dev/null
- source /etc/make.conf 2>/dev/null
- source /etc/portage/make.conf 2>/dev/null
-
- if [[ ${1} == "-o" ]]; then
- echo "${(@u)PORTDIR_OVERLAY}"
- else
- echo "${PORTDIR}"
- fi
- fi
-}
-
-_parsereposconf() {
- local v f insection section arr
-
- for f in /usr/share/portage/config/repos.conf \
- /etc/portage/repos.conf \
- /etc/portage/repos.conf/*.conf; do
-
- [[ -f ${f} ]] || continue
- insection=0
- declare -A arr
- IFS='= '
-
- while read -r name value; do
- [[ -z ${name} || ${name} == '#'* ]] && continue
-
- if [[ (${name} == '['*']') && (-z ${value}) ]]; then
- value=${name//(\]|\[)}
- name="section"
- fi
- arr[${name}]=${value}
-
- if [[ ${insection} == 1 && ${name} == "section" ]]; then
- break
- elif [[ ${name} == "section" ]]; then
- [[ ${value} == ${1} ]] && insection=1
- secname+=(${value})
- elif [[ ${insection} == 1 ]]; then
- if [[ ${name} == ${2} ]]; then
- v=${value}
- fi
- fi
- continue
- done < ${f}
- done
-
- if [[ ${1} == "-l" ]]; then
- echo "${(@)secname}"
- else
- echo "${v}"
- fi
-}
-
local common_args PORTDIR
-PORTDIR="$(_portdir)"
+PORTDIR="$(_gentoo_repos)"
common_args=(
'--root[Set the ROOT env var]:root directory:_files -/' \
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-12-18 16:59 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-12-18 16:59 UTC (permalink / raw
To: gentoo-commits
commit: b59abbeb9423d75dc258d900bd3ea7dded586b98
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 17 23:09:03 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Wed Dec 17 23:09:03 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=b59abbeb
use consistent indentation (2 spaces) and add vim modelines
---
src/_eselect | 322 ++++++++++++++--------------
src/_gcc-config | 35 ++--
src/_genlop | 173 +++++++--------
src/_gentoo_packages | 446 +++++++++++++++++++--------------------
src/_gentoolkit | 577 +++++++++++++++++++++++++--------------------------
src/_layman | 74 ++++---
src/_openrc | 150 ++++++-------
src/_portage | 466 ++++++++++++++++++++---------------------
src/_portage_utils | 466 ++++++++++++++++++++---------------------
9 files changed, 1355 insertions(+), 1354 deletions(-)
diff --git a/src/_eselect b/src/_eselect
index c012955..21d0d09 100644
--- a/src/_eselect
+++ b/src/_eselect
@@ -1,197 +1,199 @@
#compdef eselect
common_values=(
- "help[Display help text]"
- "usage[Display usage information]"
- "version[Display version information]"
+ "help[Display help text]"
+ "usage[Display usage information]"
+ "version[Display version information]"
)
_eselect_env () {
- if (( $words[(I)(update)] )); then
- _values "update options" \
- "makelinks[force updating of links]" \
- "noldconfig[Do not alter the ld.so cache or configuration]" && return 0
- fi
- _values "env options" $common_values \
- 'update[Collect environment variables from all scripts in /etc/env.d/]' && return 0
+ if (( $words[(I)(update)] )); then
+ _values "update options" \
+ "makelinks[force updating of links]" \
+ "noldconfig[Do not alter the ld.so cache or configuration]" && return 0
+ fi
+ _values "env options" $common_values \
+ 'update[Collect environment variables from all scripts in /etc/env.d/]' && return 0
}
_eselect_binutils () {
- local binutilslist
- if (( $words[(I)(set)] )); then
- binutilslist=(${(f)"$(eselect --brief --color=no binutils list)"})
- _values "available binutils version" $binutilslist[@] && return 0
- fi
- _values "binutils options" $common_values \
- "list[List all installed version of binutils]" \
- "show[Print the currently active binutils version]" \
- "set[Activate one of the installed binutils]" && return 0
+ local binutilslist
+ if (( $words[(I)(set)] )); then
+ binutilslist=(${(f)"$(eselect --brief --color=no binutils list)"})
+ _values "available binutils version" $binutilslist[@] && return 0
+ fi
+ _values "binutils options" $common_values \
+ "list[List all installed version of binutils]" \
+ "show[Print the currently active binutils version]" \
+ "set[Activate one of the installed binutils]" && return 0
}
_eselect_kernel () {
- local kernellist
- if (( $words[(I)(set)] )); then
- kernellist=(${(f)"$(eselect --brief --color=no kernel list)"})
- _values "available kernel version" $kernellist[@] && return 0
- fi
- _values "kernel options" $common_values \
- "list[List available kernel symlink targets]" \
- "show[Show the current kernel symlink]" \
- "set[Set a new kernel symlink target]" && return 0
+ local kernellist
+ if (( $words[(I)(set)] )); then
+ kernellist=(${(f)"$(eselect --brief --color=no kernel list)"})
+ _values "available kernel version" $kernellist[@] && return 0
+ fi
+ _values "kernel options" $common_values \
+ "list[List available kernel symlink targets]" \
+ "show[Show the current kernel symlink]" \
+ "set[Set a new kernel symlink target]" && return 0
}
_eselect_ctags () {
- local ctagslist
- if (( $words[(I)(set)] )); then
- ctagslist=(${(f)"$(eselect --brief --color=no ctags list)"})
- _values "available ctags version" $ctagslist[@] && return 0
- fi
- _values "ctags options" $common_values \
- "list[List available ctags symlink targets]" \
- "show[Show the current target of the ctags symlink]" \
- "update[Automatically update the ctags symlink]" \
- "set[Set a new ctags symlink target]" && return 0
+ local ctagslist
+ if (( $words[(I)(set)] )); then
+ ctagslist=(${(f)"$(eselect --brief --color=no ctags list)"})
+ _values "available ctags version" $ctagslist[@] && return 0
+ fi
+ _values "ctags options" $common_values \
+ "list[List available ctags symlink targets]" \
+ "show[Show the current target of the ctags symlink]" \
+ "update[Automatically update the ctags symlink]" \
+ "set[Set a new ctags symlink target]" && return 0
}
_eselect_profile () {
- local profilelist
- if (( $words[(I)(set)] )); then
- profilelist=(${${(f)"$(eselect --brief --color=no profile list)"}/:/\\:})
- _values -w "available profiles" $profilelist[@] \
- "--force[Forcibly set the symlink]" && return 0
- fi
- _values "profile options" $common_values \
- "list[List available profile symlink targets]" \
- "show[Show the current make.profile symlink]" \
- "set[Set a new profile symlink target]" && return 0
+ local profilelist
+ if (( $words[(I)(set)] )); then
+ profilelist=(${${(f)"$(eselect --brief --color=no profile list)"}/:/\\:})
+ _values -w "available profiles" $profilelist[@] \
+ "--force[Forcibly set the symlink]" && return 0
+ fi
+ _values "profile options" $common_values \
+ "list[List available profile symlink targets]" \
+ "show[Show the current make.profile symlink]" \
+ "set[Set a new profile symlink target]" && return 0
}
_eselect_fontconfig () {
- local fclistenabled fclistdisabled
- if (( $words[(I)(enable)] )); then
- fclistdisabled=(${${${${(M)${(f)"$(eselect --color=no fontconfig list)"}## *}#*\*}// \**/}//( \[*\] | \[*\] )/})
- _values -w ".conf to enable" $fclistdisabled[@] && return 0
- elif (( $words[(I)(disable)] )); then
- fclistenabled=(${${${(M)${(M)${(f)"$(eselect --color=no fontconfig list)"}## *}#*\*}// \**/}//( \[*\] | \[*\] )/})
- _values -w ".conf to disable" $fclistenabled[@] && return 0
- fi
- _values "fontconfig options" $common_values \
- "list[List available fontconfig .conf files]" \
- "disable[Disable specified fontconfig .conf file(s)]" \
- "enable[Enable specified fontconfig .conf file(s)]" && return 0
+ local fclistenabled fclistdisabled
+ if (( $words[(I)(enable)] )); then
+ fclistdisabled=(${${${${(M)${(f)"$(eselect --color=no fontconfig list)"}## *}#*\*}// \**/}//( \[*\] | \[*\] )/})
+ _values -w ".conf to enable" $fclistdisabled[@] && return 0
+ elif (( $words[(I)(disable)] )); then
+ fclistenabled=(${${${(M)${(M)${(f)"$(eselect --color=no fontconfig list)"}## *}#*\*}// \**/}//( \[*\] | \[*\] )/})
+ _values -w ".conf to disable" $fclistenabled[@] && return 0
+ fi
+ _values "fontconfig options" $common_values \
+ "list[List available fontconfig .conf files]" \
+ "disable[Disable specified fontconfig .conf file(s)]" \
+ "enable[Enable specified fontconfig .conf file(s)]" && return 0
}
_eselect_opengl () {
- local opengllist
- if (( $words[(I)(set)] )); then
- opengllist=(${(f)"$(eselect --brief --color=no opengl list)"})
- _values -w "opengl implementations and options" $opengllist[@] \
- "--use-old[If an implementation is already set, use that one instead]" \
- "--prefix[Set the source prefix]:path:_files -/" \
- "--dst-prefix[Set the destination prefix]:path:_files -/" \
- "--ignore-missing[Ignore missing files when setting a new implementation]" && return 0
- fi
- _values "opengl options" $common_values \
- "list[List the available OpenGL implementations]" \
- "set[Select the OpenGL implementation]" \
- "show[Print the current OpenGL implementation]" && return 0
+ local opengllist
+ if (( $words[(I)(set)] )); then
+ opengllist=(${(f)"$(eselect --brief --color=no opengl list)"})
+ _values -w "opengl implementations and options" $opengllist[@] \
+ "--use-old[If an implementation is already set, use that one instead]" \
+ "--prefix[Set the source prefix]:path:_files -/" \
+ "--dst-prefix[Set the destination prefix]:path:_files -/" \
+ "--ignore-missing[Ignore missing files when setting a new implementation]" && return 0
+ fi
+ _values "opengl options" $common_values \
+ "list[List the available OpenGL implementations]" \
+ "set[Select the OpenGL implementation]" \
+ "show[Print the current OpenGL implementation]" && return 0
}
_eselect_vi () {
- local vilist
- if (( $words[(I)(set)] )); then
- vilist=(${(f)"$(eselect --brief --color=no vi list)"})
- _values -w "vi implementation" $vilist[@] && return 0
- elif (( $words[(I)(update)] )); then
- _values -w "option" "--if-unset[Do not override existing implementation]" && return 0
- fi
- _values "vi options" $common_values \
- "list[List available vi implementations]" \
- "set[Set a new vi implementation provider]" \
- "show[Show the current vi implementation]" \
- "update[Automatically update the vi provider]"
+ local vilist
+ if (( $words[(I)(set)] )); then
+ vilist=(${(f)"$(eselect --brief --color=no vi list)"})
+ _values -w "vi implementation" $vilist[@] && return 0
+ elif (( $words[(I)(update)] )); then
+ _values -w "option" "--if-unset[Do not override existing implementation]" && return 0
+ fi
+ _values "vi options" $common_values \
+ "list[List available vi implementations]" \
+ "set[Set a new vi implementation provider]" \
+ "show[Show the current vi implementation]" \
+ "update[Automatically update the vi provider]"
}
_eselect_news() {
- ## TODO: Normal numeric sorting.
- ## I've spent many time on trying to rewrite this
- ## function to normally sort (to DO NOT sort, actually) items,
- ## but it growing bigger and bigger and going to be too complicated.
- ## So, I (mva) either need to help to make it in the "right way".
- ## Or, maybe, to completely rewrite this compdef.
-
- local -a newslist;
- if ((CURRENT == 3)); then
- _values 'news options' $stdopts[@] \
- 'list[List news items]' \
- 'count[Display number of news items]' \
- 'purge[Purge read news]' \
- 'read[Read news items]' \
- 'unread[Mark read news items as unread again]' && return 0
- elif ((CURRENT == 4)); then
- if (( $words[(I)(count)] )); then
- _values -w 'news' 'new[Count only new news items]' 'all[Count all news items]' && return 0
- fi
-
- newslist=(${${${${${${${(M)${(f)"$(eselect --color=no news list)"}## *}// \**/}/ \[/}/\] ##/\[}/%/]}/ \[/ (}/\] /) })
-
- if (( $words[(I)(read)] )); then
- newslist+=( "new[Read unread news items (default)]" "all[Read all news items]" "--mbox[Output in mbox format]" "--quiet[Suppress output, only change status]" "--raw[Output in raw format]" )
- fi;
-
- if (( $words[(I)(unread)] )); then
- newslist+=( "all[Unread all news items]" )
- fi
-
- _values -w 'news' $newslist[@] && return 0
- fi
+ ## TODO: Normal numeric sorting.
+ ## I've spent many time on trying to rewrite this
+ ## function to normally sort (to DO NOT sort, actually) items,
+ ## but it growing bigger and bigger and going to be too complicated.
+ ## So, I (mva) either need to help to make it in the "right way".
+ ## Or, maybe, to completely rewrite this compdef.
+
+ local -a newslist;
+ if ((CURRENT == 3)); then
+ _values 'news options' $stdopts[@] \
+ 'list[List news items]' \
+ 'count[Display number of news items]' \
+ 'purge[Purge read news]' \
+ 'read[Read news items]' \
+ 'unread[Mark read news items as unread again]' && return 0
+ elif ((CURRENT == 4)); then
+ if (( $words[(I)(count)] )); then
+ _values -w 'news' 'new[Count only new news items]' 'all[Count all news items]' && return 0
+ fi
+
+ newslist=(${${${${${${${(M)${(f)"$(eselect --color=no news list)"}## *}// \**/}/ \[/}/\] ##/\[}/%/]}/ \[/ (}/\] /) })
+
+ if (( $words[(I)(read)] )); then
+ newslist+=( "new[Read unread news items (default)]" "all[Read all news items]" "--mbox[Output in mbox format]" "--quiet[Suppress output, only change status]" "--raw[Output in raw format]" )
+ fi;
+
+ if (( $words[(I)(unread)] )); then
+ newslist+=( "all[Unread all news items]" )
+ fi
+
+ _values -w 'news' $newslist[@] && return 0
+ fi
}
_eselect () {
- local globopts modnames modopts
-
- globopts=(
- "--brief[Make output shorter]"
- "--colour=no[Disable coloured output]"
- "--color=no[Disable coloured output]"
- )
- modnames=(${${${(M)${(f)"$(eselect --brief --color=no modules list)"}## *}// */}// /})
-
- if ((CURRENT == 2)); then
- _arguments -s \
- "$globopts[@]" \
- "*:portage:_values 'eselect modules' \$modnames[@]" && return 0
- elif ((CURRENT == 3)); then
- if [[ $words[2] == --colour=no || $words[2] == --color=no ]]; then
- _arguments -s \
- "*:portage:_values 'eselect modules' \$modnames[@]" && return 0
- elif (( $modnames[(I)$words[2]] )); then
- if [[ "$words[2]" == (env|binutils|kernel|ctags|profile|fontconfig|opengl|vi|news) ]]; then
- _eselect_$words[2] "$@"
- else
- modopts=(${${${(M)${(f)"$(eselect --brief --color=no $words[2] usage)"}## *}// */}// /})
- _arguments -s \
- "*:portage:_values 'eselect $words[2] options' \$modopts[@]" && return 0
- fi
- fi
- elif ((CURRENT >= 4)); then
- if (( $words[(I)(--color=no|--colour=no)] )); then
- if (( $modnames[(I)$words[3]] )); then
- if [[ "$words[3]" == (env|binutils|kernel|ctags|profile|fontconfig|opengl|vi|news) ]]; then
- _eselect_$words[3] "$@"
- else
- modopts=(${${${${(M)${(f)"$(eselect --brief --color=no $words[3] usage)"}## *}// */}// /}// *})
- _arguments -s \
- "*:portage:_values 'eselect $words[3] options' \$modopts[@]" && return 0
- fi
- fi
- else
- if (( $modnames[(I)$words[2]] )); then
- (( $+functions[_eselect_$words[2]] )) && _eselect_$words[2] "$@"
- fi
- fi
- fi
+ local globopts modnames modopts
+
+ globopts=(
+ "--brief[Make output shorter]"
+ "--colour=no[Disable coloured output]"
+ "--color=no[Disable coloured output]"
+ )
+ modnames=(${${${(M)${(f)"$(eselect --brief --color=no modules list)"}## *}// */}// /})
+
+ if ((CURRENT == 2)); then
+ _arguments -s \
+ "$globopts[@]" \
+ "*:portage:_values 'eselect modules' \$modnames[@]" && return 0
+ elif ((CURRENT == 3)); then
+ if [[ $words[2] == --colour=no || $words[2] == --color=no ]]; then
+ _arguments -s \
+ "*:portage:_values 'eselect modules' \$modnames[@]" && return 0
+ elif (( $modnames[(I)$words[2]] )); then
+ if [[ "$words[2]" == (env|binutils|kernel|ctags|profile|fontconfig|opengl|vi|news) ]]; then
+ _eselect_$words[2] "$@"
+ else
+ modopts=(${${${(M)${(f)"$(eselect --brief --color=no $words[2] usage)"}## *}// */}// /})
+ _arguments -s \
+ "*:portage:_values 'eselect $words[2] options' \$modopts[@]" && return 0
+ fi
+ fi
+ elif ((CURRENT >= 4)); then
+ if (( $words[(I)(--color=no|--colour=no)] )); then
+ if (( $modnames[(I)$words[3]] )); then
+ if [[ "$words[3]" == (env|binutils|kernel|ctags|profile|fontconfig|opengl|vi|news) ]]; then
+ _eselect_$words[3] "$@"
+ else
+ modopts=(${${${${(M)${(f)"$(eselect --brief --color=no $words[3] usage)"}## *}// */}// /}// *})
+ _arguments -s \
+ "*:portage:_values 'eselect $words[3] options' \$modopts[@]" && return 0
+ fi
+ fi
+ else
+ if (( $modnames[(I)$words[2]] )); then
+ (( $+functions[_eselect_$words[2]] )) && _eselect_$words[2] "$@"
+ fi
+ fi
+ fi
}
_eselect "$@"
+
+# vim: set et sw=2 sts=2 ts=2 ft=zsh:
diff --git a/src/_gcc-config b/src/_gcc-config
index 3b0fcf3..ce61113 100644
--- a/src/_gcc-config
+++ b/src/_gcc-config
@@ -1,27 +1,30 @@
#compdef gcc-config
-#Author oberyno <oberyno@gmail.com>
+
+# Author oberyno <oberyno@gmail.com>
local arguments
arguments=(
- '(- :)'{--use-old,-O}'[use the old profile if one was selected]'
- '(- :)'{--use-portage-chost,-P}'[only set profile if its CHOST matches /etc/{portage/}make.conf]:profiles:_gcc_profile'
- '(- :)'{--get-current-profile,-c}'[print current used gcc profile]'
- '(- :)'{--list-profiles,-l}'[print a list of available profiles]'
- '(- :)'{--print-environ,-E}'[print environment of the given/current profile]:profiles:_gcc_profile'
- '(- :)'{--get-bin-path,-B}'[print binary path of given/current profile]:profiles:_gcc_profile'
- '(- :)'{--get-lib-path,-L}'[print library path of given/current profile]:profiles:_gcc_profile'
- '(- :)'{--get-stdcxx-incdir,-X}'[print g++ include path of given/current profile]:profiles:_gcc_profile'
- '(- :)'{--help,-h}'[show help]'
- '(- :)'{--version,-v}'[show version info]'
- '(- :):profiles:_gcc_profile'
+ '(- :)'{--use-old,-O}'[use the old profile if one was selected]'
+ '(- :)'{--use-portage-chost,-P}'[only set profile if its CHOST matches /etc/{portage/}make.conf]:profiles:_gcc_profile'
+ '(- :)'{--get-current-profile,-c}'[print current used gcc profile]'
+ '(- :)'{--list-profiles,-l}'[print a list of available profiles]'
+ '(- :)'{--print-environ,-E}'[print environment of the given/current profile]:profiles:_gcc_profile'
+ '(- :)'{--get-bin-path,-B}'[print binary path of given/current profile]:profiles:_gcc_profile'
+ '(- :)'{--get-lib-path,-L}'[print library path of given/current profile]:profiles:_gcc_profile'
+ '(- :)'{--get-stdcxx-incdir,-X}'[print g++ include path of given/current profile]:profiles:_gcc_profile'
+ '(- :)'{--help,-h}'[show help]'
+ '(- :)'{--version,-v}'[show version info]'
+ '(- :):profiles:_gcc_profile'
)
_gcc_profile(){
- local profile
- profile=(${(f)"$(_call_program gcc-installed RC_NOCOLOR=yes gcc-config --list-profiles)"})
- profile=${${profile/\[([^]]*)\]/}/\*}
- _tags profile && { compadd "$@" -k profile || compadd "$@" ${(kv)=profile} }
+ local profile
+ profile=(${(f)"$(_call_program gcc-installed RC_NOCOLOR=yes gcc-config --list-profiles)"})
+ profile=${${profile/\[([^]]*)\]/}/\*}
+ _tags profile && { compadd "$@" -k profile || compadd "$@" ${(kv)=profile} }
}
_arguments $arguments
+
+# vim: set et sw=2 sts=2 ts=2 ft=zsh:
diff --git a/src/_genlop b/src/_genlop
index 6e817fd..92c844b 100644
--- a/src/_genlop
+++ b/src/_genlop
@@ -1,6 +1,7 @@
#compdef genlop
#genlop 0.30.8
+
_genlop () {
local prev1="$words[CURRENT-1]" prev2="$words[CURRENT-2]" days months arg single state lstate
days=(monday tuesday wednesday thursday friday saturday sunday)
@@ -8,96 +9,98 @@ months=(january february march april may june july august september october nove
arg=( --current -c --time -t --gmt -g --info -i --file -f --rsync -r --unmerge -u --date --search -s --list -l )
single=( --current -c --pretend -p --help -h --version -v )
- [[ ${prev2} == (1st|2nd|3rd|4th|5th) ]] &&
- compadd in\ $months && return 0
- [[ ${prev1} == ([2-9]|[1-9][0-9]*) && ${prev2} != \
- (january|february|march|april|may|june|july|august|september|october|november|december) ]] &&
- _values '' 'days ago' 'months ago' 'years ago' 'weeks ago' && return 0
- [[ ${prev1} == (1) && ${prev2} != \
- (january|february|march|april|may|june|july|august|september|october|november|december) ]] &&
- _values '' 'day ago' 'month ago' 'year ago' 'week ago' && return 0
+ [[ ${prev2} == (1st|2nd|3rd|4th|5th) ]] &&
+ compadd in\ $months && return 0
+ [[ ${prev1} == ([2-9]|[1-9][0-9]*) && ${prev2} != \
+ (january|february|march|april|may|june|july|august|september|october|november|december) ]] &&
+ _values '' 'days ago' 'months ago' 'years ago' 'weeks ago' && return 0
+ [[ ${prev1} == (1) && ${prev2} != \
+ (january|february|march|april|may|june|july|august|september|october|november|december) ]] &&
+ _values '' 'day ago' 'month ago' 'year ago' 'week ago' && return 0
- case "$prev1" in
- last)
- _values '' month week
- compadd $days && return 0
- ;;
- 1st|2nd|3rd|4th|5th)
- compadd $days && return 0
- ;;
- january|february|march|april|may|june|july|august|september|october|november|december)
- compadd {1..31} && return 0
- ;;
- --date)
- _message 'enter number for more options or use mm/dd/yyyy format'
- _values '' \
- last yesterday 1st 2nd 3rd 4th 5th
- _alternative \
- '*:*:_days' '*:*:_months' && return 0
- ;;
- --file|-f)
- _arguments '*:logfile:_files' && return 0
- ;;
- *)
- _arguments \
- "($single $arg *)"{--current,-c}"[display the current merge in action]" \
- "($single)*--date[specify date of event]:date:->date" \
- "($single)*-f[specify the logfile to use]:logfile:_files" \
- "($single --gmt -g)"{--gmt,-g}"[display time in GMT/UTC format (default is local time)]" \
- "($single $arg *)"{--help,-h}"[display help information]" \
- "($single --info -i --list -l)"{--info,-i}"[print brief summary about installed ebuild]" \
- "($single --search -s --info -i --list -l *)"{--list,-l}"[list merge history]" \
- "(--nocolor -n)"{--nocolor,-n}"[disable colored output]" \
- "($single $arg *)"{--pretend,-p}"[estimate build time of a piped emerge -p]" \
- "($single --search -s --info -i --time -t --unmerge -u --rsync -r *)"{--rsync,-r}"[display rsync history]" \
- "($single --rsync -r --search -s --list -l *)"{--search,-s}"[select ebuilds matching the provided regular expression]:pattern:" \
- "($single --time -t)"{--time,-t}"[display merge time]" \
- "($single --rsync -r --unmerge -u)"{--unmerge,-u}"[display when packages have been unmerged]" \
- "($single $arg *)"{--version,-v}"[display version information]" \
- "($single)*:package:_gentoo_packages available"
- ;;
- esac
+ case "$prev1" in
+ last)
+ _values '' month week
+ compadd $days && return 0
+ ;;
+ 1st|2nd|3rd|4th|5th)
+ compadd $days && return 0
+ ;;
+ january|february|march|april|may|june|july|august|september|october|november|december)
+ compadd {1..31} && return 0
+ ;;
+ --date)
+ _message 'enter number for more options or use mm/dd/yyyy format'
+ _values '' \
+ last yesterday 1st 2nd 3rd 4th 5th
+ _alternative \
+ '*:*:_days' '*:*:_months' && return 0
+ ;;
+ --file|-f)
+ _arguments '*:logfile:_files' && return 0
+ ;;
+ *)
+ _arguments \
+ "($single $arg *)"{--current,-c}"[display the current merge in action]" \
+ "($single)*--date[specify date of event]:date:->date" \
+ "($single)*-f[specify the logfile to use]:logfile:_files" \
+ "($single --gmt -g)"{--gmt,-g}"[display time in GMT/UTC format (default is local time)]" \
+ "($single $arg *)"{--help,-h}"[display help information]" \
+ "($single --info -i --list -l)"{--info,-i}"[print brief summary about installed ebuild]" \
+ "($single --search -s --info -i --list -l *)"{--list,-l}"[list merge history]" \
+ "(--nocolor -n)"{--nocolor,-n}"[disable colored output]" \
+ "($single $arg *)"{--pretend,-p}"[estimate build time of a piped emerge -p]" \
+ "($single --search -s --info -i --time -t --unmerge -u --rsync -r *)"{--rsync,-r}"[display rsync history]" \
+ "($single --rsync -r --search -s --list -l *)"{--search,-s}"[select ebuilds matching the provided regular expression]:pattern:" \
+ "($single --time -t)"{--time,-t}"[display merge time]" \
+ "($single --rsync -r --unmerge -u)"{--unmerge,-u}"[display when packages have been unmerged]" \
+ "($single $arg *)"{--version,-v}"[display version information]" \
+ "($single)*:package:_gentoo_packages available"
+ ;;
+ esac
- while [[ -n "$state" ]]; do
- lstate=$state
- state=''
- case "$lstate" in
- date) _message 'enter number for more options or use mm/dd/yyyy format'
- _values '' \
- last yesterday 1st 2nd 3rd 4th 5th
- _alternative \
- ':*:_days' ':*:_months' && return 0
- ;;
- esac
- done
+ while [[ -n "$state" ]]; do
+ lstate=$state
+ state=''
+ case "$lstate" in
+ date) _message 'enter number for more options or use mm/dd/yyyy format'
+ _values '' \
+ last yesterday 1st 2nd 3rd 4th 5th
+ _alternative \
+ ':*:_days' ':*:_months' && return 0
+ ;;
+ esac
+ done
}
_days() {
- local m="monday" t="tuesday" w="wednesday" T="thursday" f="friday" s="saturday" S="sunday"
- local day=$(date +%u)
- if [[ ${day} == 1 ]] then compadd $m
- elif [[ ${day} == 2 ]] then compadd $m $t
- elif [[ ${day} == 3 ]] then compadd $m $t $w
- elif [[ ${day} == 4 ]] then compadd $m $t $w $T
- elif [[ ${day} == 5 ]] then compadd $m $t $w $T $f
- elif [[ ${day} == 6 ]] then compadd $m $t $w $T $f $s
- elif [[ ${day} == 7 ]] then compadd $m $t $w $T $f $s $S
- fi
+ local m="monday" t="tuesday" w="wednesday" T="thursday" f="friday" s="saturday" S="sunday"
+ local day=$(date +%u)
+ if [[ ${day} == 1 ]] then compadd $m
+ elif [[ ${day} == 2 ]] then compadd $m $t
+ elif [[ ${day} == 3 ]] then compadd $m $t $w
+ elif [[ ${day} == 4 ]] then compadd $m $t $w $T
+ elif [[ ${day} == 5 ]] then compadd $m $t $w $T $f
+ elif [[ ${day} == 6 ]] then compadd $m $t $w $T $f $s
+ elif [[ ${day} == 7 ]] then compadd $m $t $w $T $f $s $S
+ fi
}
_months() {
- local j="january" f="february" m="march" a="april" M="may" ju="june" J="july" A="august" s="september" o="october" n="november" d="december"
- local month=$(date +%m)
- if [[ ${month} == 01 ]] then compadd $j
- elif [[ ${month} == 02 ]] then compadd $j $f
- elif [[ ${month} == 03 ]] then compadd $j $f $m
- elif [[ ${month} == 04 ]] then compadd $j $f $m $a
- elif [[ ${month} == 05 ]] then compadd $j $f $m $a $M
- elif [[ ${month} == 06 ]] then compadd $j $f $m $a $M $ju
- elif [[ ${month} == 07 ]] then compadd $j $f $m $a $M $ju $J
- elif [[ ${month} == 08 ]] then compadd $j $f $m $a $M $ju $J $A
- elif [[ ${month} == 09 ]] then compadd $j $f $m $a $M $ju $J $A $s
- elif [[ ${month} == 10 ]] then compadd $j $f $m $a $M $ju $J $A $s $o
- elif [[ ${month} == 11 ]] then compadd $j $f $m $a $M $ju $J $A $s $o $n
- elif [[ ${month} == 12 ]] then compadd $j $f $m $a $M $ju $J $A $s $o $n $d
- fi
+ local j="january" f="february" m="march" a="april" M="may" ju="june" J="july" A="august" s="september" o="october" n="november" d="december"
+ local month=$(date +%m)
+ if [[ ${month} == 01 ]] then compadd $j
+ elif [[ ${month} == 02 ]] then compadd $j $f
+ elif [[ ${month} == 03 ]] then compadd $j $f $m
+ elif [[ ${month} == 04 ]] then compadd $j $f $m $a
+ elif [[ ${month} == 05 ]] then compadd $j $f $m $a $M
+ elif [[ ${month} == 06 ]] then compadd $j $f $m $a $M $ju
+ elif [[ ${month} == 07 ]] then compadd $j $f $m $a $M $ju $J
+ elif [[ ${month} == 08 ]] then compadd $j $f $m $a $M $ju $J $A
+ elif [[ ${month} == 09 ]] then compadd $j $f $m $a $M $ju $J $A $s
+ elif [[ ${month} == 10 ]] then compadd $j $f $m $a $M $ju $J $A $s $o
+ elif [[ ${month} == 11 ]] then compadd $j $f $m $a $M $ju $J $A $s $o $n
+ elif [[ ${month} == 12 ]] then compadd $j $f $m $a $M $ju $J $A $s $o $n $d
+ fi
}
+
+# vim: set et sw=2 sts=2 ts=2 ft=zsh:
diff --git a/src/_gentoo_packages b/src/_gentoo_packages
index da770b2..fd1dbcd 100644
--- a/src/_gentoo_packages
+++ b/src/_gentoo_packages
@@ -6,194 +6,193 @@ setopt extendedglob bareglobqual
# inspired by _deb_packages
#Usage: _gentoo_packages installed|available|installed_versions|available_versions|binary|category|useflag
-
_portdir() {
- local mainreponame mainrepopath overlayname overlaypath
+ local mainreponame mainrepopath overlayname overlaypath
- if [[ -e /usr/share/portage/config/repos.conf ]]; then
- if [[ ${1} == "-o" ]]; then
- for overlayname in $(_parsereposconf -l); do
- overlaypath+=($(_parsereposconf ${overlayname} location))
- done
+ if [[ -e /usr/share/portage/config/repos.conf ]]; then
+ if [[ ${1} == "-o" ]]; then
+ for overlayname in $(_parsereposconf -l); do
+ overlaypath+=($(_parsereposconf ${overlayname} location))
+ done
- source /etc/make.conf 2>/dev/null
- source /etc/portage/make.conf 2>/dev/null
+ source /etc/make.conf 2>/dev/null
+ source /etc/portage/make.conf 2>/dev/null
- overlaypath+=(${(@)PORTDIR_OVERLAY})
+ overlaypath+=(${(@)PORTDIR_OVERLAY})
- echo "${(@u)overlaypath}"
- else
- mainreponame=$(_parsereposconf DEFAULT main-repo)
- mainrepopath=$(_parsereposconf ${mainreponame} location)
+ echo "${(@u)overlaypath}"
+ else
+ mainreponame=$(_parsereposconf DEFAULT main-repo)
+ mainrepopath=$(_parsereposconf ${mainreponame} location)
- echo "${mainrepopath}"
- fi
+ echo "${mainrepopath}"
+ fi
+ else
+ source /usr/share/portage/config/make.globals 2>/dev/null
+ source /etc/make.conf 2>/dev/null
+ source /etc/portage/make.conf 2>/dev/null
+
+ if [[ ${1} == "-o" ]]; then
+ echo "${(@u)PORTDIR_OVERLAY}"
else
- source /usr/share/portage/config/make.globals 2>/dev/null
- source /etc/make.conf 2>/dev/null
- source /etc/portage/make.conf 2>/dev/null
-
- if [[ ${1} == "-o" ]]; then
- echo "${(@u)PORTDIR_OVERLAY}"
- else
- echo "${PORTDIR}"
- fi
+ echo "${PORTDIR}"
fi
+ fi
}
_parsereposconf() {
- local v f insection section arr
-
- for f in /usr/share/portage/config/repos.conf \
- /etc/portage/repos.conf \
- /etc/portage/repos.conf/*.conf; do
-
- [[ -f ${f} ]] || continue
- insection=0
- declare -A arr
- IFS='= '
-
- while read -r name value; do
- [[ -z ${name} || ${name} == '#'* ]] && continue
-
- if [[ (${name} == '['*']') && (-z ${value}) ]]; then
- value=${name//(\]|\[)}
- name="section"
- fi
- arr[${name}]=${value}
-
- if [[ ${insection} == 1 && ${name} == "section" ]]; then
- break
- elif [[ ${name} == "section" ]]; then
- [[ ${value} == ${1} ]] && insection=1
- secname+=(${value})
- elif [[ ${insection} == 1 ]]; then
- if [[ ${name} == ${2} ]]; then
- v=${value}
- fi
- fi
- continue
- done < ${f}
- done
-
- if [[ ${1} == "-l" ]]; then
- echo "${(@)secname}"
- else
- echo "${v}"
- fi
+ local v f insection section arr
+
+ for f in /usr/share/portage/config/repos.conf \
+ /etc/portage/repos.conf \
+ /etc/portage/repos.conf/*.conf; do
+
+ [[ -f ${f} ]] || continue
+ insection=0
+ declare -A arr
+ IFS='= '
+
+ while read -r name value; do
+ [[ -z ${name} || ${name} == '#'* ]] && continue
+
+ if [[ (${name} == '['*']') && (-z ${value}) ]]; then
+ value=${name//(\]|\[)}
+ name="section"
+ fi
+ arr[${name}]=${value}
+
+ if [[ ${insection} == 1 && ${name} == "section" ]]; then
+ break
+ elif [[ ${name} == "section" ]]; then
+ [[ ${value} == ${1} ]] && insection=1
+ secname+=(${value})
+ elif [[ ${insection} == 1 ]]; then
+ if [[ ${name} == ${2} ]]; then
+ v=${value}
+ fi
+ fi
+ continue
+ done < ${f}
+ done
+
+ if [[ ${1} == "-l" ]]; then
+ echo "${(@)secname}"
+ else
+ echo "${v}"
+ fi
}
_parsesetsconf() {
- [[ -d ${1} ]] || continue
-
- local v f places sections setsconf insection section arr
-
- if [[ -d ${1}/sets ]]; then
- setsconf=(${1}/sets/*.conf(N))
- [[ (($#setsconf > 0)) ]] && places=(${setsconf})
- elif [[ -f ${1}/sets.conf ]]; then
- places=(${1}/sets.conf)
- fi
-
- for f in ${(@)places}; do
- if [[ -r ${f} ]]; then
- insection=0
- declare -A arr
- IFS='= '
- while read -r name value; do
- [[ -z ${name} || ${name} == '#'* ]] && continue
-
- if [[ (${name} == '['*']') && (-z ${value}) ]]; then
- value=${name//(\]|\[)}
- name="section"
- fi
- arr[${name}]=${value}
-
- if [[ ${insection} == 1 && ${name} == "section" ]]; then
- [[ ${2} == "sets" ]] && [[ ! ${value} =~ "sets" ]] && sections+=(${value})
- insection=0
- elif [[ ${name} == "section" ]]; then
- [[ ${value} =~ "${1:t} sets" ]] && insection=1
- [[ ${2} == "sets" ]] && [[ ! ${value} =~ "sets" ]] && sections+=(${value})
- elif [[ ${insection} == 1 ]]; then
- [[ ${2} == "sets" ]] && continue
- if [[ ${name} == "directory" ]]; then
- v=${value}
- fi
- fi
- continue
- done < ${f}
+ [[ -d ${1} ]] || continue
+
+ local v f places sections setsconf insection section arr
+
+ if [[ -d ${1}/sets ]]; then
+ setsconf=(${1}/sets/*.conf(N))
+ [[ (($#setsconf > 0)) ]] && places=(${setsconf})
+ elif [[ -f ${1}/sets.conf ]]; then
+ places=(${1}/sets.conf)
+ fi
+
+ for f in ${(@)places}; do
+ if [[ -r ${f} ]]; then
+ insection=0
+ declare -A arr
+ IFS='= '
+ while read -r name value; do
+ [[ -z ${name} || ${name} == '#'* ]] && continue
+
+ if [[ (${name} == '['*']') && (-z ${value}) ]]; then
+ value=${name//(\]|\[)}
+ name="section"
fi
- done
-
- if [[ ${2} == "sets" ]]; then
- [[ ((${#sections} > 0)) ]] && echo ${(@)sections}
- else
- [[ ((${#v} > 0)) ]] && echo ${v:t}
+ arr[${name}]=${value}
+
+ if [[ ${insection} == 1 && ${name} == "section" ]]; then
+ [[ ${2} == "sets" ]] && [[ ! ${value} =~ "sets" ]] && sections+=(${value})
+ insection=0
+ elif [[ ${name} == "section" ]]; then
+ [[ ${value} =~ "${1:t} sets" ]] && insection=1
+ [[ ${2} == "sets" ]] && [[ ! ${value} =~ "sets" ]] && sections+=(${value})
+ elif [[ ${insection} == 1 ]]; then
+ [[ ${2} == "sets" ]] && continue
+ if [[ ${name} == "directory" ]]; then
+ v=${value}
+ fi
+ fi
+ continue
+ done < ${f}
fi
+ done
+
+ if [[ ${2} == "sets" ]]; then
+ [[ ((${#sections} > 0)) ]] && echo ${(@)sections}
+ else
+ [[ ((${#v} > 0)) ]] && echo ${v:t}
+ fi
}
_gentoo_packages_update_installed_sets() {
- local sets
- sets=($(</var/lib/portage/world_sets))
- if [[ ((${#sets} > 0)) ]]; then
- _wanted installed_sets expl 'installed set' compadd "$@" "${(o@)^sets}"
- fi
+ local sets
+ sets=($(</var/lib/portage/world_sets))
+ if [[ ((${#sets} > 0)) ]]; then
+ _wanted installed_sets expl 'installed set' compadd "$@" "${(o@)^sets}"
+ fi
}
_gentoo_packages_update_available_sets() {
- trees=($(_portdir -o) /etc/portage /usr/share/portage/config)
- for PORTDIR in ${(@)trees}; do
- if [[ -d ${PORTDIR} ]]; then
- setsdir="$(_parsesetsconf ${PORTDIR})"
- [[ ! -z "${setsdir}" ]] && setspath="${PORTDIR}/${setsdir}" || setspath="${PORTDIR}/sets"
- if [[ -d "${setspath}" ]]; then
- setsfiles=(${setspath}/*~*.conf(N))
- for set in ${setsfiles[@]}; do
- sets+=(${set}(:t))
- done
- sets+=($(_parsesetsconf ${PORTDIR} sets))
- fi
- fi
- done
- if [[ ((${#sets} > 0)) ]]; then
- _wanted available_sets expl 'available set' compadd "$@" "@${(o@)^sets}"
+ trees=($(_portdir -o) /etc/portage /usr/share/portage/config)
+ for PORTDIR in ${(@)trees}; do
+ if [[ -d ${PORTDIR} ]]; then
+ setsdir="$(_parsesetsconf ${PORTDIR})"
+ [[ ! -z "${setsdir}" ]] && setspath="${PORTDIR}/${setsdir}" || setspath="${PORTDIR}/sets"
+ if [[ -d "${setspath}" ]]; then
+ setsfiles=(${setspath}/*~*.conf(N))
+ for set in ${setsfiles[@]}; do
+ sets+=(${set}(:t))
+ done
+ sets+=($(_parsesetsconf ${PORTDIR} sets))
+ fi
fi
+ done
+ if [[ ((${#sets} > 0)) ]]; then
+ _wanted available_sets expl 'available set' compadd "$@" "@${(o@)^sets}"
+ fi
}
# Completion function to show useflags.
_gentoo_packages_update_useflag(){
- local flags trees
+ local flags trees
- flags=()
- trees=($(_portdir) $(_portdir -o))
+ flags=()
+ trees=($(_portdir) $(_portdir -o))
- for PORTDIR in ${trees[@]}; do
- [[ -r ${PORTDIR}/profiles/use.desc ]] &&
- flags+=(${${(M)${(f)"$(<$PORTDIR/profiles/use.desc)"}:#* - *}%% - *})
- [[ -r ${PORTDIR}/profiles/use.local.desc ]] &&
- flags+=(${${${(M)${(f)"$(<$PORTDIR/profiles/use.local.desc)"}#* - *}%% - *}#*:})
- done
+ for PORTDIR in ${trees[@]}; do
+ [[ -r ${PORTDIR}/profiles/use.desc ]] &&
+ flags+=(${${(M)${(f)"$(<$PORTDIR/profiles/use.desc)"}:#* - *}%% - *})
+ [[ -r ${PORTDIR}/profiles/use.local.desc ]] &&
+ flags+=(${${${(M)${(f)"$(<$PORTDIR/profiles/use.local.desc)"}#* - *}%% - *}#*:})
+ done
- compadd $flags
+ compadd $flags
}
_gentoo_packages_update_active_useflag(){
- local flags USE
- var=USE
- [[ -z ${(P)var} && -r /etc/portage/make.conf ]] &&
- local $var="`. /etc/portage/make.conf 2>/dev/null; echo ${(P)var}`"
- [[ -z ${(P)var} && -r /etc/make.conf ]] &&
- local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`"
- flags=(${${${=USE}%-*}%\\*})
- compadd $flags
+ local flags USE
+ var=USE
+ [[ -z ${(P)var} && -r /etc/portage/make.conf ]] &&
+ local $var="`. /etc/portage/make.conf 2>/dev/null; echo ${(P)var}`"
+ [[ -z ${(P)var} && -r /etc/make.conf ]] &&
+ local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`"
+ flags=(${${${=USE}%-*}%\\*})
+ compadd $flags
}
_gentoo_packages_update_category(){
- local trees category
+ local trees category
- trees=($(_portdir) $(_portdir -o))
- category=( $trees/*-*(/:t) )
- _wanted cat_packages expl 'category' compadd "$@" $category
+ trees=($(_portdir) $(_portdir -o))
+ category=( $trees/*-*(/:t) )
+ _wanted cat_packages expl 'category' compadd "$@" $category
}
_gentoo_packages_update_installed(){
@@ -209,101 +208,102 @@ _gentoo_packages_update_installed(){
}
_gentoo_packages_update_installed_versions(){
- local installed_list installed_portage expl
+ local installed_list installed_portage expl
- installed_portage=(/var/db/pkg/*-*/*)
- _wanted packages expl 'package' compadd "$@" ${installed_portage:t}
+ installed_portage=(/var/db/pkg/*-*/*)
+ _wanted packages expl 'package' compadd "$@" ${installed_portage:t}
- installed_list=(${installed_portage##*/pkg/})
- _wanted cat_packages expl 'category/package' _multi_parts "$@" / installed_list
+ installed_list=(${installed_portage##*/pkg/})
+ _wanted cat_packages expl 'category/package' _multi_parts "$@" / installed_list
}
_gentoo_packages_update_available_pkgnames_only(){
- local trees packages
+ local trees packages
- trees=($(_portdir) $(_portdir -o))
+ trees=($(_portdir) $(_portdir -o))
- packages=($trees/*-*/*(:t))
- _wanted packages expl 'package' compadd - "${(@)packages}"
+ packages=($trees/*-*/*(:t))
+ _wanted packages expl 'package' compadd - "${(@)packages}"
}
_gentoo_packages_update_available(){
- local trees category packages pkg expl
-
- trees=($(_portdir) $(_portdir -o))
- category=($trees/*-*(/:t))
-
- packages=($trees/*-*/*(:t))
- _wanted packages expl 'package' compadd - "${(@)packages}"
-
- # Complete cat/pkg. _multi_parts is much to slow for such a large task,
- # _sep_parts removes the dash from gnome-<tab>, and _path_files wants to
- # complete cat/pkg/files (if "files" is ignored with -F, miscfiles, etc...
- # don't get completed).
- if [[ $PREFIX != */* ]] ; then
- _wanted cat_packages expl 'category/package' compadd -S '/' $category
- else
- compset -P '*/'
- pkg=($trees/$IPREFIX/*(:t))
- _wanted cat_packages expl 'category/package' compadd $pkg
- fi
+ local trees category packages pkg expl
+
+ trees=($(_portdir) $(_portdir -o))
+ category=($trees/*-*(/:t))
+
+ packages=($trees/*-*/*(:t))
+ _wanted packages expl 'package' compadd - "${(@)packages}"
+
+ # Complete cat/pkg. _multi_parts is much to slow for such a large task,
+ # _sep_parts removes the dash from gnome-<tab>, and _path_files wants to
+ # complete cat/pkg/files (if "files" is ignored with -F, miscfiles, etc...
+ # don't get completed).
+ if [[ $PREFIX != */* ]]; then
+ _wanted cat_packages expl 'category/package' compadd -S '/' $category
+ else
+ compset -P '*/'
+ pkg=($trees/$IPREFIX/*(:t))
+ _wanted cat_packages expl 'category/package' compadd $pkg
+ fi
}
_gentoo_packages_update_available_versions(){
- local var overlay_ebuilds portage_ebuilds expl trees category
-
- PORTDIR=$(_portdir)
- PORTDIR_OVERLAY=$(_portdir -o)
-
- trees=($PORTDIR $=PORTDIR_OVERLAY)
- category=($trees/*-*(/:t))
- typeset -U category
-
- if [[ $#PREFIX -ge 1 && -z $words[(r)(--inject|-i)] ]] ; then
- overlay_ebuilds=($=PORTDIR_OVERLAY/*-*/${PREFIX%%-[0-9]#*}*/*.ebuild(:t:r) )
- portage_ebuilds=($PORTDIR/metadata/cache/*-*/${PREFIX%%-[0-9]#*}*(:t))
- _wanted packages expl 'package' compadd $portage_ebuilds $overlay_ebuilds
- fi
- pkg=( $trees/${PREFIX%%/*}/*/*.ebuild(:t:r) )
- _wanted cat_packages expl 'category/package' _sep_parts category / pkg
+ local var overlay_ebuilds portage_ebuilds expl trees category
+
+ PORTDIR=$(_portdir)
+ PORTDIR_OVERLAY=$(_portdir -o)
+
+ trees=($PORTDIR $=PORTDIR_OVERLAY)
+ category=($trees/*-*(/:t))
+ typeset -U category
+
+ if [[ $#PREFIX -ge 1 && -z $words[(r)(--inject|-i)] ]]; then
+ overlay_ebuilds=($=PORTDIR_OVERLAY/*-*/${PREFIX%%-[0-9]#*}*/*.ebuild(:t:r) )
+ portage_ebuilds=($PORTDIR/metadata/cache/*-*/${PREFIX%%-[0-9]#*}*(:t))
+ _wanted packages expl 'package' compadd $portage_ebuilds $overlay_ebuilds
+ fi
+ pkg=( $trees/${PREFIX%%/*}/*/*.ebuild(:t:r) )
+ _wanted cat_packages expl 'category/package' _sep_parts category / pkg
}
#Function to show tbz2 files available
_gentoo_packages_update_binary() {
- [[ -z $PKGDIR && -r /etc/portage/make.conf ]] &&
- local PKGDIR="`. /etc/portage/make.conf 2>/dev/null; echo $PKGDIR`"
- [[ -z $PKGDIR && -r /etc/make.conf ]] &&
- local PKGDIR="`. /etc/make.conf 2>/dev/null; echo $PKGDIR`"
- [[ -z $PKGDIR && -r /usr/share/portage/config/make.globals ]] &&
- local PKGDIR="`. /usr/share/portage/config/make.globals 2>/dev/null; echo $PKGDIR`"
-
- # this doesn't take care of ${PORTAGE_BINHOST}. If Gentoo official
- # binary mirror will be available we should rewrite it accordingly.
- _path_files -g \*.tbz2 -W "$PKGDIR/All"
+ [[ -z $PKGDIR && -r /etc/portage/make.conf ]] &&
+ local PKGDIR="`. /etc/portage/make.conf 2>/dev/null; echo $PKGDIR`"
+ [[ -z $PKGDIR && -r /etc/make.conf ]] &&
+ local PKGDIR="`. /etc/make.conf 2>/dev/null; echo $PKGDIR`"
+ [[ -z $PKGDIR && -r /usr/share/portage/config/make.globals ]] &&
+ local PKGDIR="`. /usr/share/portage/config/make.globals 2>/dev/null; echo $PKGDIR`"
+
+ # this doesn't take care of ${PORTAGE_BINHOST}. If Gentoo official
+ # binary mirror will be available we should rewrite it accordingly.
+ _path_files -g \*.tbz2 -W "$PKGDIR/All"
}
_gentoo_packages () {
- local command="$argv[$#]" expl cachevar pkgset update_policy
- zstyle -s ":completion:*:*:$service:*" cache-policy update_policy
- if [[ -z "$update_policy" ]]; then
- zstyle ":completion:*:*:$service:*" cache-policy _gentoo_cache_policy
- fi
- [[ "$command" == (installed(_versions|_sets|)|available(_versions|_sets|_pkgnames_only|)|binary|category|(active_|)useflag) ]] || {
- _message "unknown command: $command"
- return
- }
- [[ "$pkgset" == (installed(_versions|_sets|)|available(_versions|_sets|_pkgnames_only|)|binary|category|(active_|)useflag) ]] || {
- pkgset="$command"
- }
- expl=("${(@)argv[1,-2]}")
- _gentoo_packages_update_$pkgset
+ local command="$argv[$#]" expl cachevar pkgset update_policy
+ zstyle -s ":completion:*:*:$service:*" cache-policy update_policy
+ if [[ -z "$update_policy" ]]; then
+ zstyle ":completion:*:*:$service:*" cache-policy _gentoo_cache_policy
+ fi
+ [[ "$command" == (installed(_versions|_sets|)|available(_versions|_sets|_pkgnames_only|)|binary|category|(active_|)useflag) ]] || {
+ _message "unknown command: $command"
+ return
+ }
+ [[ "$pkgset" == (installed(_versions|_sets|)|available(_versions|_sets|_pkgnames_only|)|binary|category|(active_|)useflag) ]] || {
+ pkgset="$command"
+ }
+ expl=("${(@)argv[1,-2]}")
+ _gentoo_packages_update_$pkgset
}
_gentoo_cache_policy () {
# rebuild if cache is more than a week old
- oldp=( "$1"(mw+1) )
- (( $#oldp )) && return 0
+ oldp=( "$1"(mw+1) )
+ (( $#oldp )) && return 0
}
-
_gentoo_packages "$@"
+
+# vim: set et sw=2 sts=2 ts=2 ft=zsh:
diff --git a/src/_gentoolkit b/src/_gentoolkit
index 9ea7cc2..0b0d956 100644
--- a/src/_gentoolkit
+++ b/src/_gentoolkit
@@ -11,17 +11,15 @@
# revdep-rebuild (partial)
# eread *nothing todo*
-
# XXX: shouldn't this go to _gentoo_package?
_packages () {
- if compset -P '(\\|)(>=|<=|<|>|=)' ; then
- _gentoo_packages ${*/(#m)(installed|available)/${MATCH}_versions}
- else
- _gentoo_packages $*
- fi
+ if compset -P '(\\|)(>=|<=|<|>|=)'; then
+ _gentoo_packages ${*/(#m)(installed|available)/${MATCH}_versions}
+ else
+ _gentoo_packages $*
+ fi
}
-
_euse () {
local state tmp start_args suboptions_args
start_args=(
@@ -40,21 +38,21 @@ _euse () {
{'(--global)-g','(-g)--global'}'[show only global use flags]'
{'(--local)-l','(-l)--local'}'[show only local use flags]'
)
- if (( CURRENT == 2 ));then
+ if (( CURRENT == 2 )); then
_arguments -s $start_args
- elif (( CURRENT == 3 ));then
+ elif (( CURRENT == 3 )); then
case "$words[2]" in
-i|--info|-a|--active)
- _arguments -s $suboptions_args \
- '*:useflags:_gentoo_packages useflag' && ret=0
+ _arguments -s $suboptions_args \
+ '*:useflags:_gentoo_packages useflag' && ret=0
;;
-E|--enable)
- _arguments \
- '*:useflags:_gentoo_packages useflag' && ret=0
+ _arguments \
+ '*:useflags:_gentoo_packages useflag' && ret=0
;;
-D|--disable)
- _arguments \
- '*:active useflags:_gentoo_packages active_useflag' && ret=0
+ _arguments \
+ '*:active useflags:_gentoo_packages active_useflag' && ret=0
esac
else
_arguments \
@@ -62,7 +60,6 @@ _euse () {
fi
}
-
_equery () {
# Based off of X/_xauth.
local state context line expl ret=1
@@ -81,7 +78,6 @@ _equery () {
'(-o --overlay-tree)'{-o,--overlay-tree}'[also search in overlay tree]'
)
-
_arguments -s $start_args \
'*::command:->command' && ret=0
@@ -89,321 +85,318 @@ _equery () {
tmp="$state"
state=
case "$tmp" in
- command)
- if (( CURRENT == 1 )); then
- state=subcommands
- else
- cmd="$words[1]"
- curcontext="${curcontext%:*:*}:equery-${cmd}:"
- case "$cmd" in
- belongs|b)
- _arguments \
- '(-e --early-out)'{-e,--early-out}'[stop when first match found]' \
- '(-f --full-regex)'{-f,--full-regex}'[supplied query is a regex]:pattern:' \
- '(-n --name-only)'{-n,--name-only}"[don't print the version]" \
- '*:file:_files' && ret=0
- ;;
- changes|c)
- _arguments \
- '(-l --latest)'{-l,--latest}'[only display latest ChangeLog entry]' \
- '(-f --full)'{-f,--full}'[display full ChangeLog entry]' \
- '--limit[limit the number of entries displayed (with --full)]:number:' \
- '--from[which version to display from]' \
- '--to[which version to display to]' \
- ':portage:_packages available' && ret=0
- ;;
- check|k)
- _arguments \
- '(-f --full-regex)'{-f,--full-regex}'[supplied query is a regex]:pattern:' \
- '(-o --only-failures)'{-o,--only-failures}'[only display packages that do not pass]' \
- ':portage:_packages installed' && ret=0
- ;;
- depends|d)
- _arguments \
- '(-a --all-packages)'{-a,--all-packages}'[search in all available packages (slow)]:all packages:->packages' \
- '(-D --indirect)'{-D,--indirect}'[search indirect dependencies (VERY slow)]' \
- '--depth[limit indirect dependency tree to specified depth]:number:' \
- '*:package:_packages installed' && ret=0
- ;;
- depgraph|g)
- _arguments \
- '(-A --no-atom)'{-A,--no-atom}'[do not show dependency atom]' \
- '(-M --no-mask)'{-M,--no-mask}'[do not show masking status]' \
- '(-U --no-useflags)'{-U,--no-useflags}'[do not show USE flags]' \
- '(-l --linear)'{-l,--linear}'[do not use fancy formatting]' \
- ':package:_packages installed' && ret=0
- ;;
- files|f)
- _arguments \
- '(-m --md5sum)'{-m,--md5sum}'[include MD5 sum in output]' \
- '(-s --timestamp)'{-s,--timestamp}'[include timestamp in output]' \
- '(-t --type)'{-t,--type}'[include file type in output]' \
- '--tree[display results in a tree (turns off other options)]' \
- '--filter=[filter output]:filter(s):_values -s , '' dir obj sym dev fifo path conf cmd doc man info' \
- ':installed pkgname:_packages installed' && ret=0
- ;;
- has|a)
- _arguments \
- $common_args \
- '(-F --format)'{-F,--format}'[a format template (see man page)]:format template' \
- ':KEY:' \
- ':VALUE:' && ret=0
- ;;
- hasuse|h)
- _arguments \
- $common_args \
- '(-F --format)'{-F,--format}'[specify a custom output format]:format template' \
- ':useflag:_gentoo_packages useflag' && ret=0
- ;;
- list|l)
- _arguments \
- $common_args \
- '(-d --duplicates)'{-d,--duplicates}'[list only installed duplicate packages]' \
- '(-b --binpkgs-missing)'{-b,--binpkgs-missing}'[list only installed packages without a corresponding binary package]' \
- '(-f --full-regex)'{-f,--full-regex}'[supplied query is a regex]:pattern:' \
- '(-m --mask-reason)'{-m,--mask-reason}'[include reason for package mask]' \
- '(-F --format)'{-F,--format}'[a format template (see man page)]:format template' \
- ': :_guard "^--*" pattern' && ret=0
- ;;
- meta|m)
- _arguments \
- '(-d --description)'{-d,--description}'[show an extended package description]' \
- '(-H --herd)'{-H,--herd}'[show the herd(s) for the package]' \
- '(-k --keywords)'{-k,--keywords}'[show keywords for all matching package versions]' \
- '(-l --license)'{-l,--license}'[show licenses for the best maching version]' \
- '(-m --maintainer)'{-m,--maintainer}'[show the maintainer(s) for the package]' \
- '(-S --stablreq)'{-S,--stablreq}'[show STABLEREQ arches (ccs) for all matching package versions]' \
- '(-u --useflags)'{-u,--useflags}'[show per-package USE flag descriptions]' \
- '(-U --upstream)'{-U,--upstream}'[show packages upstream information]' \
- '(-x --xml)'{-x,--xml}'[show the plain metadata.xml file]' \
- ':package:_packages available' && ret=0
- ;;
- size|s)
- _arguments \
- '(-b --bytes)'{-b,--bytes}'[report size in bytes]' \
- '(-f --full-regex)'{-f,--full-regex}'[supplied query is a regex]:pattern:' \
- ':package:_packages installed' && ret=0
- ;;
- uses|u)
- _arguments \
- '(-a --all)'{-a,--all}'[include non-installed packages]' \
- '(-i --ignore-linguas)'{-i,--ignore-linguas}"[don't show linguas USE flags]" \
- ":portage:_packages installed" && ret=0
- ;;
- which|w)
- _arguments \
- '(-m --include-masked)'{-m,--include-masked}'[return highest version ebuild available]' \
- '(-e --ebuild)'{-e,--ebuild}'[print the ebuild]' \
- ':portage:_packages available' && ret=0
- ;;
- *)
- _message 'command not found'
- ;;
- esac
- fi
- ;;
- subcommands)
- tmp=(
- {belongs,b}'[list all packages owning file(s)]'
- {check,k}'[check MD5sums and timestamps of package]'
- {changes,c}'[shows ChangeLog for specified package]'
- {depends,d}'[list all packages depending on specified package]'
- {depgraph,g}'[display a dependency tree for package]'
- {files,f}'[list files owned by package]'
- {hasuse,h}'[list all packages with specified useflag]'
- {list,l}'[list all packages matching pattern]'
- {size,s}'[print size of files contained in package]'
- {uses,u}'[display USE flags for package]'
- {which,w}'[print full path to ebuild for package]'
- {has,a}'[list all packages matching ENVIRONMENT data stored in /var/db/pkg]'
- {keywords,y}'[display keywords for specified PKG]'
- {meta,m}'[display metadata about PKG]'
- )
- _values 'equery command' $tmp && ret=0
- ;;
+ command)
+ if (( CURRENT == 1 )); then
+ state=subcommands
+ else
+ cmd="$words[1]"
+ curcontext="${curcontext%:*:*}:equery-${cmd}:"
+ case "$cmd" in
+ belongs|b)
+ _arguments \
+ '(-e --early-out)'{-e,--early-out}'[stop when first match found]' \
+ '(-f --full-regex)'{-f,--full-regex}'[supplied query is a regex]:pattern:' \
+ '(-n --name-only)'{-n,--name-only}"[don't print the version]" \
+ '*:file:_files' && ret=0
+ ;;
+ changes|c)
+ _arguments \
+ '(-l --latest)'{-l,--latest}'[only display latest ChangeLog entry]' \
+ '(-f --full)'{-f,--full}'[display full ChangeLog entry]' \
+ '--limit[limit the number of entries displayed (with --full)]:number:' \
+ '--from[which version to display from]' \
+ '--to[which version to display to]' \
+ ':portage:_packages available' && ret=0
+ ;;
+ check|k)
+ _arguments \
+ '(-f --full-regex)'{-f,--full-regex}'[supplied query is a regex]:pattern:' \
+ '(-o --only-failures)'{-o,--only-failures}'[only display packages that do not pass]' \
+ ':portage:_packages installed' && ret=0
+ ;;
+ depends|d)
+ _arguments \
+ '(-a --all-packages)'{-a,--all-packages}'[search in all available packages (slow)]:all packages:->packages' \
+ '(-D --indirect)'{-D,--indirect}'[search indirect dependencies (VERY slow)]' \
+ '--depth[limit indirect dependency tree to specified depth]:number:' \
+ '*:package:_packages installed' && ret=0
+ ;;
+ depgraph|g)
+ _arguments \
+ '(-A --no-atom)'{-A,--no-atom}'[do not show dependency atom]' \
+ '(-M --no-mask)'{-M,--no-mask}'[do not show masking status]' \
+ '(-U --no-useflags)'{-U,--no-useflags}'[do not show USE flags]' \
+ '(-l --linear)'{-l,--linear}'[do not use fancy formatting]' \
+ ':package:_packages installed' && ret=0
+ ;;
+ files|f)
+ _arguments \
+ '(-m --md5sum)'{-m,--md5sum}'[include MD5 sum in output]' \
+ '(-s --timestamp)'{-s,--timestamp}'[include timestamp in output]' \
+ '(-t --type)'{-t,--type}'[include file type in output]' \
+ '--tree[display results in a tree (turns off other options)]' \
+ '--filter=[filter output]:filter(s):_values -s , '' dir obj sym dev fifo path conf cmd doc man info' \
+ ':installed pkgname:_packages installed' && ret=0
+ ;;
+ has|a)
+ _arguments \
+ $common_args \
+ '(-F --format)'{-F,--format}'[a format template (see man page)]:format template' \
+ ':KEY:' \
+ ':VALUE:' && ret=0
+ ;;
+ hasuse|h)
+ _arguments \
+ $common_args \
+ '(-F --format)'{-F,--format}'[specify a custom output format]:format template' \
+ ':useflag:_gentoo_packages useflag' && ret=0
+ ;;
+ list|l)
+ _arguments \
+ $common_args \
+ '(-d --duplicates)'{-d,--duplicates}'[list only installed duplicate packages]' \
+ '(-b --binpkgs-missing)'{-b,--binpkgs-missing}'[list only installed packages without a corresponding binary package]' \
+ '(-f --full-regex)'{-f,--full-regex}'[supplied query is a regex]:pattern:' \
+ '(-m --mask-reason)'{-m,--mask-reason}'[include reason for package mask]' \
+ '(-F --format)'{-F,--format}'[a format template (see man page)]:format template' \
+ ': :_guard "^--*" pattern' && ret=0
+ ;;
+ meta|m)
+ _arguments \
+ '(-d --description)'{-d,--description}'[show an extended package description]' \
+ '(-H --herd)'{-H,--herd}'[show the herd(s) for the package]' \
+ '(-k --keywords)'{-k,--keywords}'[show keywords for all matching package versions]' \
+ '(-l --license)'{-l,--license}'[show licenses for the best maching version]' \
+ '(-m --maintainer)'{-m,--maintainer}'[show the maintainer(s) for the package]' \
+ '(-S --stablreq)'{-S,--stablreq}'[show STABLEREQ arches (ccs) for all matching package versions]' \
+ '(-u --useflags)'{-u,--useflags}'[show per-package USE flag descriptions]' \
+ '(-U --upstream)'{-U,--upstream}'[show packages upstream information]' \
+ '(-x --xml)'{-x,--xml}'[show the plain metadata.xml file]' \
+ ':package:_packages available' && ret=0
+ ;;
+ size|s)
+ _arguments \
+ '(-b --bytes)'{-b,--bytes}'[report size in bytes]' \
+ '(-f --full-regex)'{-f,--full-regex}'[supplied query is a regex]:pattern:' \
+ ':package:_packages installed' && ret=0
+ ;;
+ uses|u)
+ _arguments \
+ '(-a --all)'{-a,--all}'[include non-installed packages]' \
+ '(-i --ignore-linguas)'{-i,--ignore-linguas}"[don't show linguas USE flags]" \
+ ":portage:_packages installed" && ret=0
+ ;;
+ which|w)
+ _arguments \
+ '(-m --include-masked)'{-m,--include-masked}'[return highest version ebuild available]' \
+ '(-e --ebuild)'{-e,--ebuild}'[print the ebuild]' \
+ ':portage:_packages available' && ret=0
+ ;;
+ *)
+ _message 'command not found'
+ ;;
+ esac
+ fi
+ ;;
+ subcommands)
+ tmp=(
+ {belongs,b}'[list all packages owning file(s)]'
+ {check,k}'[check MD5sums and timestamps of package]'
+ {changes,c}'[shows ChangeLog for specified package]'
+ {depends,d}'[list all packages depending on specified package]'
+ {depgraph,g}'[display a dependency tree for package]'
+ {files,f}'[list files owned by package]'
+ {hasuse,h}'[list all packages with specified useflag]'
+ {list,l}'[list all packages matching pattern]'
+ {size,s}'[print size of files contained in package]'
+ {uses,u}'[display USE flags for package]'
+ {which,w}'[print full path to ebuild for package]'
+ {has,a}'[list all packages matching ENVIRONMENT data stored in /var/db/pkg]'
+ {keywords,y}'[display keywords for specified PKG]'
+ {meta,m}'[display metadata about PKG]'
+ )
+ _values 'equery command' $tmp && ret=0
+ ;;
esac
done
}
-
_eclean_wrapper () {
- local global_opts pkg_opts dist_opts
+ local global_opts pkg_opts dist_opts
- global_opts=(
- '(-C --nocolor)'{-C,--nocolor}'[turns off colors]'
- '(-d,--destructive)'{-d,--destructive}'[only keep the minimum for a reinstallation]'
- '(-e,--exclude-file)'{-e,--exclude-file}'[path to the exclusion file]:filename:_files'
- '(-i,--interactive)'{-i,--interactive}'[ask confirmation before deletions]'
- '(-n,--package-names)'{-n,--package-names}'[protect all versions (when --destructive)]'
- '(-p,--pretend)'{-p,--pretend}'[only display what would be cleaned]'
- '(-q,--quiet)'{-q,--quiet}'[minimal output]'
- '(-t,--time-limit)'{-t,--time-limit}'[don’t delete files modified since <time>]:time:_eclean_time'
- '(: -)'{-h,--help}'[show help]'
- '(: -)'{-V,--version}'[show version]'
- )
- dist_opts=(
- '(-s,--size-limit)'{-s,--size-limit}'[do not delete disfiles bigger than <size>]:size:_eclean_size'
- '(-f,--fetch-restricted)'{-f,--fetch-restricted}'[protect fetch-restricted files]'
- )
- # XXX: If you add options here make sure that it'll work.
- # since there isn't any option *right* now, $pkg_opts
- # is never used.
- pkg_opts=()
+ global_opts=(
+ '(-C --nocolor)'{-C,--nocolor}'[turns off colors]'
+ '(-d,--destructive)'{-d,--destructive}'[only keep the minimum for a reinstallation]'
+ '(-e,--exclude-file)'{-e,--exclude-file}'[path to the exclusion file]:filename:_files'
+ '(-i,--interactive)'{-i,--interactive}'[ask confirmation before deletions]'
+ '(-n,--package-names)'{-n,--package-names}'[protect all versions (when --destructive)]'
+ '(-p,--pretend)'{-p,--pretend}'[only display what would be cleaned]'
+ '(-q,--quiet)'{-q,--quiet}'[minimal output]'
+ '(-t,--time-limit)'{-t,--time-limit}'[don’t delete files modified since <time>]:time:_eclean_time'
+ '(: -)'{-h,--help}'[show help]'
+ '(: -)'{-V,--version}'[show version]'
+ )
+ dist_opts=(
+ '(-s,--size-limit)'{-s,--size-limit}'[do not delete disfiles bigger than <size>]:size:_eclean_size'
+ '(-f,--fetch-restricted)'{-f,--fetch-restricted}'[protect fetch-restricted files]'
+ )
+ # XXX: If you add options here make sure that it'll work.
+ # since there isn't any option *right* now, $pkg_opts
+ # is never used.
+ pkg_opts=()
- # check which kind of eclean command we run.
- case "$words[1]" in
- eclean-pkg)
- _arguments -s $global_opts $pkg_opts &&
- return 0
- ;;
- eclean-dist)
- _arguments -s $global_opts $dist_opts &&
- return 0
- ;;
- eclean)
- # eclean. complete only specifics options if an action has been given,
- # global_opts and packages|distfiles otherwhise.
- if (( $words[(I)(packages)] )); then
- # Currently no options so return 0
- #_values "packages options" $pkg_opts &&
- return 0
- elif (( $words[(I)(distfiles)] )); then
- _values "distfiles options" $dist_opts &&
- return 0
- else
- _arguments -s $global_opts
- # complete packages|distfiles only if CURRENT-1 don't need an arg
- if [[ ! $words[CURRENT-1] =~ -(e|-exclude-file|t|-time-limit|s|-size-limit|h|-help|v|-version) ]]; then
- _values 'eclean command' \
- 'packages[clean outdated binary packages]' \
- 'distfiles[clean outdated packages sources files]' &&
- return 0
- fi
- fi
- ;;
- esac
+ # check which kind of eclean command we run.
+ case "$words[1]" in
+ eclean-pkg)
+ _arguments -s $global_opts $pkg_opts && return 0
+ ;;
+ eclean-dist)
+ _arguments -s $global_opts $dist_opts && return 0
+ ;;
+ eclean)
+ # eclean. complete only specifics options if an action has been given,
+ # global_opts and packages|distfiles otherwhise.
+ if (( $words[(I)(packages)] )); then
+ # Currently no options so return 0
+ #_values "packages options" $pkg_opts &&
+ return 0
+ elif (( $words[(I)(distfiles)] )); then
+ _values "distfiles options" $dist_opts &&
+ return 0
+ else
+ _arguments -s $global_opts
+ # complete packages|distfiles only if CURRENT-1 don't need an arg
+ if [[ ! $words[CURRENT-1] =~ -(e|-exclude-file|t|-time-limit|s|-size-limit|h|-help|v|-version) ]]; then
+ _values 'eclean command' \
+ 'packages[clean outdated binary packages]' \
+ 'distfiles[clean outdated packages sources files]' &&
+ return 0
+ fi
+ fi
+ ;;
+ esac
}
+
_eclean_time () {
- # adapted from _chmod
- compset -P '*'
- suf=( -S '' )
- _alternative -O suf \
- 'number:number:(0 1 2 3 4 5 6 7 8 9)' \
- 'time_unit:time_unit:((y\:year m\:month w\:week d\:day h\:hour))' &&
- return 0
+ # adapted from _chmod
+ compset -P '*'
+ suf=( -S '' )
+ _alternative -O suf \
+ 'number:number:(0 1 2 3 4 5 6 7 8 9)' \
+ 'time_unit:time_unit:((y\:year m\:month w\:week d\:day h\:hour))' &&
+ return 0
}
+
_eclean_size () {
- # adapted from _chmod
- compset -P '*'
- suf=( -S '' )
- _alternative -O suf \
- 'number:number:(0 1 2 3 4 5 6 7 8 9)' \
- 'time_unit:time_unit:((G\:gigabytes M\:megabytes K\:kilobytes B\:bytes))' &&
- return 0
+ # adapted from _chmod
+ compset -P '*'
+ suf=( -S '' )
+ _alternative -O suf \
+ 'number:number:(0 1 2 3 4 5 6 7 8 9)' \
+ 'time_unit:time_unit:((G\:gigabytes M\:megabytes K\:kilobytes B\:bytes))' &&
+ return 0
}
-
_epkginfo () {
- if (( CURRENT == 2 )); then
- _arguments -s '*:package:_gentoo_packages available'
- fi
+ if (( CURRENT == 2 )); then
+ _arguments -s '*:package:_gentoo_packages available'
+ fi
}
-
_genpkgindex () {
- _arguments -s \
- '(: -)'{-h,--help}'[Display help and exit]' \
- '(-h --help -q --quiet -v --verbose)'{-q,--quiet}'[Be quiet]' \
- '(-h --help -q --quiet -v --verbose)'{-v,--verbose}'[Be verbose]' \
- '(-h --help -c --compress)'{-c,--compress}'[Compresses the generated metadata with bzip2]' \
- '(-h --help -P --pkgdir)'{-P,--pkgdir}'[Set the base location of the binary packages (default $PKGDIR)]:file:_files'
+ _arguments -s \
+ '(: -)'{-h,--help}'[Display help and exit]' \
+ '(-h --help -q --quiet -v --verbose)'{-q,--quiet}'[Be quiet]' \
+ '(-h --help -q --quiet -v --verbose)'{-v,--verbose}'[Be verbose]' \
+ '(-h --help -c --compress)'{-c,--compress}'[Compresses the generated metadata with bzip2]' \
+ '(-h --help -P --pkgdir)'{-P,--pkgdir}'[Set the base location of the binary packages (default $PKGDIR)]:file:_files'
}
-
_glsa-check () {
- local actions
+ local actions
- actions=(-l --list -d --dump --print -t --test -p --pretend -f --fix -i --inject -h --help -V --version -m --mail)
+ actions=(-l --list -d --dump --print -t --test -p --pretend -f --fix -i --inject -h --help -V --version -m --mail)
- _arguments -s \
- "($actions)"{-l,--list}'[list all unapplied GLSA]:glsa_id:_glsa_id' \
- "($actions)"{-d,--dump,--print}'[show all information about the given GLSA]:glsa_id:_glsa_id' \
- "($actions)"{-t,--test}'[test if this system is affected by the given GLSA]:glsa_id:_glsa_id' \
- "($actions)"{-p,--pretend}'[show the necessary commands to apply this GLSA]:glsa_id:_glsa_id' \
- "($actions)"{-f,--fix}'[try to auto-apply this GLSA (experimental)]:glsa_id:_glsa_id' \
- "($actions)"{-i,--inject}'[inject the given GLSA into the checkfile]:glsa_id:_glsa_id' \
- '(-n --nocolor)'{-n,--nocolor}'[disable colors (option)]' \
- '(: -)'{-h,--help}'[Show help message]' \
- '(: -)'{-V,--version}'[some information about this tool]' \
- '(-v --verbose)'{-v,--verbose}'[print more messages (option)]' \
- '(-c --cve)'{-c,--cve}'[show CAN ids in listing mode (option)]' \
- "($actions)"{-m,--mail}'[send a mail with the given GLSAs to the administrator]:glsa_id:_glsa_id'
+ _arguments -s \
+ "($actions)"{-l,--list}'[list all unapplied GLSA]:glsa_id:_glsa_id' \
+ "($actions)"{-d,--dump,--print}'[show all information about the given GLSA]:glsa_id:_glsa_id' \
+ "($actions)"{-t,--test}'[test if this system is affected by the given GLSA]:glsa_id:_glsa_id' \
+ "($actions)"{-p,--pretend}'[show the necessary commands to apply this GLSA]:glsa_id:_glsa_id' \
+ "($actions)"{-f,--fix}'[try to auto-apply this GLSA (experimental)]:glsa_id:_glsa_id' \
+ "($actions)"{-i,--inject}'[inject the given GLSA into the checkfile]:glsa_id:_glsa_id' \
+ '(-n --nocolor)'{-n,--nocolor}'[disable colors (option)]' \
+ '(: -)'{-h,--help}'[Show help message]' \
+ '(: -)'{-V,--version}'[some information about this tool]' \
+ '(-v --verbose)'{-v,--verbose}'[print more messages (option)]' \
+ '(-c --cve)'{-c,--cve}'[show CAN ids in listing mode (option)]' \
+ "($actions)"{-m,--mail}'[send a mail with the given GLSAs to the administrator]:glsa_id:_glsa_id'
}
+
# glsa-list can contain an arbitrary number of GLSA ids,
# filenames containing GLSAs or the special identifiers
# 'all', 'new' and 'affected'
_glsa_id () {
-# XXX: we'll avoid displaying GLSA ids, because the ratio use/noise
-# will be low. May be we should display only the X previous GLSA,
-# or GLSA ids of the X last month.
-#
-# start to look at /usr/lib/gentoolkit/pym/glsa.py if GLSA_DIR is still
-# PORTDIR + "metadata/glsa/"
-# and then get the list (it's only xml files in GLSA_DIR, easy!)
+ # XXX: we'll avoid displaying GLSA ids, because the ratio use/noise
+ # will be low. May be we should display only the X previous GLSA,
+ # or GLSA ids of the X last month.
+ #
+ # start to look at /usr/lib/gentoolkit/pym/glsa.py if GLSA_DIR is still
+ # PORTDIR + "metadata/glsa/"
+ # and then get the list (it's only xml files in GLSA_DIR, easy!)
- compadd 'all' 'new' 'affected'
- _files
+ compadd 'all' 'new' 'affected'
+ _files
}
-
_revdep-rebuild () {
- if (( $words[(I)(--)] )); then
- # here it's no more revdep-rebuild options, but emerge options that are called
- # FIXME: not working yet. need to load the _portage file
- _arguments -s '*:portage:_portage --emerge $@' && return 0
- fi
+ if (( $words[(I)(--)] )); then
+ # here it's no more revdep-rebuild options, but emerge options that are called
+ # FIXME: not working yet. need to load the _portage file
+ _arguments -s '*:portage:_portage --emerge $@' && return 0
+ fi
- _arguments -s \
- '(-C --nocolor)'{-C,--nocolor}'[Turn off colored output]' \
- '(-d --debug)'{-d,--debug}'[Print way too much information (uses bash set -xv)]' \
- '(-e --exact)'{-e,--exact}'[Emerge based on exact package version]' \
- '(: -)'{-h,--help}'[Print help]' \
- '(-i --ignore)'{-i,--ignore}'[Ignore temporary files from previous runs]' \
- '(-k --keep-temp)'{-k,--keep-temp}'[Do not delete temporary files on exit]' \
- '(-L --library)'{-L,--library}'[<NAME> Emerge existing packages that use the library with NAME]:file:_files' \
- '(-l --no-ld-path)'{-l,--no-ld-path}'[Do not set LD_LIBRARY_PATH]' \
- '(-o --no-order)'{-o,--no-order}'[Do not check the build order (Saves time, but may cause breakage)]' \
- '(-p --pretend)'{-p,--pretend}'[Do a trial run without actually emerging anything (also passed to emerge command)]' \
- '(-P --no-progress)'{-P,--no-progress}'[Turn off the progress meter]' \
- '(-q --quiet)'{-q,--quiet}'[Be less verbose (also passed to emerge command)]' \
- '(-v --verbose)'{-v,--verbose}'[Be more verbose (also passed to emerge command)]' \
- '(-u --no-util)'{-u,--no-util}'[<UTIL> Do not use features provided by UTIL]:file:_files'
- # XXX: does someone really use -u|--no-util option?
- # we can check packages installed (like portage-utils etc) to see
- # which "UTIL" is avaiable.
+ _arguments -s \
+ '(-C --nocolor)'{-C,--nocolor}'[Turn off colored output]' \
+ '(-d --debug)'{-d,--debug}'[Print way too much information (uses bash set -xv)]' \
+ '(-e --exact)'{-e,--exact}'[Emerge based on exact package version]' \
+ '(: -)'{-h,--help}'[Print help]' \
+ '(-i --ignore)'{-i,--ignore}'[Ignore temporary files from previous runs]' \
+ '(-k --keep-temp)'{-k,--keep-temp}'[Do not delete temporary files on exit]' \
+ '(-L --library)'{-L,--library}'[<NAME> Emerge existing packages that use the library with NAME]:file:_files' \
+ '(-l --no-ld-path)'{-l,--no-ld-path}'[Do not set LD_LIBRARY_PATH]' \
+ '(-o --no-order)'{-o,--no-order}'[Do not check the build order (Saves time, but may cause breakage)]' \
+ '(-p --pretend)'{-p,--pretend}'[Do a trial run without actually emerging anything (also passed to emerge command)]' \
+ '(-P --no-progress)'{-P,--no-progress}'[Turn off the progress meter]' \
+ '(-q --quiet)'{-q,--quiet}'[Be less verbose (also passed to emerge command)]' \
+ '(-v --verbose)'{-v,--verbose}'[Be more verbose (also passed to emerge command)]' \
+ '(-u --no-util)'{-u,--no-util}'[<UTIL> Do not use features provided by UTIL]:file:_files'
+ # XXX: does someone really use -u|--no-util option?
+ # we can check packages installed (like portage-utils etc) to see
+ # which "UTIL" is avaiable.
}
-
case "$service" in
- euse)
- _euse "$@" && return 0
+ euse)
+ _euse "$@" && return 0
;;
- equery)
- _equery "$@" && return 0
+ equery)
+ _equery "$@" && return 0
;;
- eclean*)
- _eclean_wrapper "$@" && return 0
+ eclean*)
+ _eclean_wrapper "$@" && return 0
;;
- epkginfo)
- _epkginfo "$@" && return 0
+ epkginfo)
+ _epkginfo "$@" && return 0
;;
- genpkgindex)
- _genpkgindex "$@" && return 0
+ genpkgindex)
+ _genpkgindex "$@" && return 0
;;
- glsa-check)
- _glsa-check "$@" && return 0
+ glsa-check)
+ _glsa-check "$@" && return 0
;;
- revdep-rebuild)
- _revdep-rebuild "$@" && return 0
+ revdep-rebuild)
+ _revdep-rebuild "$@" && return 0
;;
esac
+
+# vim: set et sw=2 sts=2 ts=2 ft=zsh:
diff --git a/src/_layman b/src/_layman
index 01c1333..bf22ded 100644
--- a/src/_layman
+++ b/src/_layman
@@ -1,51 +1,59 @@
#compdef layman
# layman-1.1.1
-#
+
local arguments actions_args actions global_opts add_actions
+
_layman_remote_overlays() {
- local layman_list_overlays
- layman_list_overlays=(${(S)${${(f)"$(layman -k -N -L 2>/dev/null)"}//\[*}#\* })
- compadd "$@" ${(kv)=layman_list_overlays} "ALL"
+ local layman_list_overlays
+ layman_list_overlays=(${(S)${${(f)"$(layman -k -N -L 2>/dev/null)"}//\[*}#\* })
+ compadd "$@" ${(kv)=layman_list_overlays} "ALL"
}
+
_layman_local_overlays() {
- local layman_list_overlays
- layman_list_overlays=(${(S)${${(f)"$(layman -N -l)"}//\[*}#\* })
- compadd "$@" ${(kv)=layman_list_overlays} "ALL"
+ local layman_list_overlays
+ layman_list_overlays=(${(S)${${(f)"$(layman -N -l)"}//\[*}#\* })
+ compadd "$@" ${(kv)=layman_list_overlays} "ALL"
}
+
actions=(
- --delete -d
- --sync -s
- --info -i
- --sync-all -S
- --list -L
- --list-local -l
- --fetch -f
+ --delete -d
+ --sync -s
+ --info -i
+ --sync-all -S
+ --list -L
+ --list-local -l
+ --fetch -f
)
global_opts=(
- '(--config -c)'{-c,--config}'[Select an alternative configuration file]:configuration file:_files'
- '(--overlays -o)'{-o,--overlays}'[Specifies the location of additional overlay lists]:overlay url:_urls'
- '(--nofetch -n)'{-n,--nofetch}'[Prevents from automatically fetching the remote lists of overlays]'
- '(--nocheck -k)'{-k,--nocheck}'[Prevents from checking the remote lists of overlays for complete overlay definitions]'
- '(--quiet -q)'{-q,--quiet}'[Makes layman completely quiet]'
- '(--verbose -v)'{-v,--verbose}'[Verbose output]'
- '(--quietness -Q)'{-Q,--quietness}'[Makes layman less verbose]:level:({0..4})'
- '(--nocolor -N)'{-N,--nocolor}'[Remove color codes from the output]'
+ '(--config -c)'{-c,--config}'[Select an alternative configuration file]:configuration file:_files'
+ '(--overlays -o)'{-o,--overlays}'[Specifies the location of additional overlay lists]:overlay url:_urls'
+ '(--nofetch -n)'{-n,--nofetch}'[Prevents from automatically fetching the remote lists of overlays]'
+ '(--nocheck -k)'{-k,--nocheck}'[Prevents from checking the remote lists of overlays for complete overlay definitions]'
+ '(--quiet -q)'{-q,--quiet}'[Makes layman completely quiet]'
+ '(--verbose -v)'{-v,--verbose}'[Verbose output]'
+ '(--quietness -Q)'{-Q,--quietness}'[Makes layman less verbose]:level:({0..4})'
+ '(--nocolor -N)'{-N,--nocolor}'[Remove color codes from the output]'
)
+
add_actions=(
- -p --priority
- --add -a
+ -p --priority
+ --add -a
)
+
actions_args=(
- "($actions --add -a)"{--add,-a}'[Add the given overlay to your installed overlays]:overlay:_layman_remote_overlays'
- "($actions --priority -p)"{--priority,-p}'[It will modify the priority of the added overlay]:priority:({0..100})'
- "($actions $add_actions)"{--delete,-d}'[Delete the given overlay from your installed overlays]:overlay:_layman_local_overlays'
- "($actions $add_actions)"{--sync,-s}'[Update the specified overlay]:overlat:_layman_local_overlays'
- "($actions $add_actions)"{--info,-i}'[Display all available information about the specified overlay]:overlay:_layman_remote_overlays'
- "($actions $add_actions)"{--sync-all,-S}'[Update all overlays]'
- "($actions $add_actions)"{--list,-L}'[List the contents of the remote list]'
- "($actions $add_actions)"{--list-local,-l}'[List the locally installed overlays]'
- "($actions $add_actions)"{--fetch,-f}'[Fetches the remote list of overlays]'
+ "($actions --add -a)"{--add,-a}'[Add the given overlay to your installed overlays]:overlay:_layman_remote_overlays'
+ "($actions --priority -p)"{--priority,-p}'[It will modify the priority of the added overlay]:priority:({0..100})'
+ "($actions $add_actions)"{--delete,-d}'[Delete the given overlay from your installed overlays]:overlay:_layman_local_overlays'
+ "($actions $add_actions)"{--sync,-s}'[Update the specified overlay]:overlat:_layman_local_overlays'
+ "($actions $add_actions)"{--info,-i}'[Display all available information about the specified overlay]:overlay:_layman_remote_overlays'
+ "($actions $add_actions)"{--sync-all,-S}'[Update all overlays]'
+ "($actions $add_actions)"{--list,-L}'[List the contents of the remote list]'
+ "($actions $add_actions)"{--list-local,-l}'[List the locally installed overlays]'
+ "($actions $add_actions)"{--fetch,-f}'[Fetches the remote list of overlays]'
)
+
_arguments $global_opts[@] $actions_args[@]
+
+# vim: set et sw=2 sts=2 ts=2 ft=zsh:
diff --git a/src/_openrc b/src/_openrc
index 84ecbc8..3a250f4 100644
--- a/src/_openrc
+++ b/src/_openrc
@@ -6,80 +6,82 @@ local gentoo_runlevels
gentoo_runlevels=(/etc/runlevels/*(:t))
case "$service" in
- rc-service)
- if (( CURRENT == 2 )); then
- _arguments -s \
- '(-e --exists)'{-e,--exists}"[tests if the service exists or not]" \
- '(-l --list)'{-l,--list}'[list all available services]' \
- '(-r --resolve)'{-r,--resolve}'[resolve the service name to an init script]' \
- '(-C --nocolor)'{-C,--nocolor}'[Disable color output]' \
- '(-v --verbose)'{-v,--verbose}'[Run verbosely]' \
- '(-q --quiet)'{-q,--quiet}'[Run quietly]'
- _values "service" /etc/init.d/*~*.sh(:t)
- else
- case $words[2] in
- -e|--exists|-r|--resolve)
- (( CURRENT > 3 )) && return 0
- _values "service" /etc/init.d/*~*.sh(:t)
- ;;
- -*)
- return 0
- ;;
- *)
- _values "action" stop start restart describe zap
- ;;
- esac
- fi
- ;;
- rc-update)
- local used_init
- used_init=(${=${(M)${(f)"$(/sbin/rc-update show 2>/dev/null)"}:#*|*[a-z]*}% |*})
+ rc-service)
+ if (( CURRENT == 2 )); then
+ _arguments -s \
+ '(-e --exists)'{-e,--exists}"[tests if the service exists or not]" \
+ '(-l --list)'{-l,--list}'[list all available services]' \
+ '(-r --resolve)'{-r,--resolve}'[resolve the service name to an init script]' \
+ '(-C --nocolor)'{-C,--nocolor}'[Disable color output]' \
+ '(-v --verbose)'{-v,--verbose}'[Run verbosely]' \
+ '(-q --quiet)'{-q,--quiet}'[Run quietly]'
+ _values "service" /etc/init.d/*~*.sh(:t)
+ else
+ case $words[2] in
+ -e|--exists|-r|--resolve)
+ (( CURRENT > 3 )) && return 0
+ _values "service" /etc/init.d/*~*.sh(:t)
+ ;;
+ -*)
+ return 0
+ ;;
+ *)
+ _values "action" stop start restart describe zap
+ ;;
+ esac
+ fi
+ ;;
+ rc-update)
+ local used_init
+ used_init=(${=${(M)${(f)"$(/sbin/rc-update show 2>/dev/null)"}:#*|*[a-z]*}% |*})
- if (( CURRENT == 2 )); then
- _values "rc-update actions" \
- 'add[Add script to a runlevel]' \
- 'del[Delete script from a runlevel]' \
- 'show[Show scripts lanched at a runlevel]' \
- '-a[Add script to a runlevel]' \
- '-d[Delete script from a runlevel]' \
- '-s[Show scripts lanched at a runlevel]'
- elif (( CURRENT == 3 )); then
- case "$words[2]" in
- add|-a)
- _values "service" /etc/init.d/*~*.sh(:t)
- ;;
- del|-d)
- _values "service" $used_init
- ;;
- show|-s)
- _values "runlevels" $gentoo_runlevels \
- '-v[Show all init scripts]' \
- '--verbose[Show all init scripts]'
- ;;
- esac
- elif (( CURRENT == 4 )); then
- _values "runlevels" $gentoo_runlevels
- fi
- ;;
- rc-status)
- _arguments -s \
- {'(--all)-a','(-a)--all'}'[Show services at all runlevels]' \
- {'(--crashed)-c','(-c)--crashed'}'[Show crashed services]' \
- {'(--list)-l','(-l)--list'}'[Show list of runlevels]' \
- {'(--runlevel)-r','(-r)--runlevel'}'[Show the name of the current runlevel]' \
- {'(--servicelist)-s','(-s)--servicelist'}'[Show all services]' \
- {'(--unused)-u','(-u)--unused'}'[Show services not assigned to any run level]' \
- {'(--help)-h','(-h)--help'}'[Print this help output]' \
- {'(--nocolor)-C','(-C)--nocolor'}'[Disable color output]' \
- {'(--version)-V','(-V)--version'}'[Display software version]' \
- {'(--verbose)-v','(-v)--verbose'}'[Run verbosely]' \
- {'(--quiet)-q','(-q)--quiet'}'[Run quietly (Does not affect errors)]'
+ if (( CURRENT == 2 )); then
+ _values "rc-update actions" \
+ 'add[Add script to a runlevel]' \
+ 'del[Delete script from a runlevel]' \
+ 'show[Show scripts lanched at a runlevel]' \
+ '-a[Add script to a runlevel]' \
+ '-d[Delete script from a runlevel]' \
+ '-s[Show scripts lanched at a runlevel]'
+ elif (( CURRENT == 3 )); then
+ case "$words[2]" in
+ add|-a)
+ _values "service" /etc/init.d/*~*.sh(:t)
+ ;;
+ del|-d)
+ _values "service" $used_init
+ ;;
+ show|-s)
+ _values "runlevels" $gentoo_runlevels \
+ '-v[Show all init scripts]' \
+ '--verbose[Show all init scripts]'
+ ;;
+ esac
+ elif (( CURRENT == 4 )); then
+ _values "runlevels" $gentoo_runlevels
+ fi
+ ;;
+ rc-status)
+ _arguments -s \
+ {'(--all)-a','(-a)--all'}'[Show services at all runlevels]' \
+ {'(--crashed)-c','(-c)--crashed'}'[Show crashed services]' \
+ {'(--list)-l','(-l)--list'}'[Show list of runlevels]' \
+ {'(--runlevel)-r','(-r)--runlevel'}'[Show the name of the current runlevel]' \
+ {'(--servicelist)-s','(-s)--servicelist'}'[Show all services]' \
+ {'(--unused)-u','(-u)--unused'}'[Show services not assigned to any run level]' \
+ {'(--help)-h','(-h)--help'}'[Print this help output]' \
+ {'(--nocolor)-C','(-C)--nocolor'}'[Disable color output]' \
+ {'(--version)-V','(-V)--version'}'[Display software version]' \
+ {'(--verbose)-v','(-v)--verbose'}'[Run verbosely]' \
+ {'(--quiet)-q','(-q)--quiet'}'[Run quietly (Does not affect errors)]'
- _values 'runlevels' $gentoo_runlevels
- ;;
- rc)
- if (( CURRENT == 2 )); then
- _values "runlevels" $gentoo_runlevels
- fi
- ;;
+ _values 'runlevels' $gentoo_runlevels
+ ;;
+ rc)
+ if (( CURRENT == 2 )); then
+ _values "runlevels" $gentoo_runlevels
+ fi
+ ;;
esac
+
+# vim: set et sw=2 sts=2 ts=2 ft=zsh:
diff --git a/src/_portage b/src/_portage
index aef3487..e9639d8 100644
--- a/src/_portage
+++ b/src/_portage
@@ -12,49 +12,46 @@
# Still TODO:
# xpak
-
# Stuff for ebuild
_ebuild () {
- if (( CURRENT == 2 ));then
- _files -g \*.ebuild
- elif (( CURRENT > 2 ));then
- _values "ebuild command" \
- 'clean[Cleans the temporary build directory]' \
- 'help[Show help]' \
- 'setup[Run all package specific setup actions and exotic system checks.]' \
- 'fetch[Fetch all necessary files]' \
- 'digest[Creates a digest file for the package]' \
- 'unpack[Extracts the sources to a subdirectory in the build directory]' \
- 'compile[Compiles the extracted sources by running the src_compile()]' \
- 'preinst[Run specific actions that need to be done before installation]' \
- 'install[Installs the package to the temporary install directory]' \
- 'postinst[Run specific actions that need to be done after installation]' \
- 'qmerge[Installs the package de the filesystem]' \
- 'merge[perform the following actions: fetch, unpack, compile, install and qmerge.]' \
- 'unmerge[Remove the installed files of the packages]' \
- 'prerm[Run specific actions that need to be executed before unmerge]' \
- 'postrm[Run specific actions that need to be executed after unmerge]' \
- 'config[Run specific actions needed to be executed after the emerge process has completed.]' \
- 'package[This command is a lot like the merge command, but create a .tbz2 package]' \
- 'manifest[Updates the manifest file for the package.]' \
- 'rpm[Builds a RedHat RPM package]'
- fi
+ if (( CURRENT == 2 )); then
+ _files -g \*.ebuild
+ elif (( CURRENT > 2 )); then
+ _values "ebuild command" \
+ 'clean[Cleans the temporary build directory]' \
+ 'help[Show help]' \
+ 'setup[Run all package specific setup actions and exotic system checks.]' \
+ 'fetch[Fetch all necessary files]' \
+ 'digest[Creates a digest file for the package]' \
+ 'unpack[Extracts the sources to a subdirectory in the build directory]' \
+ 'compile[Compiles the extracted sources by running the src_compile()]' \
+ 'preinst[Run specific actions that need to be done before installation]' \
+ 'install[Installs the package to the temporary install directory]' \
+ 'postinst[Run specific actions that need to be done after installation]' \
+ 'qmerge[Installs the package de the filesystem]' \
+ 'merge[perform the following actions: fetch, unpack, compile, install and qmerge.]' \
+ 'unmerge[Remove the installed files of the packages]' \
+ 'prerm[Run specific actions that need to be executed before unmerge]' \
+ 'postrm[Run specific actions that need to be executed after unmerge]' \
+ 'config[Run specific actions needed to be executed after the emerge process has completed.]' \
+ 'package[This command is a lot like the merge command, but create a .tbz2 package]' \
+ 'manifest[Updates the manifest file for the package.]' \
+ 'rpm[Builds a RedHat RPM package]'
+ fi
}
-
# Stuff for quickpkg
_quickpkg () {
- if compset -P '(\\|)(>=|<=|<|>|=)'; then
- _arguments -s \
- '*:installed package:_gentoo_packages installed_versions'
- elif compset -P '(\\|)[/]'; then
- _path_files -W / -/
- else
- _arguments \
- '*:installed package:_gentoo_packages installed'
- fi
+ if compset -P '(\\|)(>=|<=|<|>|=)'; then
+ _arguments -s \
+ '*:installed package:_gentoo_packages installed_versions'
+ elif compset -P '(\\|)[/]'; then
+ _path_files -W / -/
+ else
+ _arguments '*:installed package:_gentoo_packages installed'
+ fi
}
# Stuff for emerge
@@ -63,18 +60,18 @@ _emerge () {
local nopkg_opts all noask_opts bopts install_args common_args profiles
noask_opts=(-p -a --pretend --ask --regen --info --search -s --searchdesc \
- -S --version -V --help -h --metadata --check-news)
+ -S --version -V --help -h --metadata --check-news)
nopkg_opts=(--resume --skipfirst -c --clean -h --help --depclean --info \
- --metadata -P --prune --regen -s --search -S --searchdesc --sync -C \
- --unmerge -V --version -i --inject --list-sets --deselect --check-news)
+ --metadata -P --prune --regen -s --search -S --searchdesc --sync -C \
+ --unmerge -V --version -i --inject --list-sets --deselect --check-news)
bopts=($nopkg_opts -b --buildpkg -B --buildpkgonly -G --getbinpkgonly -g \
- --getbinpkg -k --usepkg -K --usepkgonly --fetch-all-uri -f -F --fetchonly)
+ --getbinpkg -k --usepkg -K --usepkgonly --fetch-all-uri -f -F --fetchonly)
all=($bopts -l --changelog --columns --deep -D --emptytree -e --newuse \
- --noconfmem --nodeps -O --noreplace -n --oneshot -1 -o --onlydeps --tree -t \
- -u --update -U --upgradeonly --config)
+ --noconfmem --nodeps -O --noreplace -n --oneshot -1 -o --onlydeps --tree -t \
+ -u --update -U --upgradeonly --config)
common_args=(
"($noask_opts --sync)"{-p,--pretend}"[Simply display what would be done]"
@@ -86,64 +83,64 @@ _emerge () {
'(: -)'{-h,--help}'[Displays help]'
"(: -)--config[Run package specific actions needed to be executed after the emerge process has completed]:installed atom:_gentoo_packages installed"
"(: -)--list-sets[Displays a list of available package sets]"
- "--color=[Color output]:yes/no:((y\:'yes' n\:'no'))"
- "--accept-properties=[Temporarily override the ACCEPT_PROPERTIES variable]"
- "--accept-restrict=[Temporarily override the ACCEPT_RESTRICT variable]"
- "($noask_opts)"{-A,--alert}"[Add a terminal bell to all interactive prompts]"
- "--ignore-default-opts[Ignore EMERGE_DEFAULT_OPTS]"
- "--moo[Have you mooed today?]"
- "(--jobs)--jobs[Number of packages to build simultaneously]:jobs:({1.."${#${$(</proc/cpuinfo)/^processor}}"})"
+ "--color=[Color output]:yes/no:((y\:'yes' n\:'no'))"
+ "--accept-properties=[Temporarily override the ACCEPT_PROPERTIES variable]"
+ "--accept-restrict=[Temporarily override the ACCEPT_RESTRICT variable]"
+ "($noask_opts)"{-A,--alert}"[Add a terminal bell to all interactive prompts]"
+ "--ignore-default-opts[Ignore EMERGE_DEFAULT_OPTS]"
+ "--moo[Have you mooed today?]"
+ "(--jobs)--jobs[Number of packages to build simultaneously]:jobs:({1.."${#${$(</proc/cpuinfo)/^processor}}"})"
)
install_args=(
- "--deselect[Remove atom from world file]"
- "--alphabetical[Sort use/other flags output alphabetically despite of status]"
- "--ask-enter-invalid[When with --ask, interpret a single 'Enter' key press as invalid input]"
- "--autounmask[Automatically unmask packages and generate package.use]"
- "--autounmask-unrestricted-atoms[Use >= for autounmask if possible]"
- "--autounmask-keep-masks[Don't unmask hardmasks and unkeyworded (live)]"
- "--autounmask-write[Automatically write autounmask changes (respect CONFIG_PROTECT)]"
- "--backtrack=[Number of times to backtrack if dependency calculation fails]:number:(0 10 30)"
- "--binpkg-respect-use[Ignore binary packages if their uses don't match current config]"
- "--complete-graph[Consider the deep dependencies of all packages from the world set]"
- "--complete-graph-if-new-use[--complete-graph if USE or IUSE will change for an installed package]"
- "--complete-graph-if-new-ver[--complete-graph if an installed package version will change]"
- "--config-root=[Set PORTAGE_CONFIGROOT variable]:root path:_files -/"
- "--depclean-lib-check[Check library link-level dependencies]"
- "--digest[Prevent corruption from being noticed]"
- "--dynamic-deps[Substitute the dependencies of installed packages with the dependencies of corresponding unbuilt ebuilds]"
- "--fail-clean[Clean up temporary files after a build failure]"
- "--ignore-built-slot-operator-deps[Ignore the slot/sub-slot dependencies for built pkg]"
- "--keep-going[Continue as much as possible after an error]"
- "--load-average[No new builds should be started if there are other builds running and the load average is at least VALUE]"
- "--misspell-suggestions[Enable or disable misspell suggestions]"
- "--newrepo[Recompile a package if it is now being pulled from a different repository]"
- "--usepkg-exclude[Ignore matching binary packages]:installed atom:_gentoo_packages installed"
- "--rebuild-exclude[Do not rebuild matching packages on --rebuild]:installed atom:_gentoo_packages installed"
- "--rebuild-ignore[Do not rebuild packages that depend on matching packages on --rebuild]:installed atom:_gentoo_packages installed"
- "--package-moves[Perform package moves when necessary]"
- "--pkg-format[Binary package format]:archive type:(tar rpm)"
- "--prefix=[Set EPREFIX env variable]:prefix path:_files -/"
- "--quiet-build[Redirect all build output to logs]"
- "--quiet-fail[Suppresses display of the build log on stdout]"
- "--quiet-repo-display[Suppress ::repository in output (and use numbers)]"
- "--quiet-unmerge-warn[Disable the warning message on --unmerge and friends]"
- "--rebuild-if-new-slot[Automatically rebuild or reinstall packages when dependencies can be satisfied by a newer slot]"
- "--rebuild-if-new-rev[Rebuild packages when build-time dependencies are built from source, if the dependency is not already installed with the same version and revision]"
- "--rebuild-if-new-ver[Rebuild packages when build-time dependencies are built from source, if the dependency is not already installed with the same version]"
- "--rebuild-if-unbuilt[Rebuild packages when build-time dependencies are built from source]"
- "--rebuilt-binaries[Replace installed packages with binary packages that have been rebuilt]"
- "--rebuilt-binaries-timestamp[Only binaries older than TIMESTAMP will be considered by the rebuilt-binaries logic]:TIMESTAMP"
- "--reinstall[Alias for --changed-use (currently)]:reinstall opts:(changes-use)"
- "--reinstall-atoms[Treat matching packages as if they are not installed]:installed atoms:_gentoo_packages installed"
- "--root=[Set ROOT env variable]:prefix path:_files -/"
- "(: $nopkg_opts)"{-w,--select}"[Add specified packages to the world set (inverse of --oneshot)]"
- "--selective=[Use --selective=n if you want to forcefully disable --selective, regardless of options like --changed-use, --newuse, --noreplace, or --update]:yes/no:((y\:'yes' n\:'no'))"
- "--unordered-display[Produce more readable package tree with --tree]"
- "--use-ebuild-visibility[Use unbuilt ebuild metadata for visibility checks on built packages]"
- "--useoldpkg-atoms[Prefer matching binary packages over newer unbuilt packages]:available atom:_gentoo_packages available"
+ "--deselect[Remove atom from world file]"
+ "--alphabetical[Sort use/other flags output alphabetically despite of status]"
+ "--ask-enter-invalid[When with --ask, interpret a single 'Enter' key press as invalid input]"
+ "--autounmask[Automatically unmask packages and generate package.use]"
+ "--autounmask-unrestricted-atoms[Use >= for autounmask if possible]"
+ "--autounmask-keep-masks[Don't unmask hardmasks and unkeyworded (live)]"
+ "--autounmask-write[Automatically write autounmask changes (respect CONFIG_PROTECT)]"
+ "--backtrack=[Number of times to backtrack if dependency calculation fails]:number:(0 10 30)"
+ "--binpkg-respect-use[Ignore binary packages if their uses don't match current config]"
+ "--complete-graph[Consider the deep dependencies of all packages from the world set]"
+ "--complete-graph-if-new-use[--complete-graph if USE or IUSE will change for an installed package]"
+ "--complete-graph-if-new-ver[--complete-graph if an installed package version will change]"
+ "--config-root=[Set PORTAGE_CONFIGROOT variable]:root path:_files -/"
+ "--depclean-lib-check[Check library link-level dependencies]"
+ "--digest[Prevent corruption from being noticed]"
+ "--dynamic-deps[Substitute the dependencies of installed packages with the dependencies of corresponding unbuilt ebuilds]"
+ "--fail-clean[Clean up temporary files after a build failure]"
+ "--ignore-built-slot-operator-deps[Ignore the slot/sub-slot dependencies for built pkg]"
+ "--keep-going[Continue as much as possible after an error]"
+ "--load-average[No new builds should be started if there are other builds running and the load average is at least VALUE]"
+ "--misspell-suggestions[Enable or disable misspell suggestions]"
+ "--newrepo[Recompile a package if it is now being pulled from a different repository]"
+ "--usepkg-exclude[Ignore matching binary packages]:installed atom:_gentoo_packages installed"
+ "--rebuild-exclude[Do not rebuild matching packages on --rebuild]:installed atom:_gentoo_packages installed"
+ "--rebuild-ignore[Do not rebuild packages that depend on matching packages on --rebuild]:installed atom:_gentoo_packages installed"
+ "--package-moves[Perform package moves when necessary]"
+ "--pkg-format[Binary package format]:archive type:(tar rpm)"
+ "--prefix=[Set EPREFIX env variable]:prefix path:_files -/"
+ "--quiet-build[Redirect all build output to logs]"
+ "--quiet-fail[Suppresses display of the build log on stdout]"
+ "--quiet-repo-display[Suppress ::repository in output (and use numbers)]"
+ "--quiet-unmerge-warn[Disable the warning message on --unmerge and friends]"
+ "--rebuild-if-new-slot[Automatically rebuild or reinstall packages when dependencies can be satisfied by a newer slot]"
+ "--rebuild-if-new-rev[Rebuild packages when build-time dependencies are built from source, if the dependency is not already installed with the same version and revision]"
+ "--rebuild-if-new-ver[Rebuild packages when build-time dependencies are built from source, if the dependency is not already installed with the same version]"
+ "--rebuild-if-unbuilt[Rebuild packages when build-time dependencies are built from source]"
+ "--rebuilt-binaries[Replace installed packages with binary packages that have been rebuilt]"
+ "--rebuilt-binaries-timestamp[Only binaries older than TIMESTAMP will be considered by the rebuilt-binaries logic]:TIMESTAMP"
+ "--reinstall[Alias for --changed-use (currently)]:reinstall opts:(changes-use)"
+ "--reinstall-atoms[Treat matching packages as if they are not installed]:installed atoms:_gentoo_packages installed"
+ "--root=[Set ROOT env variable]:prefix path:_files -/"
+ "(: $nopkg_opts)"{-w,--select}"[Add specified packages to the world set (inverse of --oneshot)]"
+ "--selective=[Use --selective=n if you want to forcefully disable --selective, regardless of options like --changed-use, --newuse, --noreplace, or --update]:yes/no:((y\:'yes' n\:'no'))"
+ "--unordered-display[Produce more readable package tree with --tree]"
+ "--use-ebuild-visibility[Use unbuilt ebuild metadata for visibility checks on built packages]"
+ "--useoldpkg-atoms[Prefer matching binary packages over newer unbuilt packages]:available atom:_gentoo_packages available"
"($bopts)"{-b,--buildpkg}"[Tells emerge to build binary packages]"
"($bopts)--buildpkg-exclude[Space separated list of package atoms for which no binary packages should be built]"
- "($bopts)--exclude[Space separated list of package names or slot atoms which should not be installed]"
+ "($bopts)--exclude[Space separated list of package names or slot atoms which should not be installed]"
"($bopts)"{-B,--buildpkgonly}"[Tells emerge to only build binary packages]"
"($nopkg_opts --emptytree -e -l --changelog --usepkgonly -K)"{-l,--changelog}"[This will show the ChangeLog]"
"($nopkg_opts -t --tree)--columns[Displays versions in aligned format]"
@@ -188,178 +185,171 @@ _emerge () {
'system[All packages in the system profile]'
)
-
# Dispatch
- if (( $words[(I)(--(unmerge|(dep|)clean|prune|deselect)|-[[:alpha:]]#(C|c|P)[[:alpha:]]#)] )) ; then
- if compset -P '(\\|)(>=|<=|<|>|=)'; then
- _arguments -s \
- '*:installed package:_gentoo_packages installed_versions' && return 0
- else
- _arguments -s \
- "$common_args[@]" "$install_args[@]" \
- "*:installed package:_gentoo_packages installed" \
- "::installed sets:_gentoo_packages installed_sets" \
- && return 0
- fi
+ if (( $words[(I)(--(unmerge|(dep|)clean|prune|deselect)|-[[:alpha:]]#(C|c|P)[[:alpha:]]#)] )); then
+ if compset -P '(\\|)(>=|<=|<|>|=)'; then
+ _arguments -s \
+ '*:installed package:_gentoo_packages installed_versions' && return 0
+ else
+ _arguments -s \
+ "$common_args[@]" "$install_args[@]" \
+ "*:installed package:_gentoo_packages installed" \
+ "::installed sets:_gentoo_packages installed_sets" \
+ && return 0
+ fi
- elif (( $words[(I)(world|system)] )) ; then
+ elif (( $words[(I)(world|system)] )); then
_arguments -s \
- "$common_args[@]" "$install_args[@]" \
- "($nopkg_opts[1,-2] --inject -i --oneshot -1):" && return 0
+ "$common_args[@]" "$install_args[@]" \
+ "($nopkg_opts[1,-2] --inject -i --oneshot -1):" && return 0
- elif (( $words[(I)(--usepkgonly|-[[:alnum:]]#K[[:alnum:]]#)] )) ; then
+ elif (( $words[(I)(--usepkgonly|-[[:alnum:]]#K[[:alnum:]]#)] )); then
_arguments -s \
- "$common_args[@]" "$install_args[@]" \
- '*:binary package:_gentoo_packages binary' && return 0
+ "$common_args[@]" "$install_args[@]" \
+ '*:binary package:_gentoo_packages binary' && return 0
else
- if compset -P '(\\|)(>=|<=|<|>|=)'; then
- _arguments \
- "*:portage:_gentoo_packages available_versions" && return 0
- elif (( $words[(I)(--inject|-i)] )) ; then
- _arguments -s \
- "$common_args[@]" "$install_args[@]" \
- "*:portage:_gentoo_packages available_versions" && return 0
- else
- _arguments -s \
- "$common_args[@]" "$install_args[@]" \
- "($nopkg_opts)::portage: _values 'profile' \$profiles[@] " \
- "($nopkg_opts)*:portage:_gentoo_packages available" \
- "($nopkg_opts)::available sets:_gentoo_packages available_sets" \
- && return 0
- fi
+ if compset -P '(\\|)(>=|<=|<|>|=)'; then
+ _arguments "*:portage:_gentoo_packages available_versions" && return 0
+ elif (( $words[(I)(--inject|-i)] )); then
+ _arguments -s \
+ "$common_args[@]" "$install_args[@]" \
+ "*:portage:_gentoo_packages available_versions" && return 0
+ else
+ _arguments -s \
+ "$common_args[@]" "$install_args[@]" \
+ "($nopkg_opts)::portage: _values 'profile' \$profiles[@] " \
+ "($nopkg_opts)*:portage:_gentoo_packages available" \
+ "($nopkg_opts)::available sets:_gentoo_packages available_sets" \
+ && return 0
+ fi
fi
}
-
_emaint () {
- _arguments -s \
- "(: -)"{-h,--help}'[show help message and exit]' \
- "(: -)"--version"[show program's version number and exit]" \
- '(-c --check -f --fix)'{-c,--check}"[Check for any problems that may exist]:emaint:((all\:'check all' world\:'check only world file'))" \
- '(-c --check -f --fix)'{-f,--fix}"[Fix any problems that may exist]:emaint:((all\:'check all' world\:'check only world file'))"
+ _arguments -s \
+ "(: -)"{-h,--help}'[show help message and exit]' \
+ "(: -)"--version"[show program's version number and exit]" \
+ '(-c --check -f --fix)'{-c,--check}"[Check for any problems that may exist]:emaint:((all\:'check all' world\:'check only world file'))" \
+ '(-c --check -f --fix)'{-f,--fix}"[Fix any problems that may exist]:emaint:((all\:'check all' world\:'check only world file'))"
}
-
_env-update () {
- _arguments -s '(: -)--no-ldconfig[Do not run ldconfig]'
+ _arguments -s '(: -)--no-ldconfig[Do not run ldconfig]'
}
-
_portageq () {
- local action
-
- action="$words[2]"
-
- if (( CURRENT == 2 )); then
- _values 'command' \
- '--help[Show help]' \
- 'config_protect_mask[Returns the CONFIG_PROTECT_MASK paths]' \
- 'config_protect[Returns the CONFIG_PROTECT paths]' \
- 'portdir[Returns PORTDIR paths]' \
- 'contents[List the files that are installed for a given package]' \
- 'vdb_path[Returns the path used for the var(installed) package database]' \
- 'gentoo_mirrors[Returns the mirrors set to use in the portage configuration]' \
- 'exithandler[MISSING DOCUMENTATION!]' \
- 'all_best_visible[Returns all best_visible packages (without .ebuild)]' \
- 'match[Returns a \n separated list of category/package-version]' \
- 'metadata[Returns metadata values for the specified package]' \
- 'best_visible[Returns category/package-version (without .ebuild)]' \
- 'mass_best_visible[Returns category/package-version (without .ebuild)]' \
- "has_version[Return code 0 if it's available, 1 otherwise]" \
- 'envvar[Returns a specific environment variable as exists prior to ebuild.sh]' \
- 'pkgdir[Returns the PKGDIR path]' \
- 'best_version[Returns category/package-version (without .ebuild)]' \
- 'mass_best_version[Returns category/package-version (without .ebuild)]' \
- 'portdir_overlay[Returns the PORTDIR_OVERLAY path]' \
- 'distdir[Returns the DISTDIR path]' \
- 'owners[print the packages that own the files and which files belong to each package]'
- elif (( CURRENT == 3 )); then
- if [[ "$action" =~ (contents|(all_|mass_|)best_visible|match|metadata|(has|best)_version|owners|mass_best_version) ]]; then
- _arguments -s '*:root:_files -g /'
- fi
- elif (( CURRENT > 3 )); then
- if [[ "$action" =~ ((mass_|)best_(visible|version)|has_version) ]]; then
- _arguments -s '*:package:_gentoo_packages available'
- elif [[ "$action" == owners ]]; then
- _arguments -s '*:root:_files'
- fi
+ local action
+
+ action="$words[2]"
+
+ if (( CURRENT == 2 )); then
+ _values 'command' \
+ '--help[Show help]' \
+ 'config_protect_mask[Returns the CONFIG_PROTECT_MASK paths]' \
+ 'config_protect[Returns the CONFIG_PROTECT paths]' \
+ 'portdir[Returns PORTDIR paths]' \
+ 'contents[List the files that are installed for a given package]' \
+ 'vdb_path[Returns the path used for the var(installed) package database]' \
+ 'gentoo_mirrors[Returns the mirrors set to use in the portage configuration]' \
+ 'exithandler[MISSING DOCUMENTATION!]' \
+ 'all_best_visible[Returns all best_visible packages (without .ebuild)]' \
+ 'match[Returns a \n separated list of category/package-version]' \
+ 'metadata[Returns metadata values for the specified package]' \
+ 'best_visible[Returns category/package-version (without .ebuild)]' \
+ 'mass_best_visible[Returns category/package-version (without .ebuild)]' \
+ "has_version[Return code 0 if it's available, 1 otherwise]" \
+ 'envvar[Returns a specific environment variable as exists prior to ebuild.sh]' \
+ 'pkgdir[Returns the PKGDIR path]' \
+ 'best_version[Returns category/package-version (without .ebuild)]' \
+ 'mass_best_version[Returns category/package-version (without .ebuild)]' \
+ 'portdir_overlay[Returns the PORTDIR_OVERLAY path]' \
+ 'distdir[Returns the DISTDIR path]' \
+ 'owners[print the packages that own the files and which files belong to each package]'
+ elif (( CURRENT == 3 )); then
+ if [[ "$action" =~ (contents|(all_|mass_|)best_visible|match|metadata|(has|best)_version|owners|mass_best_version) ]]; then
+ _arguments -s '*:root:_files -g /'
+ fi
+ elif (( CURRENT > 3 )); then
+ if [[ "$action" =~ ((mass_|)best_(visible|version)|has_version) ]]; then
+ _arguments -s '*:package:_gentoo_packages available'
+ elif [[ "$action" == owners ]]; then
+ _arguments -s '*:root:_files'
fi
+ fi
}
-
_repoman () {
- local previous
-
- previous="$words[CURRENT-1]"
-
- _arguments -s \
- '(--force)'--force'[Force commit to proceed, regardless of QA issues]' \
- '(-q --quiet -v --verbose)'{-q,--quiet}'[Be less verbose about extraneous info]' \
- '(-p --pretend -m --commitmsg -M --commitmsgfile)'{-p,--pretend}'[Don’t commit or fix anything; just show what would be done]' \
- '(-i --include-masked)'{-i,--include-masked}'[Include masked packages in scans at category or tree level]' \
- '(-x --xmlparse)'{-x,--xmlparse}'[Forces the metadata.xml parse check to be carried out]' \
- '(-q --quiet -v --verbose)'{-v,--verbose}'[Displays every package name while checking]' \
- '(-I --ignore-arches)'{-I,--ignore-arches}'[Ignore arch-specific failures (where arch != host)]' \
- '(-m --commitmsg -M --commitmsgfile)'{-m,--commitmsg}'[Adds a commit message via the command line]:message:' \
- '(-m --commitmsg -M --commitmsgfile)'{-M,--commitmsgfile}'[Adds a commit message from the specified file]:commit_file:_files' \
- '(: -)'{-V,--version}'[Show version info]' \
- '(: -)'{-h,--help}'[Show this screen]'
-
- # if we don't have an option that cancel action, or if we don't already have an action.
- if ! [[ "$previous" =~ (-h|-V|-m|-M|--version|--help|--commitmsg|--commitmsgfile) ]] &&
- ! (( $words[(I)(full|last|help|scan|fix|lfull|manifest|commit)] )); then
- _values 'action' \
- 'full[Scan directory tree for QA issues (full listing)]' \
- 'last[Remember report from last run]' \
- 'help[Show this screen]' \
- 'scan[Scan directory tree for QA issues (short listing)]' \
- 'fix[Fix simple QA issues (stray digests, missing digests)]' \
- 'lfull[Remember report from last run (full listing)]' \
- 'manifest[Generate a Manifest (fetches files if necessary)]' \
- 'commit[Scan directory tree for QA issues; if OK, commit via cvs]'
- fi
+ local previous
+
+ previous="$words[CURRENT-1]"
+
+ _arguments -s \
+ '(--force)'--force'[Force commit to proceed, regardless of QA issues]' \
+ '(-q --quiet -v --verbose)'{-q,--quiet}'[Be less verbose about extraneous info]' \
+ '(-p --pretend -m --commitmsg -M --commitmsgfile)'{-p,--pretend}'[Don’t commit or fix anything; just show what would be done]' \
+ '(-i --include-masked)'{-i,--include-masked}'[Include masked packages in scans at category or tree level]' \
+ '(-x --xmlparse)'{-x,--xmlparse}'[Forces the metadata.xml parse check to be carried out]' \
+ '(-q --quiet -v --verbose)'{-v,--verbose}'[Displays every package name while checking]' \
+ '(-I --ignore-arches)'{-I,--ignore-arches}'[Ignore arch-specific failures (where arch != host)]' \
+ '(-m --commitmsg -M --commitmsgfile)'{-m,--commitmsg}'[Adds a commit message via the command line]:message:' \
+ '(-m --commitmsg -M --commitmsgfile)'{-M,--commitmsgfile}'[Adds a commit message from the specified file]:commit_file:_files' \
+ '(: -)'{-V,--version}'[Show version info]' \
+ '(: -)'{-h,--help}'[Show this screen]'
+
+ # if we don't have an option that cancel action, or if we don't already have an action.
+ if ! [[ "$previous" =~ (-h|-V|-m|-M|--version|--help|--commitmsg|--commitmsgfile) ]] &&
+ ! (( $words[(I)(full|last|help|scan|fix|lfull|manifest|commit)] )); then
+ _values 'action' \
+ 'full[Scan directory tree for QA issues (full listing)]' \
+ 'last[Remember report from last run]' \
+ 'help[Show this screen]' \
+ 'scan[Scan directory tree for QA issues (short listing)]' \
+ 'fix[Fix simple QA issues (stray digests, missing digests)]' \
+ 'lfull[Remember report from last run (full listing)]' \
+ 'manifest[Generate a Manifest (fetches files if necessary)]' \
+ 'commit[Scan directory tree for QA issues; if OK, commit via cvs]'
+ fi
}
-
_tbz2tool () {
- if (( CURRENT == 2 )); then
- _values 'action' 'join' 'split'
- elif (( CURRENT > 2 )) && (( CURRENT < 6 )); then
- _arguments -s '*:file:_files'
- fi
+ if (( CURRENT == 2 )); then
+ _values 'action' 'join' 'split'
+ elif (( CURRENT > 2 )) && (( CURRENT < 6 )); then
+ _arguments -s '*:file:_files'
+ fi
}
-
zparseopts -D -E -A Args -- -emerge
-if (( ${+Args[--emerge]} ));then
- _emerge "$@" && return 0
+if (( ${+Args[--emerge]} )); then
+ _emerge "$@" && return 0
fi
case "$service" in
- emerge)
- _emerge "$@" && return 0
- ;;
- ebuild)
- _ebuild "$@" && return 0
- ;;
- quickpkg)
- _quickpkg "$@" && return 0
- ;;
- emaint)
- _emaint "$@" && return 0
- ;;
- env-update)
- _env-update "$@" && return 0
- ;;
- portageq)
- _portageq "$@" && return 0
- ;;
- repoman)
- _repoman "$@" && return 0
- ;;
- tbz2tool)
- _tbz2tool "$@" && return 0
- ;;
+ emerge)
+ _emerge "$@" && return 0
+ ;;
+ ebuild)
+ _ebuild "$@" && return 0
+ ;;
+ quickpkg)
+ _quickpkg "$@" && return 0
+ ;;
+ emaint)
+ _emaint "$@" && return 0
+ ;;
+ env-update)
+ _env-update "$@" && return 0
+ ;;
+ portageq)
+ _portageq "$@" && return 0
+ ;;
+ repoman)
+ _repoman "$@" && return 0
+ ;;
+ tbz2tool)
+ _tbz2tool "$@" && return 0
+ ;;
esac
+# vim: set et sw=2 sts=2 ts=2 ft=zsh:
diff --git a/src/_portage_utils b/src/_portage_utils
index 4638258..95811c8 100644
--- a/src/_portage_utils
+++ b/src/_portage_utils
@@ -2,266 +2,266 @@
# portage-utils-0.53
-
_portdir() {
- local mainreponame mainrepopath overlayname overlaypath
-
- if [[ -e /usr/share/portage/config/repos.conf ]]; then
- if [[ ${1} == "-o" ]]; then
- for overlayname in $(_parsereposconf -l); do
- overlaypath+=($(_parsereposconf ${overlayname} location))
- done
+ local mainreponame mainrepopath overlayname overlaypath
- source /etc/make.conf 2>/dev/null
- source /etc/portage/make.conf 2>/dev/null
+ if [[ -e /usr/share/portage/config/repos.conf ]]; then
+ if [[ ${1} == "-o" ]]; then
+ for overlayname in $(_parsereposconf -l); do
+ overlaypath+=($(_parsereposconf ${overlayname} location))
+ done
- overlaypath+=(${(@)PORTDIR_OVERLAY})
+ source /etc/make.conf 2>/dev/null
+ source /etc/portage/make.conf 2>/dev/null
- echo "${(@u)overlaypath}"
- else
- mainreponame=$(_parsereposconf DEFAULT main-repo)
- mainrepopath=$(_parsereposconf ${mainreponame} location)
+ overlaypath+=(${(@)PORTDIR_OVERLAY})
- echo "${mainrepopath}"
- fi
+ echo "${(@u)overlaypath}"
else
- source /usr/share/portage/config/make.globals 2>/dev/null
- source /etc/make.conf 2>/dev/null
- source /etc/portage/make.conf 2>/dev/null
+ mainreponame=$(_parsereposconf DEFAULT main-repo)
+ mainrepopath=$(_parsereposconf ${mainreponame} location)
- if [[ ${1} == "-o" ]]; then
- echo "${(@u)PORTDIR_OVERLAY}"
- else
- echo "${PORTDIR}"
- fi
+ echo "${mainrepopath}"
+ fi
+ else
+ source /usr/share/portage/config/make.globals 2>/dev/null
+ source /etc/make.conf 2>/dev/null
+ source /etc/portage/make.conf 2>/dev/null
+
+ if [[ ${1} == "-o" ]]; then
+ echo "${(@u)PORTDIR_OVERLAY}"
+ else
+ echo "${PORTDIR}"
fi
+ fi
}
_parsereposconf() {
- local v f insection section arr
+ local v f insection section arr
- for f in /usr/share/portage/config/repos.conf \
- /etc/portage/repos.conf \
- /etc/portage/repos.conf/*.conf; do
+ for f in /usr/share/portage/config/repos.conf \
+ /etc/portage/repos.conf \
+ /etc/portage/repos.conf/*.conf; do
- [[ -f ${f} ]] || continue
- insection=0
- declare -A arr
- IFS='= '
+ [[ -f ${f} ]] || continue
+ insection=0
+ declare -A arr
+ IFS='= '
- while read -r name value; do
- [[ -z ${name} || ${name} == '#'* ]] && continue
+ while read -r name value; do
+ [[ -z ${name} || ${name} == '#'* ]] && continue
- if [[ (${name} == '['*']') && (-z ${value}) ]]; then
- value=${name//(\]|\[)}
- name="section"
- fi
- arr[${name}]=${value}
+ if [[ (${name} == '['*']') && (-z ${value}) ]]; then
+ value=${name//(\]|\[)}
+ name="section"
+ fi
+ arr[${name}]=${value}
- if [[ ${insection} == 1 && ${name} == "section" ]]; then
- break
- elif [[ ${name} == "section" ]]; then
- [[ ${value} == ${1} ]] && insection=1
- secname+=(${value})
- elif [[ ${insection} == 1 ]]; then
- if [[ ${name} == ${2} ]]; then
- v=${value}
- fi
- fi
- continue
- done < ${f}
- done
+ if [[ ${insection} == 1 && ${name} == "section" ]]; then
+ break
+ elif [[ ${name} == "section" ]]; then
+ [[ ${value} == ${1} ]] && insection=1
+ secname+=(${value})
+ elif [[ ${insection} == 1 ]]; then
+ if [[ ${name} == ${2} ]]; then
+ v=${value}
+ fi
+ fi
+ continue
+ done < ${f}
+ done
- if [[ ${1} == "-l" ]]; then
- echo "${(@)secname}"
- else
- echo "${v}"
- fi
+ if [[ ${1} == "-l" ]]; then
+ echo "${(@)secname}"
+ else
+ echo "${v}"
+ fi
}
-
local common_args PORTDIR
PORTDIR="$(_portdir)"
common_args=(
- '--root[Set the ROOT env var]:root directory:_files -/' \
- {'(--verbose)-v','(-v)--verbose'}'[Make a lot of noise]' \
- {'(--quiet)-q','(-q)--quiet'}'[Tighter output; suppress warnings]' \
- {'(--nocolor)-C','(-C)--nocolor'}'[Do not output color]' \
- {'(--help)-h','(-h)--help'}'[Print this help and exit]' \
- {'(--version)-V','(-V)--version'}'[Print version and exit]' \
+ '--root[Set the ROOT env var]:root directory:_files -/' \
+ {'(--verbose)-v','(-v)--verbose'}'[Make a lot of noise]' \
+ {'(--quiet)-q','(-q)--quiet'}'[Tighter output; suppress warnings]' \
+ {'(--nocolor)-C','(-C)--nocolor'}'[Do not output color]' \
+ {'(--help)-h','(-h)--help'}'[Print this help and exit]' \
+ {'(--version)-V','(-V)--version'}'[Print version and exit]' \
)
case $service in
- qatom)
- _arguments -s $common_args \
- {'(--compare)-c','(-c)--compare'}'[Compare two atoms]'
- ;;
- qcache)
- local arch
- local -a arches allarches
+ qatom)
+ _arguments -s $common_args \
+ {'(--compare)-c','(-c)--compare'}'[Compare two atoms]'
+ ;;
+ qcache)
+ local arch
+ local -a arches allarches
- show_archs(){
- arches=(${(f)"$(<$PORTDIR/profiles/arch.list)"})
- for arch in $arches; do
- [[ $arch =~ '^[^#]' ]] && allarches+=( $arch )
- done
- _describe -t available-arches "arch" allarches
- }
+ show_archs(){
+ arches=(${(f)"$(<$PORTDIR/profiles/arch.list)"})
+ for arch in $arches; do
+ [[ $arch =~ '^[^#]' ]] && allarches+=( $arch )
+ done
+ _describe -t available-arches "arch" allarches
+ }
- _arguments -s $common_args \
- {'(--matchpkg)-p','(-p)--matchpkg'}'[match pkgname]:package name:_gentoo_packages available_pkgnames_only' \
- {'(--matchcat)-c','(-c)--matchcat'}'[match catname]:category:_gentoo_packages category' \
- {'(--imlate)-i','(-i)--imlate'}'[list packages that can be marked stable on a given arch]' \
- {'(--dropped)-d','(-d)--dropped'}'[list packages that have dropped keywords on a version bump on a given arch]' \
- {'(--testing)-t','(-t)--testing'}'[list packages that have ~arch versions, but no stable versions on a given arch]' \
- {'(--stats)-s','(-s)--stats'}'[display statistics about the portage tree]' \
- {'(--all)-a','(-a)--all'}'[list packages that have at least one version keyworded for on a given arch]' \
- {'(--not)-n','(-n)--not'}"[list packages that aren't keyworded on a given arch]" \
- '*:arch:show_archs'
- ;;
- qcheck)
- _arguments -s $common_args \
- {'(--all)-a','(-a)--all'}'[List all packages]' \
- {'(--exact)-e','(-e)--exact'}'[Exact match (only CAT/PN or PN without PV)]' \
- {'(--skip)-s','(-s)--skip'}'[Ignore files matching regular expression]:regex' \
- {'(--update)-u','(-u)--update'}'[Update missing files, chksum and mtimes for packages]' \
- {'(--noafk)-A','(-A)--noafk'}'[Ignore missing files]' \
- {'(--badonly)-B','(-B)--badonly'}'[Only print pkgs containing bad files]' \
- {'(--nohash)-H','(-H)--nohash'}'[Ignore differing/unknown file chksums]' \
- {'(--nomtime)-T','(-T)--nomtime'}'[Ignore differing file mtimes]' \
- '--skip-protected[Ignore files in CONFIG_PROTECT-ed paths]' \
- {'(--prelink)-p','(-p)--prelink'}'[Undo prelink when calculating checksums]' \
- '*:packages:_gentoo_packages installed'
- ;;
- qdepends)
- _arguments -s $common_args \
- {'(--depend)-d','(-d)--depend'}'[Show DEPEND info (default)]' \
- {'(--rdepend)-r','(-r)--rdepend'}'[Show RDEPEND info]' \
- {'(--pdepend)-p','(-p)--pdepend'}'[Show PDEPEND info]' \
- {'(--key)-k','(-k)--key'}'[User defined vdb key]:vdb key' \
- {'(--query)-Q','(-Q)--query'}'[Query reverse deps]' \
- {'(--name-only)-N','(-N)--name-only'}'[Only show package name]' \
- {'(--all)-a','(-a)--all'}'[Show all DEPEND info]' \
- {'(--format)-f','(-f)--format'}'[Pretty format specified depend strings]' \
- '*:packages:_gentoo_packages installed'
- ;;
- qfile)
- _arguments -s $common_args \
- {'(--slots)-S','(-S)--slots'}'[Display installed packages with slots]' \
- {'(--root-prefix)-R','(-R)--root-prefix'}'[Assume arguments are already prefixed by $ROOT]' \
- {'(--from)-f','(-f)--from'}'[Read arguments from file <arg> ("-" for stdin)]' \
- {'(--max-args)-m','(-m)--max-args'}'[Treat from file arguments by groups of <arg> (defaults to 5000)]:number' \
- {'(--basename)-b','(-b)--basename'}'[Match any component of the path]' \
- {'(--orphans)-o','(-o)--orphans'}'[List orphan files]' \
- {'(--exclude)-x','(-x)--exclude'}"[Don't look in package <arg> (used with --orphans)]:package:_gentoo_packages installed" \
- {'(--exact)-e','(-e)--exact'}'[Exact match (used with --exclude)]' \
- '*:filename:_files'
- ;;
- qgrep)
- _arguments -s $common_args \
- {'(--invert-match)-I','(-I)--invert-match'}'[Select non-matching lines]' \
- {'(--ignore-case)-i','(-i)--ignore-case'}'[Ignore case distinctions]' \
- {'(--with-filename)-H','(-H)--with-filename'}'[Print the filename for each match]' \
- {'(--with-name)-N','(-N)--with-name'}'[Print the package or eclass name for each match]' \
- {'(--count)-c','(-c)--count'}'[Only print a count of matching lines per FILE]' \
- {'(--list)-l','(-l)--list'}'[Only print FILE names containing matches]' \
- {'(--invert-list)-L','(-L)--invert-list'}'[Only print FILE names containing no match]' \
- {'(--regexp)-e','(-e)--regexp'}'[Use PATTERN as a regular expression]' \
- {'(--extended)-x','(-x)--extended'}'[Use PATTERN as an extended regular expression]' \
- {'(--installed)-J','(-J)--installed'}'[Search in installed ebuilds instead of the tree]' \
- {'(--eclass)-E','(-E)--eclass'}'[Search in eclasses instead of ebuilds]' \
- {'(--skip-comments)-s','(-s)--skip-comments'}'[Skip comments lines]' \
- {'(--skip)-S','(-S)--skip'}'[Skip lines matching <arg>]:pattern' \
- {'(--before)-B','(-B)--before'}'[Print <arg> lines of leading context]:number' \
- {'(--after)-A','(-A)--after'}'[Print <arg> lines of trailing context]:number' \
- '*:pattern::'
- ;;
- qlist)
- _arguments -s $common_args \
- {'(--installed)-I','(-I)--installed'}'[Just show installed packages]' \
- {'(--slots)-S','(-S)--slots'}'[Display installed packages with slots]' \
- {'(--repo)-R','(-R)--repo'}'[Display installed packages with repository]' \
- {'(--umap)-U','(-U)--umap'}'[Display installed packages with flags used]' \
- {'(--columns)-c','(-c)--columns'}'[Display column view]' \
- '--show-debug[Show /usr/lib/debug files]' \
- {'(--exact)-e','(-e)--exact'}'[Exact match (only CAT/PN or PN without PV)]' \
- {'(--all)-a','(-a)--all'}'[Show every installed package]' \
- {'(--dir)-d','(-d)--dir'}'[Only show directories]' \
- {'(--obj)-o','(-o)--obj'}'[Only show objects]' \
- {'(--sym)-s','(-s)--sym'}'[Only show symlinks]' \
- '*:packages:_gentoo_packages installed'
- ;;
- qlop)
- _arguments -s $common_args \
- {'(--gauge)-g','(-g)--gauge'}'[Gauge number of times a package has been merged]' \
- {'(--time)-t','(-t)--time'}'[Calculate merge time for a specific package]' \
- {'(--human)-H','(-H)--human'}'[Print seconds in human readable format (needs -t)]' \
- {'(--list)-l','(-l)--list'}'[Show merge history]' \
- {'(--unlist)-u','(-u)--unlist'}'[Show unmerge history]' \
- {'(--sync)-s','(-s)--sync'}'[Show sync history]' \
- {'(--current)-c','(-c)--current'}'[Show current emerging packages]' \
- {'(--logfile)-f','(-f)--logfile'}'[Read emerge logfile instead of /var/log/emerge.log]:log:_files' \
- '*:packages:_gentoo_packages available'
- ;;
- qsearch)
- _arguments -s $common_args \
- {'(--all)-a','(-a)--all'}'[List the descriptions of every package in the cache]' \
- {'(--cache)-c','(-c)--cache'}'[Use the portage cache]' \
- {'(--ebuilds)-e','(-e)--ebuilds'}'[Use the portage ebuild tree]' \
- {'(--search)-s','(-s)--search'}'[Regex search package basenames]' \
- {'(--desc)-S','(-S)--desc'}'[Regex search package descriptions]' \
- {'(--name-only)-N','(-N)--name-only'}'[Only show package name]' \
- {'(--homepage)-H','(-H)--homepage'}'[Show homepage info]' \
- '*:pattern::'
- ;;
- qsize)
- _arguments -s $common_args \
- {'(--filesystem)-f','(-f)--filesystem'}'[Show size used on disk]' \
- {'(--all)-a','(-a)--all'}'[Size all installed packages]' \
- {'(--sum)-s','(-s)--sum'}'[Include a summary]' \
- {'(--sum-only)-S','(-S)--sum-only'}'[Show just the summary]' \
- {'(--megabytes)-m','(-m)--megabytes'}'[Display size in megabytes]' \
- {'(--kilobytes)-k','(-k)--kilobytes'}'[Display size in kilobytes]' \
- {'(--bytes)-b','(-b)--bytes'}'[Display size in bytes]' \
- {'(--ignore)-i','(-i)--ignore'}'[Ignore regexp string]:pattern' \
- '*:packages:_gentoo_packages installed'
- ;;
- quse)
- _arguments -s $common_args \
- {'(--exact)-e','(-e)--exact'}'[Show exact non regexp matching using strcmp]' \
- {'(--all)-a','(-a)--all'}'[Show annoying things in IUSE]' \
- {'(--keywords)-K','(-K)--keywords'}'[Use the KEYWORDS vs IUSE]' \
- {'(--license)-L','(-L)--license'}'[Use the LICENSE vs IUSE]' \
- {'(--describe)-D','(-D)--describe'}'[Describe the USE flag]' \
- {'(--format)-F','(-F)--format'}'[Use your own variable formats: -F NAME=]:format' \
- {'(--name-only)-N','(-N)--name-only'}'[Only show package name]' \
- '*:use flag:_gentoo_packages useflag'
- ;;
- qtbz2)
- _arguments -s $common_args \
- {'(--dir)-d','(-d)--dir'}'[Change to specified directory]:directory:_files -/' \
- {'(--join)-j','(-j)--join'}'[Join tar.bz2 + xpak into a tbz2]:*:tar.bz2 file and xpak file:_files -g \*.\(tar.bz2\|xpak\)' \
- {'(--split)-s','(-s)--split'}'[Split a tbz2 into a tar.bz2 + xpak]:tbz2 file:_files -g \*.tbz2' \
- {'(--tarbz2)-t','(-t)--tarbz2'}'[Just split the tar.bz2]:tbz2 file:_files -g \*.tbz2' \
- {'(--xpak)-x','(-x)--xpak'}'[Just split the xpak]:tbz2 file:_files -g \*.tbz2' \
- {'(--stdout)-O','(-O)--stdout'}'[Write files to stdout]'
- ;;
- qpkg)
- _arguments -s $common_args \
- {'(--clean)-c','(-c)--clean'}'[clean pkgdir of unused binary files]' \
- {'(--eclean)-E','(-E)--eclean'}'[clean pkgdir of files not in the tree anymore (slow)]' \
- {'(--pretend)-p','(-p)--pretend'}'[pretend only]' \
- {'(--pkgdir)-P','(-P)--pkgdir'}'[alternate package directory]:alternate pkgdir:_files -/' \
- '*:Installed packages:_gentoo_packages installed_versions'
- ;;
- qxpak)
- _arguments -s $common_args \
- {'(--list)-l','(-l)--list'}'[List the contents of an archive]:xpak archive:_files -g \*.xpak' \
- {'(--extract)-x','(-x)--extract'}'[Extract the contents of an archive]:xpak archive:_files -g \*.xpak' \
- {'(--create)-c','(-c)--create'}'[Create an archive of a directory/files]:*:archive name and files to archive:_files' \
- {'(--dir)-d','(-d)--dir'}'[Change to specified directory]:directory:_files -/' \
- {'(--stdout)-O','(-O)--stdout'}'[Write files to stdout]'
- ;;
+ _arguments -s $common_args \
+ {'(--matchpkg)-p','(-p)--matchpkg'}'[match pkgname]:package name:_gentoo_packages available_pkgnames_only' \
+ {'(--matchcat)-c','(-c)--matchcat'}'[match catname]:category:_gentoo_packages category' \
+ {'(--imlate)-i','(-i)--imlate'}'[list packages that can be marked stable on a given arch]' \
+ {'(--dropped)-d','(-d)--dropped'}'[list packages that have dropped keywords on a version bump on a given arch]' \
+ {'(--testing)-t','(-t)--testing'}'[list packages that have ~arch versions, but no stable versions on a given arch]' \
+ {'(--stats)-s','(-s)--stats'}'[display statistics about the portage tree]' \
+ {'(--all)-a','(-a)--all'}'[list packages that have at least one version keyworded for on a given arch]' \
+ {'(--not)-n','(-n)--not'}"[list packages that aren't keyworded on a given arch]" \
+ '*:arch:show_archs'
+ ;;
+ qcheck)
+ _arguments -s $common_args \
+ {'(--all)-a','(-a)--all'}'[List all packages]' \
+ {'(--exact)-e','(-e)--exact'}'[Exact match (only CAT/PN or PN without PV)]' \
+ {'(--skip)-s','(-s)--skip'}'[Ignore files matching regular expression]:regex' \
+ {'(--update)-u','(-u)--update'}'[Update missing files, chksum and mtimes for packages]' \
+ {'(--noafk)-A','(-A)--noafk'}'[Ignore missing files]' \
+ {'(--badonly)-B','(-B)--badonly'}'[Only print pkgs containing bad files]' \
+ {'(--nohash)-H','(-H)--nohash'}'[Ignore differing/unknown file chksums]' \
+ {'(--nomtime)-T','(-T)--nomtime'}'[Ignore differing file mtimes]' \
+ '--skip-protected[Ignore files in CONFIG_PROTECT-ed paths]' \
+ {'(--prelink)-p','(-p)--prelink'}'[Undo prelink when calculating checksums]' \
+ '*:packages:_gentoo_packages installed'
+ ;;
+ qdepends)
+ _arguments -s $common_args \
+ {'(--depend)-d','(-d)--depend'}'[Show DEPEND info (default)]' \
+ {'(--rdepend)-r','(-r)--rdepend'}'[Show RDEPEND info]' \
+ {'(--pdepend)-p','(-p)--pdepend'}'[Show PDEPEND info]' \
+ {'(--key)-k','(-k)--key'}'[User defined vdb key]:vdb key' \
+ {'(--query)-Q','(-Q)--query'}'[Query reverse deps]' \
+ {'(--name-only)-N','(-N)--name-only'}'[Only show package name]' \
+ {'(--all)-a','(-a)--all'}'[Show all DEPEND info]' \
+ {'(--format)-f','(-f)--format'}'[Pretty format specified depend strings]' \
+ '*:packages:_gentoo_packages installed'
+ ;;
+ qfile)
+ _arguments -s $common_args \
+ {'(--slots)-S','(-S)--slots'}'[Display installed packages with slots]' \
+ {'(--root-prefix)-R','(-R)--root-prefix'}'[Assume arguments are already prefixed by $ROOT]' \
+ {'(--from)-f','(-f)--from'}'[Read arguments from file <arg> ("-" for stdin)]' \
+ {'(--max-args)-m','(-m)--max-args'}'[Treat from file arguments by groups of <arg> (defaults to 5000)]:number' \
+ {'(--basename)-b','(-b)--basename'}'[Match any component of the path]' \
+ {'(--orphans)-o','(-o)--orphans'}'[List orphan files]' \
+ {'(--exclude)-x','(-x)--exclude'}"[Don't look in package <arg> (used with --orphans)]:package:_gentoo_packages installed" \
+ {'(--exact)-e','(-e)--exact'}'[Exact match (used with --exclude)]' \
+ '*:filename:_files'
+ ;;
+ qgrep)
+ _arguments -s $common_args \
+ {'(--invert-match)-I','(-I)--invert-match'}'[Select non-matching lines]' \
+ {'(--ignore-case)-i','(-i)--ignore-case'}'[Ignore case distinctions]' \
+ {'(--with-filename)-H','(-H)--with-filename'}'[Print the filename for each match]' \
+ {'(--with-name)-N','(-N)--with-name'}'[Print the package or eclass name for each match]' \
+ {'(--count)-c','(-c)--count'}'[Only print a count of matching lines per FILE]' \
+ {'(--list)-l','(-l)--list'}'[Only print FILE names containing matches]' \
+ {'(--invert-list)-L','(-L)--invert-list'}'[Only print FILE names containing no match]' \
+ {'(--regexp)-e','(-e)--regexp'}'[Use PATTERN as a regular expression]' \
+ {'(--extended)-x','(-x)--extended'}'[Use PATTERN as an extended regular expression]' \
+ {'(--installed)-J','(-J)--installed'}'[Search in installed ebuilds instead of the tree]' \
+ {'(--eclass)-E','(-E)--eclass'}'[Search in eclasses instead of ebuilds]' \
+ {'(--skip-comments)-s','(-s)--skip-comments'}'[Skip comments lines]' \
+ {'(--skip)-S','(-S)--skip'}'[Skip lines matching <arg>]:pattern' \
+ {'(--before)-B','(-B)--before'}'[Print <arg> lines of leading context]:number' \
+ {'(--after)-A','(-A)--after'}'[Print <arg> lines of trailing context]:number' \
+ '*:pattern::'
+ ;;
+ qlist)
+ _arguments -s $common_args \
+ {'(--installed)-I','(-I)--installed'}'[Just show installed packages]' \
+ {'(--slots)-S','(-S)--slots'}'[Display installed packages with slots]' \
+ {'(--repo)-R','(-R)--repo'}'[Display installed packages with repository]' \
+ {'(--umap)-U','(-U)--umap'}'[Display installed packages with flags used]' \
+ {'(--columns)-c','(-c)--columns'}'[Display column view]' \
+ '--show-debug[Show /usr/lib/debug files]' \
+ {'(--exact)-e','(-e)--exact'}'[Exact match (only CAT/PN or PN without PV)]' \
+ {'(--all)-a','(-a)--all'}'[Show every installed package]' \
+ {'(--dir)-d','(-d)--dir'}'[Only show directories]' \
+ {'(--obj)-o','(-o)--obj'}'[Only show objects]' \
+ {'(--sym)-s','(-s)--sym'}'[Only show symlinks]' \
+ '*:packages:_gentoo_packages installed'
+ ;;
+ qlop)
+ _arguments -s $common_args \
+ {'(--gauge)-g','(-g)--gauge'}'[Gauge number of times a package has been merged]' \
+ {'(--time)-t','(-t)--time'}'[Calculate merge time for a specific package]' \
+ {'(--human)-H','(-H)--human'}'[Print seconds in human readable format (needs -t)]' \
+ {'(--list)-l','(-l)--list'}'[Show merge history]' \
+ {'(--unlist)-u','(-u)--unlist'}'[Show unmerge history]' \
+ {'(--sync)-s','(-s)--sync'}'[Show sync history]' \
+ {'(--current)-c','(-c)--current'}'[Show current emerging packages]' \
+ {'(--logfile)-f','(-f)--logfile'}'[Read emerge logfile instead of /var/log/emerge.log]:log:_files' \
+ '*:packages:_gentoo_packages available'
+ ;;
+ qsearch)
+ _arguments -s $common_args \
+ {'(--all)-a','(-a)--all'}'[List the descriptions of every package in the cache]' \
+ {'(--cache)-c','(-c)--cache'}'[Use the portage cache]' \
+ {'(--ebuilds)-e','(-e)--ebuilds'}'[Use the portage ebuild tree]' \
+ {'(--search)-s','(-s)--search'}'[Regex search package basenames]' \
+ {'(--desc)-S','(-S)--desc'}'[Regex search package descriptions]' \
+ {'(--name-only)-N','(-N)--name-only'}'[Only show package name]' \
+ {'(--homepage)-H','(-H)--homepage'}'[Show homepage info]' \
+ '*:pattern::'
+ ;;
+ qsize)
+ _arguments -s $common_args \
+ {'(--filesystem)-f','(-f)--filesystem'}'[Show size used on disk]' \
+ {'(--all)-a','(-a)--all'}'[Size all installed packages]' \
+ {'(--sum)-s','(-s)--sum'}'[Include a summary]' \
+ {'(--sum-only)-S','(-S)--sum-only'}'[Show just the summary]' \
+ {'(--megabytes)-m','(-m)--megabytes'}'[Display size in megabytes]' \
+ {'(--kilobytes)-k','(-k)--kilobytes'}'[Display size in kilobytes]' \
+ {'(--bytes)-b','(-b)--bytes'}'[Display size in bytes]' \
+ {'(--ignore)-i','(-i)--ignore'}'[Ignore regexp string]:pattern' \
+ '*:packages:_gentoo_packages installed'
+ ;;
+ quse)
+ _arguments -s $common_args \
+ {'(--exact)-e','(-e)--exact'}'[Show exact non regexp matching using strcmp]' \
+ {'(--all)-a','(-a)--all'}'[Show annoying things in IUSE]' \
+ {'(--keywords)-K','(-K)--keywords'}'[Use the KEYWORDS vs IUSE]' \
+ {'(--license)-L','(-L)--license'}'[Use the LICENSE vs IUSE]' \
+ {'(--describe)-D','(-D)--describe'}'[Describe the USE flag]' \
+ {'(--format)-F','(-F)--format'}'[Use your own variable formats: -F NAME=]:format' \
+ {'(--name-only)-N','(-N)--name-only'}'[Only show package name]' \
+ '*:use flag:_gentoo_packages useflag'
+ ;;
+ qtbz2)
+ _arguments -s $common_args \
+ {'(--dir)-d','(-d)--dir'}'[Change to specified directory]:directory:_files -/' \
+ {'(--join)-j','(-j)--join'}'[Join tar.bz2 + xpak into a tbz2]:*:tar.bz2 file and xpak file:_files -g \*.\(tar.bz2\|xpak\)' \
+ {'(--split)-s','(-s)--split'}'[Split a tbz2 into a tar.bz2 + xpak]:tbz2 file:_files -g \*.tbz2' \
+ {'(--tarbz2)-t','(-t)--tarbz2'}'[Just split the tar.bz2]:tbz2 file:_files -g \*.tbz2' \
+ {'(--xpak)-x','(-x)--xpak'}'[Just split the xpak]:tbz2 file:_files -g \*.tbz2' \
+ {'(--stdout)-O','(-O)--stdout'}'[Write files to stdout]'
+ ;;
+ qpkg)
+ _arguments -s $common_args \
+ {'(--clean)-c','(-c)--clean'}'[clean pkgdir of unused binary files]' \
+ {'(--eclean)-E','(-E)--eclean'}'[clean pkgdir of files not in the tree anymore (slow)]' \
+ {'(--pretend)-p','(-p)--pretend'}'[pretend only]' \
+ {'(--pkgdir)-P','(-P)--pkgdir'}'[alternate package directory]:alternate pkgdir:_files -/' \
+ '*:Installed packages:_gentoo_packages installed_versions'
+ ;;
+ qxpak)
+ _arguments -s $common_args \
+ {'(--list)-l','(-l)--list'}'[List the contents of an archive]:xpak archive:_files -g \*.xpak' \
+ {'(--extract)-x','(-x)--extract'}'[Extract the contents of an archive]:xpak archive:_files -g \*.xpak' \
+ {'(--create)-c','(-c)--create'}'[Create an archive of a directory/files]:*:archive name and files to archive:_files' \
+ {'(--dir)-d','(-d)--dir'}'[Change to specified directory]:directory:_files -/' \
+ {'(--stdout)-O','(-O)--stdout'}'[Write files to stdout]'
+ ;;
esac
+
+# vim: set et sw=2 sts=2 ts=2 ft=zsh:
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-12-18 16:59 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-12-18 16:59 UTC (permalink / raw
To: gentoo-commits
commit: 5b7a42efa2d1d6073fdc6cce2dda55f433aa60ef
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 18 16:59:12 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Thu Dec 18 16:59:12 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=5b7a42ef
_gentoo_packages: replace backtick usage with $()
---
src/_gentoo_packages | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/_gentoo_packages b/src/_gentoo_packages
index fd1dbcd..e96eac8 100644
--- a/src/_gentoo_packages
+++ b/src/_gentoo_packages
@@ -181,9 +181,9 @@ _gentoo_packages_update_active_useflag(){
local flags USE
var=USE
[[ -z ${(P)var} && -r /etc/portage/make.conf ]] &&
- local $var="`. /etc/portage/make.conf 2>/dev/null; echo ${(P)var}`"
+ local $var="$(. /etc/portage/make.conf 2>/dev/null; echo ${(P)var})"
[[ -z ${(P)var} && -r /etc/make.conf ]] &&
- local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`"
+ local $var="$(. /etc/make.conf 2>/dev/null; echo ${(P)var})"
flags=(${${${=USE}%-*}%\\*})
compadd $flags
}
@@ -270,11 +270,11 @@ _gentoo_packages_update_available_versions(){
#Function to show tbz2 files available
_gentoo_packages_update_binary() {
[[ -z $PKGDIR && -r /etc/portage/make.conf ]] &&
- local PKGDIR="`. /etc/portage/make.conf 2>/dev/null; echo $PKGDIR`"
+ local PKGDIR="$(. /etc/portage/make.conf 2>/dev/null; echo $PKGDIR)"
[[ -z $PKGDIR && -r /etc/make.conf ]] &&
- local PKGDIR="`. /etc/make.conf 2>/dev/null; echo $PKGDIR`"
+ local PKGDIR="$(. /etc/make.conf 2>/dev/null; echo $PKGDIR)"
[[ -z $PKGDIR && -r /usr/share/portage/config/make.globals ]] &&
- local PKGDIR="`. /usr/share/portage/config/make.globals 2>/dev/null; echo $PKGDIR`"
+ local PKGDIR="$(. /usr/share/portage/config/make.globals 2>/dev/null; echo $PKGDIR)"
# this doesn't take care of ${PORTAGE_BINHOST}. If Gentoo official
# binary mirror will be available we should rewrite it accordingly.
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-12-18 16:59 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-12-18 16:59 UTC (permalink / raw
To: gentoo-commits
commit: fd94031cf143872ebb67d33539ad742c4f176e4c
Author: Dimitrios Semitsoglou-Tsiapos <dsemitso <AT> cern <DOT> ch>
AuthorDate: Thu Nov 27 19:31:15 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Thu Nov 27 19:39:14 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=fd94031c
_gentoolkit: add missing equery command completions'
* Add --limit, --from and --to in `changes`.
* Add --format|-F in `hasuse`.
---
src/_gentoolkit | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/_gentoolkit b/src/_gentoolkit
index 25d679d..de7d287 100644
--- a/src/_gentoolkit
+++ b/src/_gentoolkit
@@ -108,6 +108,8 @@ _equery () {
'(-l --latest)'{-l,--latest}'[only display latest ChangeLog entry]' \
'(-f --full)'{-f,--full}'[display full ChangeLog entry]' \
'--limit[limit the number of entries displayed (with --full)]:number:' \
+ '--from[which version to display from]' \
+ '--to[which version to display to]' \
':portage:_packages available' && ret=0
;;
check|k)
@@ -150,6 +152,7 @@ _equery () {
hasuse|h)
_arguments \
$common_args \
+ '(-F --format)'{-F,--format}'[specify a custom output format]:format template' \
':useflag:_gentoo_packages useflag' && ret=0
;;
list|l)
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-12-01 7:48 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-12-01 7:48 UTC (permalink / raw
To: gentoo-commits
commit: 06acf6a6ee6e054e45a51481ad491cc51db6d306
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 1 07:47:55 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Mon Dec 1 07:48:40 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=06acf6a6
remove unnecessary whitespace
---
src/_genlop | 26 +++++++++++++-------------
src/_gentoo_packages | 8 ++++----
src/_gentoolkit | 7 +++----
src/_layman | 2 +-
src/_portage | 8 ++++----
5 files changed, 25 insertions(+), 26 deletions(-)
diff --git a/src/_genlop b/src/_genlop
index 322babb..6e817fd 100644
--- a/src/_genlop
+++ b/src/_genlop
@@ -2,7 +2,7 @@
#genlop 0.30.8
_genlop () {
-local prev1="$words[CURRENT-1]" prev2="$words[CURRENT-2]" days months arg single state lstate
+local prev1="$words[CURRENT-1]" prev2="$words[CURRENT-2]" days months arg single state lstate
days=(monday tuesday wednesday thursday friday saturday sunday)
months=(january february march april may june july august september october november december)
arg=( --current -c --time -t --gmt -g --info -i --file -f --rsync -r --unmerge -u --date --search -s --list -l )
@@ -12,14 +12,14 @@ single=( --current -c --pretend -p --help -h --version -v )
compadd in\ $months && return 0
[[ ${prev1} == ([2-9]|[1-9][0-9]*) && ${prev2} != \
(january|february|march|april|may|june|july|august|september|october|november|december) ]] &&
- _values '' 'days ago' 'months ago' 'years ago' 'weeks ago' && return 0
+ _values '' 'days ago' 'months ago' 'years ago' 'weeks ago' && return 0
[[ ${prev1} == (1) && ${prev2} != \
(january|february|march|april|may|june|july|august|september|october|november|december) ]] &&
- _values '' 'day ago' 'month ago' 'year ago' 'week ago' && return 0
+ _values '' 'day ago' 'month ago' 'year ago' 'week ago' && return 0
case "$prev1" in
last)
- _values '' month week
+ _values '' month week
compadd $days && return 0
;;
1st|2nd|3rd|4th|5th)
@@ -28,10 +28,10 @@ single=( --current -c --pretend -p --help -h --version -v )
january|february|march|april|may|june|july|august|september|october|november|december)
compadd {1..31} && return 0
;;
- --date)
+ --date)
_message 'enter number for more options or use mm/dd/yyyy format'
_values '' \
- last yesterday 1st 2nd 3rd 4th 5th
+ last yesterday 1st 2nd 3rd 4th 5th
_alternative \
'*:*:_days' '*:*:_months' && return 0
;;
@@ -57,27 +57,27 @@ single=( --current -c --pretend -p --help -h --version -v )
"($single)*:package:_gentoo_packages available"
;;
esac
-
+
while [[ -n "$state" ]]; do
lstate=$state
state=''
case "$lstate" in
date) _message 'enter number for more options or use mm/dd/yyyy format'
_values '' \
- last yesterday 1st 2nd 3rd 4th 5th
+ last yesterday 1st 2nd 3rd 4th 5th
_alternative \
':*:_days' ':*:_months' && return 0
;;
esac
- done
+ done
}
_days() {
- local m="monday" t="tuesday" w="wednesday" T="thursday" f="friday" s="saturday" S="sunday"
+ local m="monday" t="tuesday" w="wednesday" T="thursday" f="friday" s="saturday" S="sunday"
local day=$(date +%u)
if [[ ${day} == 1 ]] then compadd $m
elif [[ ${day} == 2 ]] then compadd $m $t
- elif [[ ${day} == 3 ]] then compadd $m $t $w
+ elif [[ ${day} == 3 ]] then compadd $m $t $w
elif [[ ${day} == 4 ]] then compadd $m $t $w $T
elif [[ ${day} == 5 ]] then compadd $m $t $w $T $f
elif [[ ${day} == 6 ]] then compadd $m $t $w $T $f $s
@@ -89,9 +89,9 @@ _months() {
local month=$(date +%m)
if [[ ${month} == 01 ]] then compadd $j
elif [[ ${month} == 02 ]] then compadd $j $f
- elif [[ ${month} == 03 ]] then compadd $j $f $m
+ elif [[ ${month} == 03 ]] then compadd $j $f $m
elif [[ ${month} == 04 ]] then compadd $j $f $m $a
- elif [[ ${month} == 05 ]] then compadd $j $f $m $a $M
+ elif [[ ${month} == 05 ]] then compadd $j $f $m $a $M
elif [[ ${month} == 06 ]] then compadd $j $f $m $a $M $ju
elif [[ ${month} == 07 ]] then compadd $j $f $m $a $M $ju $J
elif [[ ${month} == 08 ]] then compadd $j $f $m $a $M $ju $J $A
diff --git a/src/_gentoo_packages b/src/_gentoo_packages
index 2bfa8c4..da770b2 100644
--- a/src/_gentoo_packages
+++ b/src/_gentoo_packages
@@ -224,7 +224,7 @@ _gentoo_packages_update_available_pkgnames_only(){
trees=($(_portdir) $(_portdir -o))
packages=($trees/*-*/*(:t))
- _wanted packages expl 'package' compadd - "${(@)packages}"
+ _wanted packages expl 'package' compadd - "${(@)packages}"
}
_gentoo_packages_update_available(){
@@ -234,7 +234,7 @@ _gentoo_packages_update_available(){
category=($trees/*-*(/:t))
packages=($trees/*-*/*(:t))
- _wanted packages expl 'package' compadd - "${(@)packages}"
+ _wanted packages expl 'package' compadd - "${(@)packages}"
# Complete cat/pkg. _multi_parts is much to slow for such a large task,
# _sep_parts removes the dash from gnome-<tab>, and _path_files wants to
@@ -259,7 +259,7 @@ _gentoo_packages_update_available_versions(){
category=($trees/*-*(/:t))
typeset -U category
- if [[ $#PREFIX -ge 1 && -z $words[(r)(--inject|-i)] ]] ; then
+ if [[ $#PREFIX -ge 1 && -z $words[(r)(--inject|-i)] ]] ; then
overlay_ebuilds=($=PORTDIR_OVERLAY/*-*/${PREFIX%%-[0-9]#*}*/*.ebuild(:t:r) )
portage_ebuilds=($PORTDIR/metadata/cache/*-*/${PREFIX%%-[0-9]#*}*(:t))
_wanted packages expl 'package' compadd $portage_ebuilds $overlay_ebuilds
@@ -292,7 +292,7 @@ _gentoo_packages () {
_message "unknown command: $command"
return
}
- [[ "$pkgset" == (installed(_versions|_sets|)|available(_versions|_sets|_pkgnames_only|)|binary|category|(active_|)useflag) ]] || {
+ [[ "$pkgset" == (installed(_versions|_sets|)|available(_versions|_sets|_pkgnames_only|)|binary|category|(active_|)useflag) ]] || {
pkgset="$command"
}
expl=("${(@)argv[1,-2]}")
diff --git a/src/_gentoolkit b/src/_gentoolkit
index 25d679d..7e50dc4 100644
--- a/src/_gentoolkit
+++ b/src/_gentoolkit
@@ -14,7 +14,7 @@
# XXX: shouldn't this go to _gentoo_package?
_packages () {
- if compset -P '(\\|)(>=|<=|<|>|=)' ; then
+ if compset -P '(\\|)(>=|<=|<|>|=)' ; then
_gentoo_packages ${*/(#m)(installed|available)/${MATCH}_versions}
else
_gentoo_packages $*
@@ -41,7 +41,7 @@ _euse () {
{'(--local)-l','(-l)--local'}'[show only local use flags]'
)
if (( CURRENT == 2 ));then
- _arguments -s $start_args
+ _arguments -s $start_args
elif (( CURRENT == 3 ));then
case "$words[2]" in
-i|--info|-a|--active)
@@ -265,7 +265,7 @@ _eclean_wrapper () {
#_values "packages options" $pkg_opts &&
return 0
elif (( $words[(I)(distfiles)] )); then
- _values "distfiles options" $dist_opts &&
+ _values "distfiles options" $dist_opts &&
return 0
else
_arguments -s $global_opts
@@ -404,4 +404,3 @@ case "$service" in
_revdep-rebuild "$@" && return 0
;;
esac
-
diff --git a/src/_layman b/src/_layman
index 52e775f..01c1333 100644
--- a/src/_layman
+++ b/src/_layman
@@ -2,7 +2,7 @@
# layman-1.1.1
#
-local arguments actions_args actions global_opts add_actions
+local arguments actions_args actions global_opts add_actions
_layman_remote_overlays() {
local layman_list_overlays
layman_list_overlays=(${(S)${${(f)"$(layman -k -N -L 2>/dev/null)"}//\[*}#\* })
diff --git a/src/_portage b/src/_portage
index e530151..aef3487 100644
--- a/src/_portage
+++ b/src/_portage
@@ -16,7 +16,7 @@
# Stuff for ebuild
_ebuild () {
if (( CURRENT == 2 ));then
- _files -g \*.ebuild
+ _files -g \*.ebuild
elif (( CURRENT > 2 ));then
_values "ebuild command" \
'clean[Cleans the temporary build directory]' \
@@ -36,7 +36,7 @@ _ebuild () {
'postrm[Run specific actions that need to be executed after unmerge]' \
'config[Run specific actions needed to be executed after the emerge process has completed.]' \
'package[This command is a lot like the merge command, but create a .tbz2 package]' \
- 'manifest[Updates the manifest file for the package.]' \
+ 'manifest[Updates the manifest file for the package.]' \
'rpm[Builds a RedHat RPM package]'
fi
@@ -77,7 +77,7 @@ _emerge () {
-u --update -U --upgradeonly --config)
common_args=(
- "($noask_opts --sync)"{-p,--pretend}"[Simply display what would be done]"
+ "($noask_opts --sync)"{-p,--pretend}"[Simply display what would be done]"
"($noask_opts)"{-a,--ask}"[Ask what would be done]"
'(-d --debug --help -h --version -V)'{-d,--debug}'[Tells emerge to run the emerge command in debug mode]'
'(--quiet -q --verbose -v)'{-q,--quiet}'[General outcome is a reduced or condensed output]'
@@ -202,7 +202,7 @@ _emerge () {
&& return 0
fi
- elif (( $words[(I)(world|system)] )) ; then
+ elif (( $words[(I)(world|system)] )) ; then
_arguments -s \
"$common_args[@]" "$install_args[@]" \
"($nopkg_opts[1,-2] --inject -i --oneshot -1):" && return 0
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-12-01 7:48 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-12-01 7:48 UTC (permalink / raw
To: gentoo-commits
commit: bde2bd3191812eddac0fab246d85bbb3e75e2a2c
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 1 07:39:35 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Mon Dec 1 07:48:36 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=bde2bd31
_gentoo_packages: more stylistic consistency
Generally we keep lvalues and rvalues in consistent positions in
conditional checks even though they can be swapped around there.
---
src/_gentoo_packages | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/_gentoo_packages b/src/_gentoo_packages
index a8a3aff..2bfa8c4 100644
--- a/src/_gentoo_packages
+++ b/src/_gentoo_packages
@@ -11,7 +11,7 @@ _portdir() {
local mainreponame mainrepopath overlayname overlaypath
if [[ -e /usr/share/portage/config/repos.conf ]]; then
- if [[ ${1} == -o ]]; then
+ if [[ ${1} == "-o" ]]; then
for overlayname in $(_parsereposconf -l); do
overlaypath+=($(_parsereposconf ${overlayname} location))
done
@@ -33,7 +33,7 @@ _portdir() {
source /etc/make.conf 2>/dev/null
source /etc/portage/make.conf 2>/dev/null
- if [[ "-o" == ${1} ]]; then
+ if [[ ${1} == "-o" ]]; then
echo "${(@u)PORTDIR_OVERLAY}"
else
echo "${PORTDIR}"
@@ -76,7 +76,7 @@ _parsereposconf() {
done < ${f}
done
- if [[ "-l" == ${1} ]]; then
+ if [[ ${1} == "-l" ]]; then
echo "${(@)secname}"
else
echo "${v}"
@@ -110,13 +110,13 @@ _parsesetsconf() {
arr[${name}]=${value}
if [[ ${insection} == 1 && ${name} == "section" ]]; then
- [[ "sets" == ${2} ]] && [[ ! ${value} =~ "sets" ]] && sections+=(${value})
+ [[ ${2} == "sets" ]] && [[ ! ${value} =~ "sets" ]] && sections+=(${value})
insection=0
elif [[ ${name} == "section" ]]; then
[[ ${value} =~ "${1:t} sets" ]] && insection=1
- [[ "sets" == ${2} ]] && [[ ! ${value} =~ "sets" ]] && sections+=(${value})
+ [[ ${2} == "sets" ]] && [[ ! ${value} =~ "sets" ]] && sections+=(${value})
elif [[ ${insection} == 1 ]]; then
- [[ "sets" == ${2} ]] && continue
+ [[ ${2} == "sets" ]] && continue
if [[ ${name} == "directory" ]]; then
v=${value}
fi
@@ -126,7 +126,7 @@ _parsesetsconf() {
fi
done
- if [[ "sets" == ${2} ]]; then
+ if [[ ${2} == "sets" ]]; then
[[ ((${#sections} > 0)) ]] && echo ${(@)sections}
else
[[ ((${#v} > 0)) ]] && echo ${v:t}
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-12-01 7:34 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-12-01 7:34 UTC (permalink / raw
To: gentoo-commits
commit: 1dc4fb5541cb73c1f203290a69d0d1150a01d285
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 1 07:31:53 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Mon Dec 1 07:33:42 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=1dc4fb55
_gentoo_packages: remove unnecessary semicolons
We should try to remain consistent in stylistic coding patterns.
---
src/_gentoo_packages | 50 +++++++++++++++++++++++++-------------------------
1 file changed, 25 insertions(+), 25 deletions(-)
diff --git a/src/_gentoo_packages b/src/_gentoo_packages
index 9a747b7..a8a3aff 100644
--- a/src/_gentoo_packages
+++ b/src/_gentoo_packages
@@ -42,25 +42,25 @@ _portdir() {
}
_parsereposconf() {
- local v f insection section arr;
+ local v f insection section arr
for f in /usr/share/portage/config/repos.conf \
/etc/portage/repos.conf \
/etc/portage/repos.conf/*.conf; do
[[ -f ${f} ]] || continue
- insection=0;
- declare -A arr;
- IFS='= ';
+ insection=0
+ declare -A arr
+ IFS='= '
while read -r name value; do
[[ -z ${name} || ${name} == '#'* ]] && continue
if [[ (${name} == '['*']') && (-z ${value}) ]]; then
- value=${name//(\]|\[)};
- name="section";
- fi;
- arr[${name}]=${value};
+ value=${name//(\]|\[)}
+ name="section"
+ fi
+ arr[${name}]=${value}
if [[ ${insection} == 1 && ${name} == "section" ]]; then
break
@@ -69,7 +69,7 @@ _parsereposconf() {
secname+=(${value})
elif [[ ${insection} == 1 ]]; then
if [[ ${name} == ${2} ]]; then
- v=${value};
+ v=${value}
fi
fi
continue
@@ -86,10 +86,10 @@ _parsereposconf() {
_parsesetsconf() {
[[ -d ${1} ]] || continue
- local v f places sections setsconf insection section arr;
+ local v f places sections setsconf insection section arr
if [[ -d ${1}/sets ]]; then
- setsconf=(${1}/sets/*.conf(N));
+ setsconf=(${1}/sets/*.conf(N))
[[ (($#setsconf > 0)) ]] && places=(${setsconf})
elif [[ -f ${1}/sets.conf ]]; then
places=(${1}/sets.conf)
@@ -97,28 +97,28 @@ _parsesetsconf() {
for f in ${(@)places}; do
if [[ -r ${f} ]]; then
- insection=0;
- declare -A arr;
- IFS='= ';
+ insection=0
+ declare -A arr
+ IFS='= '
while read -r name value; do
[[ -z ${name} || ${name} == '#'* ]] && continue
if [[ (${name} == '['*']') && (-z ${value}) ]]; then
- value=${name//(\]|\[)};
- name="section";
- fi;
- arr[${name}]=${value};
+ value=${name//(\]|\[)}
+ name="section"
+ fi
+ arr[${name}]=${value}
if [[ ${insection} == 1 && ${name} == "section" ]]; then
[[ "sets" == ${2} ]] && [[ ! ${value} =~ "sets" ]] && sections+=(${value})
- insection=0;
+ insection=0
elif [[ ${name} == "section" ]]; then
[[ ${value} =~ "${1:t} sets" ]] && insection=1
[[ "sets" == ${2} ]] && [[ ! ${value} =~ "sets" ]] && sections+=(${value})
elif [[ ${insection} == 1 ]]; then
[[ "sets" == ${2} ]] && continue
if [[ ${name} == "directory" ]]; then
- v=${value};
+ v=${value}
fi
fi
continue
@@ -129,13 +129,13 @@ _parsesetsconf() {
if [[ "sets" == ${2} ]]; then
[[ ((${#sections} > 0)) ]] && echo ${(@)sections}
else
- [[ ((${#v} > 0)) ]] && echo ${v:t};
+ [[ ((${#v} > 0)) ]] && echo ${v:t}
fi
}
_gentoo_packages_update_installed_sets() {
- local sets;
- sets=($(</var/lib/portage/world_sets));
+ local sets
+ sets=($(</var/lib/portage/world_sets))
if [[ ((${#sets} > 0)) ]]; then
_wanted installed_sets expl 'installed set' compadd "$@" "${(o@)^sets}"
fi
@@ -151,7 +151,7 @@ _gentoo_packages_update_available_sets() {
setsfiles=(${setspath}/*~*.conf(N))
for set in ${setsfiles[@]}; do
sets+=(${set}(:t))
- done;
+ done
sets+=($(_parsesetsconf ${PORTDIR} sets))
fi
fi
@@ -253,7 +253,7 @@ _gentoo_packages_update_available_versions(){
local var overlay_ebuilds portage_ebuilds expl trees category
PORTDIR=$(_portdir)
- PORTDIR_OVERLAY=$(_portdir -o);
+ PORTDIR_OVERLAY=$(_portdir -o)
trees=($PORTDIR $=PORTDIR_OVERLAY)
category=($trees/*-*(/:t))
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-12-01 7:34 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-12-01 7:34 UTC (permalink / raw
To: gentoo-commits
commit: 2b6c19533a92911f4b006ff55326b24ff543a114
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 1 00:47:07 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Mon Dec 1 07:33:39 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=2b6c1953
_portage_utils: sync portdir/reposconf changes from _gentoo_packages
This should probably be maintained only in one place so this isn't
necessary in the future.
---
src/_portage_utils | 61 ++++++++++++++++++++++++++----------------------------
1 file changed, 29 insertions(+), 32 deletions(-)
diff --git a/src/_portage_utils b/src/_portage_utils
index dbb45d6..4638258 100644
--- a/src/_portage_utils
+++ b/src/_portage_utils
@@ -7,7 +7,7 @@ _portdir() {
local mainreponame mainrepopath overlayname overlaypath
if [[ -e /usr/share/portage/config/repos.conf ]]; then
- if [[ ${1} == -o ]]; then
+ if [[ ${1} == "-o" ]]; then
for overlayname in $(_parsereposconf -l); do
overlaypath+=($(_parsereposconf ${overlayname} location))
done
@@ -15,12 +15,9 @@ _portdir() {
source /etc/make.conf 2>/dev/null
source /etc/portage/make.conf 2>/dev/null
- overlaypath+=(${PORTDIR_OVERLAY})
+ overlaypath+=(${(@)PORTDIR_OVERLAY})
- # strip out duplicates
- overlaypath=($(printf "%s\n" "${overlaypath[@]}" | sort -u))
-
- echo "${overlaypath[@]}"
+ echo "${(@u)overlaypath}"
else
mainreponame=$(_parsereposconf DEFAULT main-repo)
mainrepopath=$(_parsereposconf ${mainreponame} location)
@@ -32,16 +29,16 @@ _portdir() {
source /etc/make.conf 2>/dev/null
source /etc/portage/make.conf 2>/dev/null
- echo "${PORTDIR}"
-
- if [[ ${1} == -o ]]; then⋅
- echo "${PORTDIR_OVERLAY}"
- fi⋅⋅⋅
+ if [[ ${1} == "-o" ]]; then
+ echo "${(@u)PORTDIR_OVERLAY}"
+ else
+ echo "${PORTDIR}"
+ fi
fi
}
_parsereposconf() {
- local f insection line section v value var
+ local v f insection section arr
for f in /usr/share/portage/config/repos.conf \
/etc/portage/repos.conf \
@@ -49,34 +46,34 @@ _parsereposconf() {
[[ -f ${f} ]] || continue
insection=0
+ declare -A arr
+ IFS='= '
+
+ while read -r name value; do
+ [[ -z ${name} || ${name} == '#'* ]] && continue
- while read -r line; do
- # skip comments and blank lines
- [[ -z ${line} || ${line} == '#'* ]] && continue
+ if [[ (${name} == '['*']') && (-z ${value}) ]]; then
+ value=${name//(\]|\[)}
+ name="section"
+ fi
+ arr[${name}]=${value}
- if [[ ${insection} == 1 && ${line} == '['*']' ]]; then
- # End of the section we were interested in so stop
- secname+=(${line//[(\[|\])]/}) # record name for -l
+ if [[ ${insection} == 1 && ${name} == "section" ]]; then
break
- elif [[ ${line} == '['*']' ]]; then
- # Entering a new section, check if it's the one we want
- section=${line//[(\[|\])]/}
- [[ ${section} == "${1}" ]] && insection=1
- secname+=(${section}) # record name for -l
+ elif [[ ${name} == "section" ]]; then
+ [[ ${value} == ${1} ]] && insection=1
+ secname+=(${value})
elif [[ ${insection} == 1 ]]; then
- # We're in the section we want, grab the values
- var=${line%%=*}
- var=${var// /}
- value=${line#*=}
- value=${value# }
- [[ ${var} == ${2} ]] && v=${value}
+ if [[ ${name} == ${2} ]]; then
+ v=${value}
+ fi
fi
continue
- done < "${f}"
+ done < ${f}
done
- if [[ ${1} == -l ]]; then
- echo "${secname[@]}"
+ if [[ ${1} == "-l" ]]; then
+ echo "${(@)secname}"
else
echo "${v}"
fi
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-11-27 7:23 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-11-27 7:23 UTC (permalink / raw
To: gentoo-commits
commit: 9eee6ffef4e01324e975ced9e124634d0ce2c7e9
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 27 07:21:26 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Thu Nov 27 07:21:26 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=9eee6ffe
_portage: allow --depclean to take installed pkg arguments
---
src/_portage | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/_portage b/src/_portage
index 784a8e8..98410d3 100644
--- a/src/_portage
+++ b/src/_portage
@@ -167,7 +167,7 @@ _emerge () {
"($bopts)"{-k,--usepkg}"[Tells emerge to use binary packages if available]"
"($bopts --changelog -l)"{-K,--usepkgonly}"[Tells emerge to use binary packages only]"
"($all)--clean[Cleans the system by removing packages]"
- "(: $all)"{-c,--depclean}"[Clean all packages that have no reason for being installed (see man!!!)]"
+ "($all)"{-c,--depclean}"[Clean selected packages/all packages that have no reason for being installed (see man!!!)]"
"(: $all $noask_opts --nospinner --quiet -q)--info[This is a list of information to include in bug reports]"
"(: -)--metadata[Generate metadata]"
"($nopkg_opts --usepkgonly -K)--newuse[Include installed packages which have changed USE flags]"
@@ -189,7 +189,7 @@ _emerge () {
# Dispatch
- if (( $words[(I)(--(unmerge|clean|prune|deselect)|-[[:alpha:]]#(C|c|P)[[:alpha:]]#)] )) ; then
+ if (( $words[(I)(--(unmerge|(dep|)clean|prune|deselect)|-[[:alpha:]]#(C|c|P)[[:alpha:]]#)] )) ; then
if compset -P '(\\|)(>=|<=|<|>|=)'; then
_arguments -s \
'*:installed package:_gentoo_packages installed_versions' && return 0
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-11-27 7:23 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-11-27 7:23 UTC (permalink / raw
To: gentoo-commits
commit: 3de941a658e5f426bec15a2a1a316c8dfab50161
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 27 07:22:20 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Thu Nov 27 07:22:20 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=3de941a6
_portage: add --keep-going as an install time argument
---
src/_portage | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/_portage b/src/_portage
index 98410d3..e530151 100644
--- a/src/_portage
+++ b/src/_portage
@@ -181,6 +181,7 @@ _emerge () {
'(: -)'{-V,--version}'[Display version info]'
"(: $all[3,-1])--resume[Resumes the last merge operation]"
"(: $all[3,-1])--skipfirst[Removes the first package in the resume list]"
+ "($all)--keep-going[Continue merge even if a package fails to build]"
)
profiles=(
'world[All packages in the world profile]'
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-11-27 6:39 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-11-27 6:39 UTC (permalink / raw
To: gentoo-commits
commit: 3f65f6decf38e844f98839ac5a54d1705afe1338
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 27 06:28:28 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Thu Nov 27 06:38:32 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=3f65f6de
_gentoolkit: update various equery command completions (bug #518512)
Also sort the commands to put them in alphabetical order that matches
the equery output.
---
src/_gentoolkit | 84 ++++++++++++++++++++++++++++++++++++---------------------
1 file changed, 53 insertions(+), 31 deletions(-)
diff --git a/src/_gentoolkit b/src/_gentoolkit
index 6283f1b..25d679d 100644
--- a/src/_gentoolkit
+++ b/src/_gentoolkit
@@ -76,9 +76,8 @@ _equery () {
)
common_args=(
- '(-i --installed -I --exclude-installed)'{-i,--installed}'[search installed packages]'
- '(-I --exclude-installed -i --installed)'{-I,--exclude-installed}'[do not search installed packages]'
- '(-p --portage)'{-p,--portage-tree}'[also search in portage tree]'
+ '(-I --exclude-installed)'{-I,--exclude-installed}'[do not search installed packages]'
+ '(-p --portage-tree)'{-p,--portage-tree}'[also search in portage tree]'
'(-o --overlay-tree)'{-o,--overlay-tree}'[also search in overlay tree]'
)
@@ -99,41 +98,76 @@ _equery () {
case "$cmd" in
belongs|b)
_arguments \
- '(-c --category)'{-c,--category}'[only search in specified category]:category:_gentoo_packages category' \
- '(-e --earlyout)'{-e,--earlyout}'[stop when first match found]' \
- '(-f --full-regex)'{-f,--full-regex}'[supplied query is a full regex]:pattern:' \
+ '(-e --early-out)'{-e,--early-out}'[stop when first match found]' \
+ '(-f --full-regex)'{-f,--full-regex}'[supplied query is a regex]:pattern:' \
+ '(-n --name-only)'{-n,--name-only}"[don't print the version]" \
'*:file:_files' && ret=0
;;
+ changes|c)
+ _arguments \
+ '(-l --latest)'{-l,--latest}'[only display latest ChangeLog entry]' \
+ '(-f --full)'{-f,--full}'[display full ChangeLog entry]' \
+ '--limit[limit the number of entries displayed (with --full)]:number:' \
+ ':portage:_packages available' && ret=0
+ ;;
check|k)
_arguments \
+ '(-f --full-regex)'{-f,--full-regex}'[supplied query is a regex]:pattern:' \
+ '(-o --only-failures)'{-o,--only-failures}'[only display packages that do not pass]' \
':portage:_packages installed' && ret=0
;;
depends|d)
_arguments \
'(-a --all-packages)'{-a,--all-packages}'[search in all available packages (slow)]:all packages:->packages' \
- '(-d --direct -D --indirect)'{-d,--direct}'[search direct dependencies only (default)]' \
- '(-d --direct -D --indirect)'{-D,--indirect}'[search indirect dependencies (VERY slow)]' \
+ '(-D --indirect)'{-D,--indirect}'[search indirect dependencies (VERY slow)]' \
+ '--depth[limit indirect dependency tree to specified depth]:number:' \
'*:package:_packages installed' && ret=0
;;
depgraph|g)
_arguments \
+ '(-A --no-atom)'{-A,--no-atom}'[do not show dependency atom]' \
+ '(-M --no-mask)'{-M,--no-mask}'[do not show masking status]' \
'(-U --no-useflags)'{-U,--no-useflags}'[do not show USE flags]' \
'(-l --linear)'{-l,--linear}'[do not use fancy formatting]' \
':package:_packages installed' && ret=0
;;
files|f)
_arguments \
- '--timestamp[append timestamp]' \
- '--md5sum[append md5sum]' \
- '--type[prepend file type]' \
+ '(-m --md5sum)'{-m,--md5sum}'[include MD5 sum in output]' \
+ '(-s --timestamp)'{-s,--timestamp}'[include timestamp in output]' \
+ '(-t --type)'{-t,--type}'[include file type in output]' \
+ '--tree[display results in a tree (turns off other options)]' \
'--filter=[filter output]:filter(s):_values -s , '' dir obj sym dev fifo path conf cmd doc man info' \
':installed pkgname:_packages installed' && ret=0
;;
+ has|a)
+ _arguments \
+ $common_args \
+ '(-F --format)'{-F,--format}'[a format template (see man page)]:format template' \
+ ':KEY:' \
+ ':VALUE:' && ret=0
+ ;;
+ hasuse|h)
+ _arguments \
+ $common_args \
+ ':useflag:_gentoo_packages useflag' && ret=0
+ ;;
+ list|l)
+ _arguments \
+ $common_args \
+ '(-d --duplicates)'{-d,--duplicates}'[list only installed duplicate packages]' \
+ '(-b --binpkgs-missing)'{-b,--binpkgs-missing}'[list only installed packages without a corresponding binary package]' \
+ '(-f --full-regex)'{-f,--full-regex}'[supplied query is a regex]:pattern:' \
+ '(-m --mask-reason)'{-m,--mask-reason}'[include reason for package mask]' \
+ '(-F --format)'{-F,--format}'[a format template (see man page)]:format template' \
+ ': :_guard "^--*" pattern' && ret=0
+ ;;
meta|m)
_arguments \
'(-d --description)'{-d,--description}'[show an extended package description]' \
'(-H --herd)'{-H,--herd}'[show the herd(s) for the package]' \
'(-k --keywords)'{-k,--keywords}'[show keywords for all matching package versions]' \
+ '(-l --license)'{-l,--license}'[show licenses for the best maching version]' \
'(-m --maintainer)'{-m,--maintainer}'[show the maintainer(s) for the package]' \
'(-S --stablreq)'{-S,--stablreq}'[show STABLEREQ arches (ccs) for all matching package versions]' \
'(-u --useflags)'{-u,--useflags}'[show per-package USE flag descriptions]' \
@@ -141,37 +175,25 @@ _equery () {
'(-x --xml)'{-x,--xml}'[show the plain metadata.xml file]' \
':package:_packages available' && ret=0
;;
- hasuse|h)
- _arguments \
- $common_args \
- ':useflag:_gentoo_packages useflag' && ret=0
- ;;
- list|l)
- _arguments \
- $common_args \
- ': :_guard "^--*" pattern' && ret=0
- ;;
- size|s)
+ size|s)
_arguments \
'(-b --bytes)'{-b,--bytes}'[report size in bytes]' \
+ '(-f --full-regex)'{-f,--full-regex}'[supplied query is a regex]:pattern:' \
':package:_packages installed' && ret=0
;;
- which|w)
- _arguments \
- ':portage:_packages available' && ret=0
- ;;
uses|u)
_arguments \
- {--all,-a}'[include non-installed packages]' \
+ '(-a --all)'{-a,--all}'[include non-installed packages]' \
+ '(-i --ignore-linguas)'{-i,--ignore-linguas}"[don't show linguas USE flags]" \
":portage:_packages installed" && ret=0
;;
- changes|c)
+ which|w)
_arguments \
- '(-l --latest)'{-l,--latest}'[only display latest ChangeLog entry]' \
- '(-f --full)'{-f,--full}'[display full ChangeLog entry]' \
+ '(-m --include-masked)'{-m,--include-masked}'[return highest version ebuild available]' \
+ '(-e --ebuild)'{-e,--ebuild}'[print the ebuild]' \
':portage:_packages available' && ret=0
;;
- *)
+ *)
_message 'command not found'
;;
esac
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-11-24 9:13 Vadim A. Misbakh-Soloviov
0 siblings, 0 replies; 52+ messages in thread
From: Vadim A. Misbakh-Soloviov @ 2014-11-24 9:13 UTC (permalink / raw
To: gentoo-commits
commit: d7bafc68f5144475023d6890f0fcc0217248a25b
Author: Vadim A. Misbakh-Soloviov <mva <AT> mva <DOT> name>
AuthorDate: Mon Nov 24 09:13:48 2014 +0000
Commit: Vadim A. Misbakh-Soloviov <mva <AT> mva <DOT> name>
CommitDate: Mon Nov 24 09:13:48 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=d7bafc68
_portage: fixed jobs completion (proper syntax after removing short option). Fixes #1.
Signed-off-by: Vadim A. Misbakh-Soloviov <mva <AT> mva.name>
---
src/_portage | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/_portage b/src/_portage
index d8c3338..784a8e8 100644
--- a/src/_portage
+++ b/src/_portage
@@ -92,7 +92,7 @@ _emerge () {
"($noask_opts)"{-A,--alert}"[Add a terminal bell to all interactive prompts]"
"--ignore-default-opts[Ignore EMERGE_DEFAULT_OPTS]"
"--moo[Have you mooed today?]"
- "(--jobs)"{--jobs=}"[Number of packages to build simultaneously]:jobs:({1.."${#${$(</proc/cpuinfo)/^processor}}"})"
+ "(--jobs)--jobs[Number of packages to build simultaneously]:jobs:({1.."${#${$(</proc/cpuinfo)/^processor}}"})"
)
install_args=(
"--deselect[Remove atom from world file]"
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-11-24 7:33 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-11-24 7:33 UTC (permalink / raw
To: gentoo-commits
commit: c39e97ef5dd136baf04259b291ab7c7bdcd2767d
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 24 07:24:27 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Mon Nov 24 07:25:07 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=c39e97ef
_gentoolkit: fix description for euse --prune
---
src/_gentoolkit | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/_gentoolkit b/src/_gentoolkit
index ef3db9a..7b04494 100644
--- a/src/_gentoolkit
+++ b/src/_gentoolkit
@@ -31,7 +31,7 @@ _euse () {
{'(--active)-a','(-a)--active'}'[show currently active useflags and their origin]'
{'(--enable)-E','(-E)--enable'}'[enable the given useflags]'
{'(--disable)-D','(-D)--disable'}'[disable the given useflags]'
- {'(--prune)-P','(-P)--prune'}'[show version]'
+ {'(--prune)-P','(-P)--prune'}'[alias for --remove]'
)
suboptions_args=(
{'(--global)-g','(-g)--global'}'[show only global use flags]'
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-11-24 7:33 Tim Harder
0 siblings, 0 replies; 52+ messages in thread
From: Tim Harder @ 2014-11-24 7:33 UTC (permalink / raw
To: gentoo-commits
commit: b8b841f98e71f64a4fbf3a71008e2fb16eb26ac9
Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 24 07:30:11 2014 +0000
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Mon Nov 24 07:30:11 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=b8b841f9
_gentoolkit: update euse option support
Add support for --info-installed, --remove, and --package.
---
src/_gentoolkit | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/_gentoolkit b/src/_gentoolkit
index 7b04494..6283f1b 100644
--- a/src/_gentoolkit
+++ b/src/_gentoolkit
@@ -28,10 +28,13 @@ _euse () {
{'(--help)-h','(-h)--help'}'[show help]'
{'(--version)-v','(-v)--version'}'[show version]'
{'(--info)-i','(-i)--info'}'[show descriptions for the given useflags]'
+ {'(--info-installed)-I','(-I)--info-installed'}'[show descriptions for the given useflags and their current impact on the installed system]'
{'(--active)-a','(-a)--active'}'[show currently active useflags and their origin]'
{'(--enable)-E','(-E)--enable'}'[enable the given useflags]'
{'(--disable)-D','(-D)--disable'}'[disable the given useflags]'
+ {'(--remove)-R','(-R)--remove'}'[remove all references to the given flags from make.conf and package.use to revert to default settings]'
{'(--prune)-P','(-P)--prune'}'[alias for --remove]'
+ {'(--package)-p','(-p)--package'}'[used with -E, -D, and -R to apply to a specific package only]'
)
suboptions_args=(
{'(--global)-g','(-g)--global'}'[show only global use flags]'
^ permalink raw reply related [flat|nested] 52+ messages in thread
* [gentoo-commits] proj/zsh-completion:master commit in: src/
@ 2014-11-23 21:35 Vadim A. Misbakh-Soloviov
0 siblings, 0 replies; 52+ messages in thread
From: Vadim A. Misbakh-Soloviov @ 2014-11-23 21:35 UTC (permalink / raw
To: gentoo-commits
commit: 331110ff4672c47664a2388b5d87f783d4ee727a
Author: Vadim A. Misbakh-Soloviov <mva <AT> mva <DOT> name>
AuthorDate: Sun Nov 23 21:35:13 2014 +0000
Commit: Vadim A. Misbakh-Soloviov <mva <AT> mva <DOT> name>
CommitDate: Sun Nov 23 21:35:13 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=331110ff
Removed unnecessarily toggles from options, that doesn't require it. Also kinda fixes jobs completion
Signed-off-by: Vadim A. Misbakh-Soloviov <mva <AT> mva.name>
---
src/_portage | 56 ++++++++++++++++++++++++++++----------------------------
1 file changed, 28 insertions(+), 28 deletions(-)
diff --git a/src/_portage b/src/_portage
index 57fc0a5..d8c3338 100644
--- a/src/_portage
+++ b/src/_portage
@@ -89,59 +89,59 @@ _emerge () {
"--color=[Color output]:yes/no:((y\:'yes' n\:'no'))"
"--accept-properties=[Temporarily override the ACCEPT_PROPERTIES variable]"
"--accept-restrict=[Temporarily override the ACCEPT_RESTRICT variable]"
- "($noask_opts)"{-A,--alert=}"[Add a terminal bell to all interactive prompts]:yes/no:((y\:'yes' n\:'no'))"
+ "($noask_opts)"{-A,--alert}"[Add a terminal bell to all interactive prompts]"
"--ignore-default-opts[Ignore EMERGE_DEFAULT_OPTS]"
"--moo[Have you mooed today?]"
+ "(--jobs)"{--jobs=}"[Number of packages to build simultaneously]:jobs:({1.."${#${$(</proc/cpuinfo)/^processor}}"})"
)
install_args=(
- '--deselect=[Remove atom from world file]:yes/no:((y\:'yes' n\:'no'))'
+ "--deselect[Remove atom from world file]"
"--alphabetical[Sort use/other flags output alphabetically despite of status]"
"--ask-enter-invalid[When with --ask, interpret a single 'Enter' key press as invalid input]"
- "--autounmask[Automatically unmask packages and generate package.use]:yes/no:((y\:'yes' n\:'no'))"
- "--autounmask-unrestricted-atoms[Use >= for autounmask if possible]:yes/no:((y\:'yes' n\:'no'))"
- "--autounmask-keep-masks[Don't unmask hardmasks and unkeyworded (live)]:yes/no:((y\:'yes' n\:'no'))"
- "--autounmask-write[Automatically write autounmask changes (respect CONFIG_PROTECT)]:yes/no:((y\:'yes' n\:'no'))"
+ "--autounmask[Automatically unmask packages and generate package.use]"
+ "--autounmask-unrestricted-atoms[Use >= for autounmask if possible]"
+ "--autounmask-keep-masks[Don't unmask hardmasks and unkeyworded (live)]"
+ "--autounmask-write[Automatically write autounmask changes (respect CONFIG_PROTECT)]"
"--backtrack=[Number of times to backtrack if dependency calculation fails]:number:(0 10 30)"
- "--binpkg-respect-use=[Ignore binary packages if their uses don't match current config]:yes/no:((y\:'yes' n\:'no'))"
- "--complete-graph=[Consider the deep dependencies of all packages from the world set]:yes/no:((y\:'yes' n\:'no'))"
- "--complete-graph-if-new-use=[--complete-graph if USE or IUSE will change for an installed package]:yes/no:((y\:'yes' n\:'no'))"
- "--complete-graph-if-new-ver=[--complete-graph if an installed package version will change]:yes/no:((y\:'yes' n\:'no'))"
+ "--binpkg-respect-use[Ignore binary packages if their uses don't match current config]"
+ "--complete-graph[Consider the deep dependencies of all packages from the world set]"
+ "--complete-graph-if-new-use[--complete-graph if USE or IUSE will change for an installed package]"
+ "--complete-graph-if-new-ver[--complete-graph if an installed package version will change]"
"--config-root=[Set PORTAGE_CONFIGROOT variable]:root path:_files -/"
- "--depclean-lib-check=[Check library link-level dependencies]:yes/no:((y\:'yes' n\:'no'))"
+ "--depclean-lib-check[Check library link-level dependencies]"
"--digest[Prevent corruption from being noticed]"
- "--dynamic-deps=[Substitute the dependencies of installed packages with the dependencies of corresponding unbuilt ebuilds]:yes/no:((y\:'yes' n\:'no'))"
- "--fail-clean=[Clean up temporary files after a build failure]:yes/no:((y\:'yes' n\:'no'))"
- "--ignore-built-slot-operator-deps=[Ignore the slot/sub-slot dependencies for built pkg]:yes/no:((y\:'yes' n\:'no'))"
- "(: $nopkg_opts)"{-j,--jobs=}"[Number of packages to build simultaneously]:jobs:({1.."${#${$(</proc/cpuinfo)/^processor}}"})"
- "--keep-going[Continue as much as possible after an error]:yes/no:((y\:'yes' n\:'no'))"
+ "--dynamic-deps[Substitute the dependencies of installed packages with the dependencies of corresponding unbuilt ebuilds]"
+ "--fail-clean[Clean up temporary files after a build failure]"
+ "--ignore-built-slot-operator-deps[Ignore the slot/sub-slot dependencies for built pkg]"
+ "--keep-going[Continue as much as possible after an error]"
"--load-average[No new builds should be started if there are other builds running and the load average is at least VALUE]"
- "--misspell-suggestions[Enable or disable misspell suggestions]:yes/no:((y\:'yes' n\:'no'))"
+ "--misspell-suggestions[Enable or disable misspell suggestions]"
"--newrepo[Recompile a package if it is now being pulled from a different repository]"
"--usepkg-exclude[Ignore matching binary packages]:installed atom:_gentoo_packages installed"
"--rebuild-exclude[Do not rebuild matching packages on --rebuild]:installed atom:_gentoo_packages installed"
"--rebuild-ignore[Do not rebuild packages that depend on matching packages on --rebuild]:installed atom:_gentoo_packages installed"
- "--package-moves[Perform package moves when necessary]:yes/no:((y\:'yes' n\:'no'))"
+ "--package-moves[Perform package moves when necessary]"
"--pkg-format[Binary package format]:archive type:(tar rpm)"
"--prefix=[Set EPREFIX env variable]:prefix path:_files -/"
- "--quiet-build=[Redirect all build output to logs]:yes/no:((y\:'yes' n\:'no'))"
- "--quiet-fail=[Suppresses display of the build log on stdout]:yes/no:((y\:'yes' n\:'no'))"
+ "--quiet-build[Redirect all build output to logs]"
+ "--quiet-fail[Suppresses display of the build log on stdout]"
"--quiet-repo-display[Suppress ::repository in output (and use numbers)]"
"--quiet-unmerge-warn[Disable the warning message on --unmerge and friends]"
- "--rebuild-if-new-slot[Automatically rebuild or reinstall packages when dependencies can be satisfied by a newer slot]:yes/no:((y\:'yes' n\:'no'))"
- "--rebuild-if-new-rev[Rebuild packages when build-time dependencies are built from source, if the dependency is not already installed with the same version and revision]:yes/no:((y\:'yes' n\:'no'))"
- "--rebuild-if-new-ver[Rebuild packages when build-time dependencies are built from source, if the dependency is not already installed with the same version]:yes/no:((y\:'yes' n\:'no'))"
- "--rebuild-if-unbuilt[Rebuild packages when build-time dependencies are built from source]:yes/no:((y\:'yes' n\:'no'))"
- "--rebuilt-binaries[Replace installed packages with binary packages that have been rebuilt]:yes/no:((y\:'yes' n\:'no'))"
+ "--rebuild-if-new-slot[Automatically rebuild or reinstall packages when dependencies can be satisfied by a newer slot]"
+ "--rebuild-if-new-rev[Rebuild packages when build-time dependencies are built from source, if the dependency is not already installed with the same version and revision]"
+ "--rebuild-if-new-ver[Rebuild packages when build-time dependencies are built from source, if the dependency is not already installed with the same version]"
+ "--rebuild-if-unbuilt[Rebuild packages when build-time dependencies are built from source]"
+ "--rebuilt-binaries[Replace installed packages with binary packages that have been rebuilt]"
"--rebuilt-binaries-timestamp[Only binaries older than TIMESTAMP will be considered by the rebuilt-binaries logic]:TIMESTAMP"
"--reinstall[Alias for --changed-use (currently)]:reinstall opts:(changes-use)"
"--reinstall-atoms[Treat matching packages as if they are not installed]:installed atoms:_gentoo_packages installed"
"--root=[Set ROOT env variable]:prefix path:_files -/"
- "(: $nopkg_opts)"{-w,--select=}"[Add specified packages to the world set (inverse of --oneshot)]:yes/no:((y\:'yes' n\:'no'))"
+ "(: $nopkg_opts)"{-w,--select}"[Add specified packages to the world set (inverse of --oneshot)]"
"--selective=[Use --selective=n if you want to forcefully disable --selective, regardless of options like --changed-use, --newuse, --noreplace, or --update]:yes/no:((y\:'yes' n\:'no'))"
"--unordered-display[Produce more readable package tree with --tree]"
- "--use-ebuild-visibility[Use unbuilt ebuild metadata for visibility checks on built packages]:yes/no:((y\:'yes' n\:'no'))"
+ "--use-ebuild-visibility[Use unbuilt ebuild metadata for visibility checks on built packages]"
"--useoldpkg-atoms[Prefer matching binary packages over newer unbuilt packages]:available atom:_gentoo_packages available"
- "($bopts)"{-b,--buildpkg=}"[Tells emerge to build binary packages]:(y n)"
+ "($bopts)"{-b,--buildpkg}"[Tells emerge to build binary packages]"
"($bopts)--buildpkg-exclude[Space separated list of package atoms for which no binary packages should be built]"
"($bopts)--exclude[Space separated list of package names or slot atoms which should not be installed]"
"($bopts)"{-B,--buildpkgonly}"[Tells emerge to only build binary packages]"
^ permalink raw reply related [flat|nested] 52+ messages in thread
end of thread, other threads:[~2023-01-17 14:45 UTC | newest]
Thread overview: 52+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-19 18:51 [gentoo-commits] proj/zsh-completion:master commit in: src/ Vadim Misbakh-Soloviov
-- strict thread matches above, loose matches on Subject: below --
2023-01-17 14:45 Vadim Misbakh-Soloviov
2022-01-12 9:35 Vadim Misbakh-Soloviov
2022-01-12 9:35 Vadim Misbakh-Soloviov
2020-09-14 3:13 Vadim Misbakh-Soloviov
2020-09-14 3:13 Vadim Misbakh-Soloviov
2020-09-14 3:13 Vadim Misbakh-Soloviov
2020-09-14 3:13 Vadim Misbakh-Soloviov
2020-02-19 18:47 Vadim Misbakh-Soloviov
2020-02-19 18:47 Vadim Misbakh-Soloviov
2020-02-19 18:47 Vadim Misbakh-Soloviov
2020-02-19 18:47 Vadim Misbakh-Soloviov
2020-02-19 18:47 Vadim Misbakh-Soloviov
2020-02-19 17:53 Vadim Misbakh-Soloviov
2020-02-19 17:53 Vadim Misbakh-Soloviov
2020-02-19 17:53 Vadim Misbakh-Soloviov
2015-04-28 14:56 Vadim A. Misbakh-Soloviov
2015-04-28 12:07 Vadim A. Misbakh-Soloviov
2015-04-28 12:07 Vadim A. Misbakh-Soloviov
2014-12-22 22:57 Tim Harder
2014-12-21 9:51 Tim Harder
2014-12-21 9:51 Tim Harder
2014-12-20 23:22 Tim Harder
2014-12-20 22:29 Tim Harder
2014-12-20 20:04 Tim Harder
2014-12-20 20:04 Tim Harder
2014-12-20 20:04 Tim Harder
2014-12-20 5:31 Tim Harder
2014-12-20 4:54 Tim Harder
2014-12-20 4:39 Tim Harder
2014-12-20 4:39 Tim Harder
2014-12-20 3:21 Tim Harder
2014-12-20 3:08 Tim Harder
2014-12-20 3:08 Tim Harder
2014-12-20 3:08 Tim Harder
2014-12-20 2:35 Tim Harder
2014-12-20 2:15 Tim Harder
2014-12-20 2:15 Tim Harder
2014-12-18 16:59 Tim Harder
2014-12-18 16:59 Tim Harder
2014-12-18 16:59 Tim Harder
2014-12-01 7:48 Tim Harder
2014-12-01 7:48 Tim Harder
2014-12-01 7:34 Tim Harder
2014-12-01 7:34 Tim Harder
2014-11-27 7:23 Tim Harder
2014-11-27 7:23 Tim Harder
2014-11-27 6:39 Tim Harder
2014-11-24 9:13 Vadim A. Misbakh-Soloviov
2014-11-24 7:33 Tim Harder
2014-11-24 7:33 Tim Harder
2014-11-23 21:35 Vadim A. Misbakh-Soloviov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox