summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-shells/zsh')
-rw-r--r--app-shells/zsh/ChangeLog13
-rw-r--r--app-shells/zsh/Manifest35
-rw-r--r--app-shells/zsh/files/_gcc-config25
-rw-r--r--app-shells/zsh/files/_genlop146
-rw-r--r--app-shells/zsh/files/_gentoolkit171
-rw-r--r--app-shells/zsh/files/_portage-20040730 (renamed from app-shells/zsh/files/_portage)226
-rw-r--r--app-shells/zsh/files/digest-zsh-4.1.1-r43
-rw-r--r--app-shells/zsh/files/digest-zsh-4.2.02
-rw-r--r--app-shells/zsh/files/digest-zsh-4.2.1_alpha13
-rw-r--r--app-shells/zsh/zsh-4.1.1-r4.ebuild122
-rw-r--r--app-shells/zsh/zsh-4.2.1_alpha1.ebuild (renamed from app-shells/zsh/zsh-4.2.0.ebuild)47
11 files changed, 606 insertions, 187 deletions
diff --git a/app-shells/zsh/ChangeLog b/app-shells/zsh/ChangeLog
index 7135ef48563b..fe1714e5603e 100644
--- a/app-shells/zsh/ChangeLog
+++ b/app-shells/zsh/ChangeLog
@@ -1,6 +1,17 @@
# ChangeLog for app-shells/zsh
# Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-shells/zsh/ChangeLog,v 1.55 2004/06/26 00:05:31 kugelfang Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-shells/zsh/ChangeLog,v 1.56 2004/08/12 19:11:59 usata Exp $
+
+*zsh-4.2.1_alpha1 (13 Aug 2004)
+
+ 13 Aug 2004; Mamoru KOMACHI <usata@gentoo.org> +files/_gcc-config,
+ +files/_genlop, +files/_gentoolkit, -files/_portage,
+ +files/_portage-20040730, -zsh-4.1.1-r4.ebuild, -zsh-4.2.0.ebuild,
+ +zsh-4.2.1_alpha1.ebuild:
+ New test release. Added completions for genlop, gensync, qpkg, equery,
+ gcc-config, and completion cache support. All these neat completions
+ were contributed by oberyno <oberyno@gmail.com>, see bug #58198.
+ Install Misc/* and Util/* scripts, see bug #54520.
26 Jun 2004; Danny van Dyk <kugelfang@gentoo.org> zsh-4.2.0-r1.ebuild:
Marked stable on amd64.
diff --git a/app-shells/zsh/Manifest b/app-shells/zsh/Manifest
index 92907495006d..f2d6521de056 100644
--- a/app-shells/zsh/Manifest
+++ b/app-shells/zsh/Manifest
@@ -1,29 +1,20 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
-MD5 6c526518e733c96c2052529eb19ee74c ChangeLog 9572
-MD5 28ed8ea6cdccb353e2e8ad783eb51f5b metadata.xml 506
+MD5 5f24ce2a901d02baa59a09e2cb7f1972 ChangeLog 10087
MD5 708c996d82ee2e1638a48016d7f5d698 zsh-4.0.9-r3.ebuild 2701
-MD5 6cd83da550a4aae0041706df8758aad2 zsh-4.1.1-r4.ebuild 3345
MD5 a8d76905e8a9727607b10c1b3722dcc9 zsh-4.1.1-r5.ebuild 3389
+MD5 28ed8ea6cdccb353e2e8ad783eb51f5b metadata.xml 506
MD5 607a5475313774b3ee38918e633cfd6a zsh-4.2.0-r1.ebuild 3692
-MD5 4e208fc31947da41f21eaa5bf7bcabd7 zsh-4.2.0.ebuild 3538
-MD5 81e325aacd554d2c5f6d14efe45d1ffd files/zsh-strncmp.diff 354
-MD5 d401be6503fc2e34341d56e99ee25e94 files/_portage-20040204 10954
-MD5 1a527b6a4700642b4742d9cc8de90285 files/digest-zsh-4.1.1-r4 199
+MD5 8d8c7b8b5bd2491c6a88f5829163edb4 zsh-4.2.1_alpha1.ebuild 4247
+MD5 e400db175b1bae0205d68e538940d292 files/_gcc-config 1130
+MD5 de58f149f41740c394800ba8d2cdf361 files/digest-zsh-4.0.9-r3 199
+MD5 1a527b6a4700642b4742d9cc8de90285 files/digest-zsh-4.1.1-r5 199
+MD5 46563792d80acf9492dd3afeaf4b19fd files/prompt_gentoo_setup 1612
MD5 64023b41a9987655e0e014d32562cfad files/zprofile 404
MD5 f83ccd2b6f1cd3e75c910c48159892f5 files/zsh-4.1.1-gentoo.diff 488
MD5 de0db046f0f40cb1cc3cd3f6e6b2645a files/zshenv 318
-MD5 2aa47fce01c92a0cc7e070f04018ac93 files/_portage 7539
-MD5 1a527b6a4700642b4742d9cc8de90285 files/digest-zsh-4.1.1-r5 199
-MD5 476cf7906a080d52beee81d76fd2a82a files/digest-zsh-4.2.0 130
-MD5 de58f149f41740c394800ba8d2cdf361 files/digest-zsh-4.0.9-r3 199
-MD5 46563792d80acf9492dd3afeaf4b19fd files/prompt_gentoo_setup 1612
+MD5 d401be6503fc2e34341d56e99ee25e94 files/_portage-20040204 10954
+MD5 4d4d3f13f7a73a8d0f8c2d1108eb366b files/digest-zsh-4.2.1_alpha1 213
+MD5 81e325aacd554d2c5f6d14efe45d1ffd files/zsh-strncmp.diff 354
+MD5 c76debf789c176c979dd02600c707a7e files/_genlop 5248
MD5 9c5e675b40ea6a43fd461f262df24fb4 files/digest-zsh-4.2.0-r1 199
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.9.8 (GNU/Linux)
-
-iD8DBQFA4OlzHTu7gpaalycRAgQDAJ9kOjVR5LF9dAmq8xBtX6j5ZAf8igCg49xl
-7KeFCRt4jlLAuVxa9eysWqA=
-=cHiB
------END PGP SIGNATURE-----
+MD5 57e489dcba8d277ca3d44d2b415031b3 files/_gentoolkit 6555
+MD5 3f90e9d6e04d7ada6aa481519d74cc8a files/_portage-20040730 12959
diff --git a/app-shells/zsh/files/_gcc-config b/app-shells/zsh/files/_gcc-config
new file mode 100644
index 000000000000..68e61e70bbdd
--- /dev/null
+++ b/app-shells/zsh/files/_gcc-config
@@ -0,0 +1,25 @@
+#compdef gcc-config
+#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/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(){
+ profile=$(_call_program tag gcc-config --list-profiles | sed -r -e 's/(\[([^]]*)\]) //g')
+ _tags profile && { compadd "$@" -k profile || compadd "$@" ${(kv)=profile} }
+}
+
+_arguments $arguments
diff --git a/app-shells/zsh/files/_genlop b/app-shells/zsh/files/_genlop
new file mode 100644
index 000000000000..763dc7697f80
--- /dev/null
+++ b/app-shells/zsh/files/_genlop
@@ -0,0 +1,146 @@
+#compdef genlop
+
+# ZSH completion function for genlop
+#
+# Original authors of portage completion
+# Author: baptux <bapt@ifrance.com>
+# Author: Mamoru KOMACHI <usata@gentoo.org>
+#
+# Adapted for genlop by oberyno <oberyno@gmail.com>
+
+_genlop () {
+ local state prev1="$words[CURRENT-1]" prev2="$words[CURRENT-2]"
+ if (( CURRENT == 2 ));then
+ _arguments -s \
+ '*:*:->ebuilds' \
+ "$common_args[@]" "$general_args[@]" "$single_args[@]" && return 0
+ elif (( CURRENT > 2 ));then
+ case "$words[2]" in
+ --unmerge|-u)
+ _arguments -s \
+ '*:*:->install_portage' \
+ "$common_args[@]" "$general_args[@]" && return 0
+ ;;
+ --current|-c)
+ _arguments -s \
+ '*:only works when an emerge is in progress:' \
+ "$common_args[@]" && return 0
+ ;;
+ --pretend|-p)
+ _arguments -s \
+ '*:needs a piped emerge; otherwise will do nothing:' \
+ "$common_args[@]" && return 0
+ ;;
+ --date)
+ if [[ ${prev2} == (january|february|march|april|may|june|july|august|september|october|november|december|monday|tuesday|wednesday|thursday|friday|saturday|sunday) ]]
+ then _arguments -s \
+ '*:installed pkgname:_portage_installed' \
+ "$common_args[@]" "$general_args[@]" && return 0
+ elif [[ ${prev1} == (1) ]]
+ then _values "date" 'day ago' 'month ago' 'year ago' 'week ago' && return 0
+ elif [[ ${prev1} == ([2-9]|[1-9][0-9]*) ]]
+ then _values "date" 'days ago' 'months ago' 'years ago' 'weeks ago' && return 0
+ elif [[ ${prev1} == (last) ]]
+ then _values "date" month week
+ _arguments '*:*:_days' && return 0
+ elif [[ ${prev1} == (1st|2nd|3rd|4th|5th) ]]
+ then _arguments '*:*:_days' && return 0
+ elif [[ ${prev1} == (january|february|march|april|may|june|july|august|september|october|november|december) ]]
+ then compadd {1..31} && return 0
+ elif [[ ${prev2} == (1st|2nd|3rd|4th|5th) ]]
+ then compadd in\ {january,february,march,april,may,june,july,august,september,october,november,december} && return 0
+ elif [[ ${prev1} == --date ]]
+ then _values "enter number for more options or use mm/dd/yyyy format" \
+ last yesterday 1st 2nd 3rd 4th 5th
+ _alternative \
+ '*:*:_days' '*:*:_months' && return 0
+ else
+ _arguments -s \
+ '*:installed pkgname:_portage_installed' \
+ "$common_args[@]" "$general_args[@]" && return 0
+ fi
+ ;;
+
+ --rsync|-r|--list|-l)
+ _arguments -s \
+ "$common_args[@]" "$general_args[@]" && return 0
+ ;;
+ --version|-v|--help|-h)
+ _arguments -s \
+ "$common_args[@]" && return 0
+ ;;
+ *)
+ _arguments -s \
+ '*:*:->ebuilds' \
+ "$common_args[@]" "$general_args[@]" && return 0
+ ;;
+ esac
+ fi
+ while [[ -n "$state" ]]; do
+ lstate=$state
+ state=''
+ case "$lstate" in
+ ebuilds)
+ _alternative \
+ '*:installed packages:_portage_installed'
+ ;;
+ install_portage)
+ _alternative \
+ '*:installed packages:_portage_pkglist'
+ ;;
+ esac
+ done
+}
+
+_portage_installed(){
+ installed_portage=(/var/db/pkg/*-*/*)
+ installed_pkgname=${(M)${${installed_portage##*/}%%-[0-9]*}}
+ _tags installed_pkgname && { compadd "$@" ${(kv)=installed_pkgname} }
+ _path_files -/ -W /var/db/pkg/
+}
+#Function to show all available portage names
+_portage_pkglist(){
+ portage_pkglist="$portage_pkglist"
+ _tags -s portage_pkglist && { compadd "$@" ${(kv)=portage_pkglist} }
+ _path_files -/ -F "*CVSROOT" -F "*eclass" -F "*distfiles" -F "*licences" -F "*files" -W "${portdir}"
+ _path_files -g \*.ebuild
+}
+common_args=(
+ {'(-n)--nocolor','(--nocolor)-n'}'[disable colored output]'
+)
+
+general_args=(
+ {'(--time)-t','(-t)--time'}'[calculate merge time]'
+ {'(--gmt)-g','(-g)--gmt'}'[display time in GMT/UTC format (default is local time)]'
+ {'(--info)-i','(-i)--info'}'[prints brief summary about installed ebuild]'
+ {'(--file)-f','(-f)--file'}'[specify the logfile to use]:filename:_files'
+ {'(--rsync -r --unmerge)-u','(--rsync -r -u)--unmerge'}'[show when packages have been unmerged]'
+ '*--date[specify date of event]'
+ {'(--search -s --info -i --time -t --unmerge -u --rsync)-r','(--search -s --info -i --time -t --unmerge -u -r)--rsync'}'[looks for portage rsync/sync history]'
+ {'(--search -s --info -i --list)-l','(--search -s --info -i -l)--list'}'[list complete merge history]'
+ {'(--rsync -r --search)-s','(--rsync -r -s)--search'}'[select ebuilds matching the provided regular expression]:enter:_guard "^--*" search pattern'
+)
+
+single_args=(
+ {'(--current)-c','(-c)--current'}'[show the current merge in action]'
+ {'(--pretend)-p','(-p)--pretend'}'[take output from a piped emerge -p and calculate estimated build time]'
+ {'(--version)-v','(-v)--version'}'[output version information]'
+ {'(--help)-h','(-h)--help'}'[show help]'
+)
+
+_days() {
+ _values "" \
+ monday tuesday wednesday thursday friday saturday sunday
+}
+_months() {
+ _values "" \
+ january february march april may june july august september october november december
+}
+
+#Reading informations from make.conf
+portdir="$(portageq portdir)"
+#pkgdir="$(portageq pkgdir)"
+portdir_overlay="$(portageq portdir_overlay)"
+
+portage_pkglist=(${portdir}/*-*/* ${portdir_overlay}/*-*/*)
+portage_pkglist=(${portage_pkglist##*/})
diff --git a/app-shells/zsh/files/_gentoolkit b/app-shells/zsh/files/_gentoolkit
new file mode 100644
index 000000000000..37faa6af418d
--- /dev/null
+++ b/app-shells/zsh/files/_gentoolkit
@@ -0,0 +1,171 @@
+#compdef gensync equery qpkg
+
+# Author: oberyno <oberyno@gmail.com>
+
+#Function to show gensync overlays located in /etc/gensync
+_overlays(){
+ overlay=$(grep -h id= /etc/gensync/* | sed -e 's/id="\(.*\)"$/\1/')
+ _tags overlay && { compadd "$@" ${(kv)=overlay} }
+}
+
+#show portage categories without / at end; app-cdr instead of app-cdr/ -- this can probably be done with _files, but I'm lazy
+_category(){
+ categories=($portdir/metadata/cache/*-*)
+ category=${(M)${${categories##*/}}}
+_tags -s category && { compadd "$@" ${(kv)=category} }
+}
+
+#Function to show only installed packages -- pkgname (no category or version #)
+_portage_installed(){
+ installed_portage=(/var/db/pkg/*-*/*)
+ installed_pkgname=${(M)${${installed_portage##*/}%%-[0-9]*}}
+ _tags -s installed_pkgname && { compadd "$@" ${(kv)=installed_pkgname} }
+}
+#moved out of equery
+_equery_val(){
+ _values "equery actions" \
+ 'files[list files owned by pkg]' \
+ 'list[list all packages matching pattern]' \
+ 'belongs[list all packages owning file]' \
+ 'uses[display USE flags for package]' \
+ 'which[print full path to ebuild for package]' \
+ 'depgraph[display a dependency tree for package]' \
+ 'check[check files against recorded md5sums and timestamps]' \
+ 'size[print size of files contained in package]'
+ }
+
+#Function to show all available portage names
+_portage_pkglist(){
+ portage_pkglist="$portage_pkglist"
+ _tags -s portage_pkglist && { compadd "$@" ${(kv)=portage_pkglist} }
+ _path_files -/ -F "*CVSROOT" -F "*eclass" -F "*distfiles" -F "*licences" -W "${portdir}"
+}
+
+#Reading informations from Portage
+portdir="$(portageq portdir)"
+#pkgdir="$(portageq pkgdir)"
+portdir_overlay="$(portageq portdir_overlay)"
+
+portage_pkglist=(${portdir}/*-*/* ${portdir_overlay}/*-*/*)
+portage_pkglist=(${portage_pkglist##*/})
+
+
+case $service in
+
+ gensync)
+ _arguments \
+ '(- :)'{--list-sources,-l}'[list known rsync sources]' \
+ '()'{--no-color,-C}'[turn off colours]:overlays:_overlays' \
+ '(- :)'{--help,-h}'[show help]' \
+ '(- :)'{--version,-V}'[display version info]' \
+ '(- :)'':overlays:_overlays'
+;;
+
+ qpkg)
+ excl=( --help -h --query-deps -q )
+ check=( --check-md5 -cm --check-time -ct --check -c )
+ arg=( --info -i --list -l --non-masked -n --masked -m --installed -I --uninstalled -U --group -g )
+ find=( --find-file -f --find-pattern -fp )
+ dups=( --dups -d --slot -s)
+
+ _arguments \
+ "($check $excl $find $dups 1)"{--find-file,-f}"[finds package that owns file]:file:_files" \
+ "($check $excl $find $dups 1)"{--find-pattern,-fp}"[finds package that owns file matching pattern]:pattern:" \
+ "($excl $check $arg $find --dups -d )"{--dups,-d}"[print packages that have multiple versions installed]" \
+ "($excl $check $arg $find --slot -s 1)"{--slot,-s}"[only print duplicates of the same slot]" \
+ "($check $excl --installed -I --uninstalled -U $dups -d)"{--uninstalled,-U}"[include only uninstalled packages]" \
+ "($excl --uninstalled -U --installed -I $dups -d)"{--installed,-I}"[include only installed packages]" \
+ "($excl --group -g $dups -d)"{--group,-g}"[find by group]:group:_category" \
+ "($check $excl --list -l $dups -d)"{--list,-l}"[list package contents]" \
+ "($excl --info -i $dups -d 1)"{--info,-i}"[get package description and home page]:package:_portage_pkglist" \
+ "($excl $check $find $dups --uninstalled -U)"{--check-time,-ct}"[verify package file timestamps]" \
+ "($excl $check $find $dups --uninstalled -U)"{--check-md5,-cm}"[verify package files md5]" \
+ "($excl $check $find $dups --uninstalled -U)"{--check,-c}"[verify mtimes and md5]" \
+ "($excl $find --query-deps -q $dups -d 1)"{--query-deps,-q}"[display all installed packages depending on selected packages]:package:_portage_pkglist" \
+ "()"{--no-color,-nc}"[dont use colors]" \
+ "*--verbose[be more verbose (2 levels)]" \
+ "*-v[be more verbose (2 levels)]" \
+ "($excl --non-masked -n --masked -m $dups)"{--masked,-m}"[include only masked packages]" \
+ "($excl --non-masked -n --masked -m $dups)"{--non-masked,-n}"[include only non-masked packages]" \
+ "(- :)"{--help,-h}"[show help]" \
+ "(--info -i --query-deps -q --slot -s)1:package:_portage_installed"
+;;
+
+equery)
+ local prev="$words[CURRENT-1]" prev2="$words[CURRENT-2]"
+
+ if (( CURRENT == 2 ));then
+ _equery_val
+ _arguments \
+ $common_args && return 0
+ elif (( CURRENT > 2 ));then
+
+ case "$prev" in
+ files|--timestamp|--md5sum|--type)
+ _arguments -s \
+ '--timestamp[append timestamp]' \
+ '--md5sum[append md5sum]' \
+ '--type[prepend file type]' \
+ '*:installed pkgname:_portage_installed' && return 0
+ ;;
+ belongs|--earlyout)
+ _arguments -s \
+ '(-c --category)'{-c,--category}'[only search in specified category]' \
+ '(-e --earlyout)'{-e,--earlyout}'[stop when first match found]' \
+ '*:file:_files' && return 0
+ ;;
+ --category|-c)
+ _arguments -s \
+ '*:category:_category' && return 0
+ ;;
+ list|--installed|-i|--exclude-installed|-I|-p|--portage-tree|-o|--overlay-tree)
+ _arguments -s \
+ '(-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]' \
+ '(-o --overlay-tree)'{-o,--overlay-tree}'[also search in overlay tree]' \
+ '*:package:_portage_installed' && return 0
+ ;;
+ uses|which)
+ _arguments \
+ '*:package:_portage_pkglist' \
+ && return 0
+ ;;
+ depgraph|-U|--no-useflags|-l|--linear)
+ _arguments -s \
+ '(-U --no-useflags)'{-U,--no-useflags}'[do not show USE flags]' \
+ '(-l --linear)'{-l,--linear}'[do not use fancy formatting]' \
+ '*:package:_portage_installed' \
+ && return 0
+ ;;
+ size|-b|--bytes)
+ _arguments -s \
+ '(-b --bytes)'{-b,--bytes}'[report size in bytes]' \
+ '*:package:_portage_installed' \
+ && return 0
+ ;;
+ check)
+ _arguments -s \
+ '*:package:_portage_installed' \
+ && return 0
+ ;;
+ --nocolor|-C|--quiet|-q)
+ _equery_val
+ _arguments \
+ $common_args && return 0
+ ;;
+ esac
+
+ [[ $prev2 == (--category|-c) ]] &&
+ _arguments '(-c --category)'{-c,--category}'[only search in specified category]' \
+ '(-e --earlyout)'{-e,--earlyout}'[stop when first match found]' \
+ '*:file:_files' && return 0
+
+ fi
+ common_args=(
+ {'(--nocolor)-C','(-C)--nocolor'}'[turns off colors]'
+ {'(--quiet)-q','(-q)--quiet'}'[minimal output]'
+ {'(--help)-h','(-h)--help'}'[show help]'
+ )
+ ;;
+esac
diff --git a/app-shells/zsh/files/_portage b/app-shells/zsh/files/_portage-20040730
index d61e7cf71c00..e372e15c4a98 100644
--- a/app-shells/zsh/files/_portage
+++ b/app-shells/zsh/files/_portage-20040730
@@ -1,11 +1,111 @@
-#compdef emerge
+#compdef emerge rc-update rc-status ebuild opengl-update rc
-# $Id: _portage,v 1.2 2004/01/18 17:51:04 usata Exp $
+# $Id: _portage-20040730,v 1.1 2004/08/12 19:11:59 usata Exp $
-# ZSH completion function for emerge
+# ZSH completion function for Portage
# Author: baptux <bapt@ifrance.com>
# Author: Mamoru KOMACHI <usata@gentoo.org>
+# Already done:
+#
+# emerge (fully done)
+# rc-update (fully done)
+# rc-status (fully done)
+# ebuild (fully done)
+# opengl-update (fully done)
+# rc (fully done)
+
+# Stuff for rc
+_rc () {
+ if (( CURRENT == 2 ));then
+ _values "runlevels" $gentoo_runlevels
+ fi
+}
+
+# Stuff for opengl-update (the easiest to do :) )
+
+_opengl-update () {
+ if (( CURRENT == 2 ));then
+ _values "opengl-update options" \
+ 'xfree[Use libGL.so from XFree86]' \
+ 'nvidia[Use libGL.so from the NVidia drivers.]'
+ fi
+}
+
+# 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]' \
+ 'rpm[Builds a RedHat RPM package]'
+ fi
+
+}
+
+# Stuff for rc-status
+_rc-status () {
+ if (( CURRENT == 2 ));then
+ _values "rc-status options" \
+ '-a[Show services at all run levels]' \
+ '--all[Show services at all run levels]' \
+ '-l[Show list of run levels]' \
+ '--list[Show list of run levels]' \
+ '-u[Show services not assigned to any run level]' \
+ '--unused[Show services not assigned to any run level]' \
+ $gentoo_runlevels
+ fi
+}
+
+# Stuff for rc-update
+
+_rc-update () {
+ 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|del|-d)
+ _arguments -s \
+ '*:scripts:_files -W /etc/init.d/'
+ ;;
+ show|-s)
+ _values "runlevels" $gentoo_runlevels
+ ;;
+ esac
+ elif (( CURRENT == 4 ));then
+ case "$words[2]" in
+ add|-a|del|-d)
+ _values "runlevels" $gentoo_runlevels
+ ;;
+ esac
+ fi
+}
+
+# Stuff for emerge
+
_emerge () {
local state
if (( CURRENT == 2 ));then
@@ -15,8 +115,16 @@ _emerge () {
elif (( CURRENT > 2 ));then
case "$words[2]" in
unmerge|-C)
- _arguments -s \
- '*:installed pkgname with versions:_portage_unmerge' "$common_args[@]" && return 0
+ if compset -P '(\\|)[><][=]'; then
+ _arguments -s \
+ '*:installed pkgname with versions:_portage_unmerge_vers' "$common_args[@]" && return 0
+ elif compset -P '(\\|)[<=>]'; then
+ _arguments -s \
+ '*:installed pkgname with versions:_portage_unmerge_vers' "$common_args[@]" && return 0
+ else
+ _arguments -s \
+ '*:installed pkgname:_portage_unmerge' "$common_args[@]" && return 0
+ fi
;;
clean|-c)
_arguments -s \
@@ -26,7 +134,12 @@ _emerge () {
_arguments -s \
'*:use package only:_portage_tbz2list' "$common_args[@]" && return 0
;;
- depclean|help|-h|info|regen|sync|rsync|--searchdesc|-S|search|-s|inject|-j|prune|-P)
+ depclean|help|-h|info|regen|sync|rsync|--searchdesc|-S|search|-s|prune|-P)
+ ;;
+ --resume|--skipfirst)
+ _arguments -s \
+ '--skipfirst[Removes the first package in the resume list]' \
+ "$common_args[@]" && return 0
;;
*)
_arguments -s \
@@ -41,24 +154,51 @@ _emerge () {
state=''
case "$lstate" in
actions)
+ if compset -P '(\\|)[><][=]'; then
+ _alternative \
+ '*:portage:_ebuild_cache'
+
+ elif compset -P '(\\|)[<=>]'; then
_alternative \
- ':emerge actions:_actions' \
- '*:portage:_portage_pkglist'
+ '*:portage:_ebuild_cache'
+
+ else
+ _alternative \
+ ':emerge actions:_actions' \
+ '*:portage:_portage_pkglist'
+ fi
+
;;
install_portage)
+ if compset -P '(\\|)[><][=]'; then
+ _alternative \
+ '*:portage:_ebuild_cache'
+ elif compset -P '(\\|)[<=>]'; then
+ _alternative \
+ '*:portage:_ebuild_cache'
+ else
_alternative \
- '*:portage:_portage_pkglist'
+ '*:portage:_portage_pkglist'
+ fi
;;
esac
done
}
-#Function to show only installed packages "cat/name-ver"
+#Function to show only installed packages -- pkgname (no category or version #)
_portage_unmerge(){
installed_portage=(/var/db/pkg/*-*/*)
- installed_dir=/var/db/pkg/
- installed_pkg=${installed_portage//$installed_dir/}
- _tags -s installed_pkg && { compadd "$@" -k installed_pkg || compadd "$@" ${(kv)=installed_pkg} }
+ installed_pkgname=${(M)${${installed_portage##*/}%%-[0-9]*}}
+ _tags -s installed_pkgname && { compadd "$@" ${(kv)=installed_pkgname} }
+ _path_files -/ -W "/var/db/pkg/"
+}
+
+#Function to show only installed packages -- cat/name-ver
+_portage_unmerge_vers(){
+ installed_portage=(/var/db/pkg/*-*/*)
+ installed_pkgname=${(M)${${installed_portage##*/}}}
+ _tags -s installed_pkgname && { compadd "$@" ${(kv)=installed_pkgname} }
+ _path_files -/ -W "/var/db/pkg/"
}
#Functions to show "cat/name", classes and dependencies
@@ -88,9 +228,36 @@ _portage_pkglist(){
#[[ -n "${portdir_overlay}" ]] && _path_files -/ -W "${portdir_overlay}"
_path_files -g \*.ebuild
}
+#Function for matching all ebuilds pkg-ver (slow if asking for all packages)
+_ebuild_cache(){
+ if _cache_invalid portage_ebuilds || ! _retrieve_cache portage_ebuilds; then
+
+ overlay_ebuilds=($portdir_overlay/*-*/*/*)
+ overlay_list=${${(M)${overlay_ebuilds##*/}#*ebuild}%%.ebuild}
+ metadata_ebuilds=($portdir/metadata/cache/*-*/*)
+ metadata_list=${(M)${${metadata_ebuilds##*/}}}
+
+ _store_cache portage_ebuilds metadata_list overlay_list
+ fi
+ _tags -s metadata_list && {compadd "$@" ${(kv)=metadata_list} }
+ _tags -s overlay_list && {compadd "$@" ${(kv)=overlay_list} }
+}
+
+local update_policy
+zstyle -s ":completion:*:*:emerge:*" cache-policy update_policy
+if [[ -z "$update_policy" ]]; then
+ zstyle ":completion:*:*:emerge:*" cache-policy _ebuilds_caching_policy
+fi
+
+_ebuilds_caching_policy () {
+ # rebuild if cache is more than a week old
+ oldp=( "$1"(mw+1) )
+ (( $#oldp )) && return 0
+}
common_args=(
- {'(-p)--pretend','(--pretend)-p'}'[simply display what would be done]'
+ {'(-p -a --ask)--pretend','(--pretend -a --ask)-p'}'[simply display what would be done]'
+ {'(-p -a --pretend)--ask','(--pretend -p --ask)-a'}'[ask what would be done]'
{'(-d)--debug','(--debug)-d'}'[Tells emerge to run the emerge command in debug mode]'
)
install_args=(
@@ -112,16 +279,10 @@ install_args=(
{'(--usepkg --changelog -l)-k','(-k --changelog -l)--usepkg'}'[Tells emerge to use binary packages if available]'
{'(--usepkgonly --changelog -l)-K','(-K --changelog -l)--usepkgonly'}'[Tells emerge to use binary packages only]'
{'(--verbose)-v','(-v)--verbose'}'[Tell emerge to run in verbose mode]'
- '(-p --pretend)--columns[Displays versions in aligned format]'
+ '(-p --pretend -a --ask)--columns[Displays versions in aligned format]'
'--resume[Resumes the last merge operation]'
- '--skipfirst[Removes the first package in the resume list]'
)
-_options() {
- _arguments -s \
- "$unmerge_args[@]" "$common_args[@]" "$install_args[@]"
-}
-
_actions() {
_values "emerge actions" \
'sync[Initiates a portage tree update]' \
@@ -168,5 +329,26 @@ fi
portage_pkglist=(${portdir}/*-*/* ${portdir_overlay}/*-*/*)
portage_pkglist=(${portage_pkglist##*/})
+gentoo_runlevels=(/etc/runlevels/*)
+gentoo_runlevels=(${${gentoo_runlevels/\/etc\/runlevels\//}%/})
-_emerge "$@"
+case "$service" in
+ emerge)
+ _emerge "$@" && return 0
+ ;;
+ rc-update)
+ _rc-update "$@" && return 0
+ ;;
+ rc-status)
+ _rc-status "$@" && return 0
+ ;;
+ ebuild)
+ _ebuild "$@" && return 0
+ ;;
+ opengl-update)
+ _opengl-update "$@" && return 0
+ ;;
+ rc)
+ _rc "$@" && return 0
+ ;;
+esac
diff --git a/app-shells/zsh/files/digest-zsh-4.1.1-r4 b/app-shells/zsh/files/digest-zsh-4.1.1-r4
deleted file mode 100644
index f9bbd87c4098..000000000000
--- a/app-shells/zsh/files/digest-zsh-4.1.1-r4
+++ /dev/null
@@ -1,3 +0,0 @@
-MD5 48958b1a3fc86261a26eea40a4f7d4af zsh-4.1.1.tar.bz2 1924514
-MD5 a4fb455591ee95e5264bf985af3473ea zsh-4.1.1-euc-0.2.patch.gz 2788
-MD5 3ec54fa702b9a5c5209b56c2c8ed6a88 zsh-4.1.1-doc.tar.bz2 1572953
diff --git a/app-shells/zsh/files/digest-zsh-4.2.0 b/app-shells/zsh/files/digest-zsh-4.2.0
deleted file mode 100644
index 7161590156e5..000000000000
--- a/app-shells/zsh/files/digest-zsh-4.2.0
+++ /dev/null
@@ -1,2 +0,0 @@
-MD5 866bcdad8c0c4974650f5eff395a9a35 zsh-4.2.0.tar.bz2 1990884
-MD5 14aa2d8d9e6f546593fd42f45dfee669 zsh-4.2.0-doc.tar.bz2 1695230
diff --git a/app-shells/zsh/files/digest-zsh-4.2.1_alpha1 b/app-shells/zsh/files/digest-zsh-4.2.1_alpha1
new file mode 100644
index 000000000000..bbc862c1bc8c
--- /dev/null
+++ b/app-shells/zsh/files/digest-zsh-4.2.1_alpha1
@@ -0,0 +1,3 @@
+MD5 e76611901723d08637115d8a550fc650 zsh-4.2.1-test-A.tar.bz2 2036847
+MD5 3c222b6d7b974c07ba244c37eb5d65fb zsh-4.2.0-euc-0.2.patch.gz 2857
+MD5 d2b5e31c64d63c0f6acbfd9d545a9822 zsh-4.2.1-test-A-doc.tar.bz2 1752490
diff --git a/app-shells/zsh/zsh-4.1.1-r4.ebuild b/app-shells/zsh/zsh-4.1.1-r4.ebuild
deleted file mode 100644
index b12a995e503d..000000000000
--- a/app-shells/zsh/zsh-4.1.1-r4.ebuild
+++ /dev/null
@@ -1,122 +0,0 @@
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-shells/zsh/zsh-4.1.1-r4.ebuild,v 1.6 2004/06/29 04:00:30 vapier Exp $
-
-inherit flag-o-matic eutils
-
-DESCRIPTION="UNIX Shell similar to the Korn shell"
-HOMEPAGE="http://www.zsh.org/"
-SRC_URI="ftp://ftp.zsh.org/pub/${P}.tar.bz2
- cjk? ( http://www.ono.org/software/dist/${P}-euc-0.2.patch.gz )
- doc? ( ftp://ftp.zsh.org/pub/${P}-doc.tar.bz2 )"
-
-LICENSE="ZSH"
-SLOT="0"
-KEYWORDS="x86 ppc sparc alpha hppa amd64"
-IUSE="cjk maildir ncurses static doc"
-
-RDEPEND=">=dev-libs/libpcre-3.9
- sys-libs/libcap
- ncurses? ( >=sys-libs/ncurses-5.1 )"
-DEPEND="sys-apps/groff
- >=sys-apps/sed-4
- ${RDEPEND}"
-
-src_unpack() {
- unpack ${P}.tar.bz2
- use doc && unpack ${P}-doc.tar.bz2
- cd ${S}
- epatch ${FILESDIR}/${P}-gentoo.diff
- use cjk && epatch ${DISTDIR}/${P}-euc-0.2.patch.gz
- epatch ${FILESDIR}/${PN}-strncmp.diff
- cd ${S}/Doc
- ln -sf . man1
- # fix zshall problem with soelim
- soelim zshall.1 > zshall.1.soelim
- mv zshall.1.soelim zshall.1
-}
-
-src_compile() {
- local myconf
-
- use ncurses && myconf="--with-curses-terminfo"
- use maildir && myconf="${myconf} --enable-maildir-support"
- use static && myconf="${myconf} --disable-dynamic" \
- && append-ldflags -static
-
- econf \
- --bindir=/bin \
- --libdir=/usr/lib \
- --enable-etcdir=/etc/zsh \
- --enable-zshenv=/etc/zsh/zshenv \
- --enable-zlogin=/etc/zsh/zlogin \
- --enable-zlogout=/etc/zsh/zlogout \
- --enable-zprofile=/etc/zsh/zprofile \
- --enable-zshrc=/etc/zsh/zshrc \
- --enable-fndir=/usr/share/zsh/${PV}/functions \
- --enable-site-fndir=/usr/share/zsh/site-functions \
- --enable-function-subdirs \
- --enable-ldflags="${LDFLAGS}" \
- ${myconf} || die "configure failed"
-
- if use static ; then
- # compile all modules statically, see Bug #27392
- sed -i -e "s/link=no/link=static/g" \
- -e "s/load=no/load=yes/g" \
- config.modules || die
- else
- # avoid linking to libs in /usr/lib, see Bug #27064
- sed -i -e "/LIBS/s%-lpcre%/usr/lib/libpcre.a%" \
- Makefile || die
- fi
-
- # emake still b0rks
- make || die "make failed"
- #make check || die "make check failed"
-}
-
-src_install() {
- einstall \
- bindir=${D}/bin \
- libdir=${D}/usr/lib \
- fndir=${D}/usr/share/zsh/${PV}/functions \
- sitefndir=${D}/usr/share/zsh/site-functions \
- install.bin install.man install.modules \
- install.info install.fns || die "make install failed"
-
- insinto /etc/zsh
- doins ${FILESDIR}/zprofile
-
- keepdir /usr/share/zsh/site-functions
- insinto /usr/share/zsh/site-functions
- doins ${FILESDIR}/_portage
-
- dodoc ChangeLog* META-FAQ README INSTALL LICENCE config.modules
-
- if use doc ; then
- dohtml Doc/*
- insinto /usr/share/doc/${PF}
- doins Doc/zsh{.dvi,_us.ps,_a4.ps}
- fi
-
- docinto StartupFiles
- dodoc StartupFiles/z*
-}
-
-pkg_preinst() {
- # Our zprofile file does the job of the old zshenv file
- # Move the old version into a zprofile script so the normal
- # etc-update process will handle any changes.
- if [ -f ${ROOT}/etc/zsh/zshenv -a ! -f ${ROOT}/etc/zsh/zprofile ]; then
- mv ${ROOT}/etc/zsh/zshenv ${ROOT}/etc/zsh/zprofile
- fi
-}
-
-pkg_postinst() {
- # see Bug 26776
- ewarn
- ewarn "If you are upgrading from zsh-4.0.x you may need to"
- ewarn "remove all your old ~/.zcompdump files in order to use"
- ewarn "completion. For more info see zcompsys manpage."
- ewarn
-}
diff --git a/app-shells/zsh/zsh-4.2.0.ebuild b/app-shells/zsh/zsh-4.2.1_alpha1.ebuild
index 72fe99bd7b52..1b89e2ebfaa2 100644
--- a/app-shells/zsh/zsh-4.2.0.ebuild
+++ b/app-shells/zsh/zsh-4.2.1_alpha1.ebuild
@@ -1,18 +1,23 @@
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-shells/zsh/zsh-4.2.0.ebuild,v 1.8 2004/06/29 04:00:30 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-shells/zsh/zsh-4.2.1_alpha1.ebuild,v 1.1 2004/08/12 19:11:59 usata Exp $
+
+inherit eutils
+
+MYDATE="20040730"
+MY_PV="${PV/_alpha1/-test-A}"
+MY_P="${PN}-${MY_PV}"
DESCRIPTION="UNIX Shell similar to the Korn shell"
HOMEPAGE="http://www.zsh.org/"
-MYDATE="20040204"
-MY_P="${P/_pre/-pre-}"
-SRC_URI="ftp://ftp.zsh.org/pub/${MY_P}.tar.bz2
- doc? ( ftp://ftp.zsh.org/pub/${MY_P}-doc.tar.bz2 )"
+SRC_URI="ftp://ftp.zsh.org/pub/development/${MY_P}.tar.bz2
+ cjk? ( http://www.ono.org/software/dist/zsh-4.2.0-euc-0.2.patch.gz )
+ doc? ( ftp://ftp.zsh.org/pub/development/${MY_P}-doc.tar.bz2 )"
LICENSE="ZSH"
SLOT="0"
-KEYWORDS="x86 ppc sparc alpha hppa ~amd64"
-IUSE="maildir ncurses static doc pcre cap"
+KEYWORDS="~x86 ~ppc ~sparc ~alpha ~arm ~hppa ~amd64"
+IUSE="maildir ncurses static doc pcre cap cjk"
RDEPEND="pcre? ( >=dev-libs/libpcre-3.9 )
cap? ( sys-libs/libcap )
@@ -26,6 +31,8 @@ S="${WORKDIR}/${MY_P}"
src_unpack() {
unpack ${MY_P}.tar.bz2
use doc && unpack ${MY_P}-doc.tar.bz2
+ cd ${S}
+ use cjk && epatch ${DISTDIR}/zsh-4.2.0-euc-0.2.patch.gz
cd ${S}/Doc
ln -sf . man1
# fix zshall problem with soelim
@@ -48,7 +55,7 @@ src_compile() {
--enable-zlogout=/etc/zsh/zlogout \
--enable-zprofile=/etc/zsh/zprofile \
--enable-zshrc=/etc/zsh/zshrc \
- --enable-fndir=/usr/share/zsh/${PV}/functions \
+ --enable-fndir=/usr/share/zsh/${PV%_*}/functions \
--enable-site-fndir=/usr/share/zsh/site-functions \
--enable-function-subdirs \
--enable-ldflags="${LDFLAGS}" \
@@ -78,7 +85,7 @@ src_install() {
einstall \
bindir=${D}/bin \
libdir=${D}/usr/lib \
- fndir=${D}/usr/share/zsh/${PV}/functions \
+ fndir=${D}/usr/share/zsh/${PV%_*}/functions \
sitefndir=${D}/usr/share/zsh/site-functions \
install.bin install.man install.modules \
install.info install.fns || die "make install failed"
@@ -86,11 +93,18 @@ src_install() {
insinto /etc/zsh
doins ${FILESDIR}/zprofile
- keepdir /usr/share/zsh/site-functions
insinto /usr/share/zsh/site-functions
- newins ${FILESDIR}/_portage-${MYDATE} _portage
- insinto /usr/share/zsh/${PV}/functions/Prompts
- doins ${FILESDIR}/prompt_gentoo_setup
+ newins ${FILESDIR}/_portage-${MYDATE} _portage || die
+ doins ${FILESDIR}/{_genlop,_gcc-config,_gentoolkit} || die
+ insinto /usr/share/zsh/${PV%_*}/functions/Prompts
+ doins ${FILESDIR}/prompt_gentoo_setup || die
+
+ # install miscellaneous scripts; bug #54520
+ sed -i -e "s:/usr/local:/usr:g" {Util,Misc}/* || "sed failed"
+ insinto /usr/share/zsh/${PV%_*}/Util
+ doins Util/* || die "doins Util scripts failed"
+ insinto /usr/share/zsh/${PV%_*}/Misc
+ doins Misc/* || die "doins Misc scripts failed"
dodoc ChangeLog* META-FAQ README INSTALL LICENCE config.modules
@@ -114,15 +128,18 @@ pkg_preinst() {
}
pkg_postinst() {
-
einfo
- einfo "If you want to enable Portage completion and Gentoo prompt,"
+ einfo "If you want to enable Portage completions and Gentoo prompt,"
einfo "add"
einfo " autoload -U compinit promptinit"
einfo " compinit"
einfo " promptinit; prompt gentoo"
einfo "to your ~/.zshrc"
einfo
+ einfo "Also, if you want to enable cache for the completions, add"
+ einfo " zstyle ':completion::complete:*' use-cache 1"
+ einfo "to your ~/.zshrc"
+ einfo
# see Bug 26776
ewarn
ewarn "If you are upgrading from zsh-4.0.x you may need to"