aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/_genlop26
-rw-r--r--src/_gentoo_packages72
-rw-r--r--src/_gentoolkit7
-rw-r--r--src/_layman2
-rw-r--r--src/_portage8
-rw-r--r--src/_portage_utils61
6 files changed, 86 insertions, 90 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 9a747b7..da770b2 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}"
@@ -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,14 +69,14 @@ _parsereposconf() {
secname+=(${value})
elif [[ ${insection} == 1 ]]; then
if [[ ${name} == ${2} ]]; then
- v=${value};
+ v=${value}
fi
fi
continue
done < ${f}
done
- if [[ "-l" == ${1} ]]; then
+ if [[ ${1} == "-l" ]]; then
echo "${(@)secname}"
else
echo "${v}"
@@ -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;
+ [[ ${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};
+ v=${value}
fi
fi
continue
@@ -126,16 +126,16 @@ _parsesetsconf() {
fi
done
- if [[ "sets" == ${2} ]]; then
+ if [[ ${2} == "sets" ]]; 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
@@ -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
@@ -253,13 +253,13 @@ _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))
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 de7d287..9ea7cc2 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)
@@ -268,7 +268,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
@@ -407,4 +407,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
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