diff options
author | 2012-07-01 12:29:44 +0000 | |
---|---|---|
committer | 2012-07-01 12:29:44 +0000 | |
commit | 10d08948e281af44e3e57695975dd6e943d63958 (patch) | |
tree | 5ec1bd78b5ea8abf9a96cb0a21d37e302ed1cf05 /sys-fs/zfs | |
parent | Stable amd64, x86 for newer stabilized hardened-sources, bug #424351 (diff) | |
download | historical-10d08948e281af44e3e57695975dd6e943d63958.tar.gz historical-10d08948e281af44e3e57695975dd6e943d63958.tar.bz2 historical-10d08948e281af44e3e57695975dd6e943d63958.zip |
Import bash-completion from zfs-fuse
Package-Manager: portage-2.1.10.65/cvs/Linux x86_64
Diffstat (limited to 'sys-fs/zfs')
-rw-r--r-- | sys-fs/zfs/ChangeLog | 6 | ||||
-rw-r--r-- | sys-fs/zfs/Manifest | 9 | ||||
-rw-r--r-- | sys-fs/zfs/files/bash-completion | 232 | ||||
-rw-r--r-- | sys-fs/zfs/zfs-0.6.0_rc9-r3.ebuild | 6 | ||||
-rw-r--r-- | sys-fs/zfs/zfs-0.6.0_rc9.ebuild | 8 | ||||
-rw-r--r-- | sys-fs/zfs/zfs-9999.ebuild | 13 |
6 files changed, 257 insertions, 17 deletions
diff --git a/sys-fs/zfs/ChangeLog b/sys-fs/zfs/ChangeLog index bbcb4f42bdaf..de0749aca678 100644 --- a/sys-fs/zfs/ChangeLog +++ b/sys-fs/zfs/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for sys-fs/zfs # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs/ChangeLog,v 1.32 2012/06/25 21:19:41 ryao Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs/ChangeLog,v 1.33 2012/07/01 12:29:44 ryao Exp $ + + 01 Jul 2012; Richard Yao <ryao@gentoo.org> +files/bash-completion, + zfs-0.6.0_rc9-r3.ebuild, zfs-0.6.0_rc9.ebuild, zfs-9999.ebuild: + Import bash-completion from zfs-fuse 25 Jun 2012; Richard Yao <ryao@gentoo.org> zfs-0.6.0_rc9-r3.ebuild, zfs-9999.ebuild: diff --git a/sys-fs/zfs/Manifest b/sys-fs/zfs/Manifest index 73aafb860fc2..ac5c7fa973ef 100644 --- a/sys-fs/zfs/Manifest +++ b/sys-fs/zfs/Manifest @@ -1,3 +1,4 @@ +AUX bash-completion 6203 RMD160 3103cb50030ae3f3674608e516bab2dc9eda1184 SHA1 1ceb2c164e3f168a9e80c8dc4c396b8233e76fec SHA256 15e742477fad0104871fc055b6ce9bf803540070e47fa515ea7ca3c1a401f831 AUX linuxrc 225 RMD160 5d5471867fe8b6b93ae6391c04f23ed27dcfccbf SHA1 6e68b01e66543ad7e1f182596de6fc0aeeab2744 SHA256 69c5f407ae20a5e3000dc6389f8c75ee97e11c353489a00cb619134b103bf538 AUX zfs-0.6.0_rc9-hardened-support.patch 10487 RMD160 7691c3acacc7300a807ce34748d54b5c701d2d1f SHA1 fdfb1daa4358dabd2d470e3b2a40587574ac4a48 SHA256 5a2d1aa5c7b14446e889041ce50b9dbd74c0626f257cb14514230ab9618d48d9 AUX zfs-0.6.0_rc9-range-lock-caller-allocate.patch 16938 RMD160 0d8d2b160fae59c3e65941727984ff1d696f2719 SHA1 99debe5367008b0a8bf453cdcf6bad5a4dbcfec4 SHA256 54281bc439f459fa2ef1d057d8d13cc4017de2100edb8b56229959644881d22c @@ -7,8 +8,8 @@ AUX zfs-0.6.0_rc9-remove-pfmalloc-3-of-3.patch 2593 RMD160 39225be53d081aad20ae9 AUX zfs-0.6.0_rc9-use-pushpage.patch 38878 RMD160 16c6fd5ddbcba2961be21a1a640fcddd6a511499 SHA1 b5f4deec2bbe6c0d460591c743626d7d2f422348 SHA256 113d5fef727c34a3254f0556ade3d3f6b0d6069c20a2511dc4ae6409087f1b90 AUX zfs-shutdown 1252 RMD160 449ba23e29486255bd04d54dfe11b77d414ba6d4 SHA1 108d271dfbe86df47f50a3219c5cf839efe4ce92 SHA256 cba63ddf086044c7e041c296ea86f68a1579ac830b8bea56b9f74b4204f96553 DIST zfs-0.6.0-rc9.tar.gz 1989469 RMD160 fef1e4e4f0d122be60e3f5b8322e683b8981bac2 SHA1 fc14d86cd0124fd67d2ac80853f9ae078dee9a0d SHA256 a014475fab410caf209e99b448aeffe0070d1d9fc002fb33dd56f73dba87b1fd -EBUILD zfs-0.6.0_rc9-r3.ebuild 3415 RMD160 88869a9262e951b1e5d1308c4bb65a5657858350 SHA1 0998ba87d772ccd4a7685d7bac183780e1b65baa SHA256 9ee9e35c22501f4916bf98bde742da4c3a71bedfaa01624f1f8a562a2c20c008 -EBUILD zfs-0.6.0_rc9.ebuild 3329 RMD160 fdce6cea007c9eb3074e8953194e1845b466488d SHA1 b1b81fa4e760b334c395a29f88342faf03939c60 SHA256 b862bc880a718a2507399af0f9189df4e398315c5df8514f8660df288a1c456d -EBUILD zfs-9999.ebuild 3408 RMD160 afde50dada70dd4b47032a99185f5858a16c36ab SHA1 4535df1dddfbdd39d260de32f6331f8503b275a1 SHA256 f981fc5dd2496a26b9bc46bd879398c9db3359c9ac2517aaf05681d2c3774169 -MISC ChangeLog 5342 RMD160 dd072c9e79d84cb6c7836928c51ffa49e594b471 SHA1 f2f3f66ee5e516c64f24c95662829f02f29356d9 SHA256 9b99a1669edd2bc9ae883669d64af28d0f69a6ecb793882af9eaedf786ce2b27 +EBUILD zfs-0.6.0_rc9-r3.ebuild 3482 RMD160 50dc5e299ba3f35338b6bf9d84df604551615558 SHA1 a61e956edc744e6ed34d635f3d393f12fa45431d SHA256 edde9422de3e67197c9284b45db22aea547f195012fe116edc287f7881ab6888 +EBUILD zfs-0.6.0_rc9.ebuild 3412 RMD160 1a58bcbd5fa1c59928e51661bb0e50deb41eb6a9 SHA1 b25bbd665d8fe0d4cb899d1e9f91e3cb4682b41f SHA256 d01ecff190fac30889dca5631301bf89656a15d550afdc912d5b7687b8add299 +EBUILD zfs-9999.ebuild 3408 RMD160 00e80e14d02188a0b07974aed36ea583bca62786 SHA1 f8444e67339c4ef7c73aaf4ffafbab1cbb89af8d SHA256 9bc0f5f24ab5cecbfa71745b0cc2d8f4353265dfbf2400281bbb7d686e28b4e3 +MISC ChangeLog 5517 RMD160 d603f1a16e26c542437502edc3dcc24af89267d8 SHA1 c688361ad70f54034b087afc4e2488b75dbe5101 SHA256 27a9aad0ac5a78d3c3b9e4f823ec23b4e99e9955d24ec24df1cd9bb282a545c6 MISC metadata.xml 460 RMD160 49a38cd6f7fb8464c06282672932cb5930e024b2 SHA1 2cb49a2c9bd0c05ee136ead608d7ae9a50663384 SHA256 4f32c18bfc4d75883f198b1166ad4f5d7a95deb11eca99d476f305ed31875e7d diff --git a/sys-fs/zfs/files/bash-completion b/sys-fs/zfs/files/bash-completion new file mode 100644 index 000000000000..1b9428bf8602 --- /dev/null +++ b/sys-fs/zfs/files/bash-completion @@ -0,0 +1,232 @@ +# Copyright (c) 2010, Aneurin Price <aneurin.price@gmail.com> + +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation +# files (the "Software"), to deal in the Software without +# restriction, including without limitation the rights to use, +# copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following +# conditions: + +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. + +__zfs_get_commands() +{ + zfs 2>&1 | awk '/^\t[a-z]/ {print $1}' | uniq +} + +__zfs_get_properties() +{ + zfs get 2>&1 | awk '$2 == "YES" || $2 == "NO" {print $1}'; echo all +} + +__zfs_get_editable_properties() +{ + zfs get 2>&1 | awk '$2 == "YES" {printf("%s=\n", $1)}' +} + +__zfs_get_inheritable_properties() +{ + zfs get 2>&1 | awk '$3 == "YES" {print $1}' +} + +__zfs_list_datasets() +{ + zfs list -H -o name +} + +__zfs_list_filesystems() +{ + zfs list -H -o name -t filesystem +} + +__zfs_list_snapshots() +{ + zfs list -H -o name -t snapshot +} + +__zfs_list_volumes() +{ + zfs list -H -o name -t volume +} + +__zfs_argument_chosen() +{ + for word in $(seq $((COMP_CWORD-1)) -1 2) + do + local prev="${COMP_WORDS[$word]}" + for property in $@ + do + if [ "x$prev" = "x$property" ] + then + return 0 + fi + done + done + return 1 +} + +__zfs_complete_ordered_arguments() +{ + local list1=$1 + local list2=$2 + local cur=$3 + local extra=$4 + if __zfs_argument_chosen $list1 + then + COMPREPLY=($(compgen -W "$list2 $extra" -- "$cur")) + else + COMPREPLY=($(compgen -W "$list1 $extra" -- "$cur")) + fi +} + +__zfs_complete() +{ + local cur prev cmd cmds + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + cmd="${COMP_WORDS[1]}" + cmds=$(__zfs_get_commands) + + if [ "${prev##*/}" = "zfs" ] + then + COMPREPLY=($(compgen -W "$cmds -?" -- "$cur")) + return 0 + fi + + case "${cmd}" in + clone) + __zfs_complete_ordered_arguments "$(__zfs_list_snapshots)" "$(__zfs_list_filesystems) $(__zfs_list_volumes)" $cur + return 0 + ;; + get) + __zfs_complete_ordered_arguments "$(__zfs_get_properties)" "$(__zfs_list_datasets)" "$cur" "-H -r -p" + return 0 + ;; + inherit) + __zfs_complete_ordered_arguments "$(__zfs_get_inheritable_properties)" "$(__zfs_list_datasets)" $cur + return 0 + ;; + list) + if [ "x$prev" = "x-o" ] + then + COMPREPLY=($(compgen -W "$(__zfs_get_properties)" -- "${cur##*,}")) + local existing_opts=$(expr "$cur" : '\(.*,\)') + if [ ! "x$existing_opts" = "x" ] + then + COMPREPLY=( "${COMPREPLY[@]/#/${existing_opts}}" ) + fi + else + COMPREPLY=($(compgen -W "$(__zfs_list_datasets) -H -r -o" -- "$cur")) + fi + return 0 + ;; + promote) + COMPREPLY=($(compgen -W "$(__zfs_list_filesystems)" -- "$cur")) + return 0 + ;; + rollback|send) + COMPREPLY=($(compgen -W "$(__zfs_list_snapshots)" -- "$cur")) + return 0 + ;; + snapshot) + COMPREPLY=($(compgen -W "$(__zfs_list_filesystems) $(__zfs_list_volumes)" -- "$cur")) + return 0 + ;; + set) + __zfs_complete_ordered_arguments "$(__zfs_get_editable_properties)" "$(__zfs_list_filesystems) $(__zfs_list_volumes)" $cur + return 0 + ;; + *) + COMPREPLY=($(compgen -W "$(__zfs_list_datasets)" -- "$cur")) + return 0 + ;; + esac + +} + +__zpool_get_commands() +{ + zpool 2>&1 | awk '/^\t[a-z]/ {print $1}' | uniq +} + +__zpool_get_properties() +{ + zpool get 2>&1 | awk '$2 == "YES" || $2 == "NO" {print $1}'; echo all +} + +__zpool_get_editable_properties() +{ + zpool get 2>&1 | awk '$2 == "YES" {printf("%s=\n", $1)}' +} + +__zpool_list_pools() +{ + zpool list -H -o name +} + +__zpool_complete() +{ + local cur prev cmd cmds + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + cmd="${COMP_WORDS[1]}" + cmds=$(__zpool_get_commands) + + if [ "${prev##*/}" = "zpool" ] + then + COMPREPLY=($(compgen -W "$cmds" -- "$cur")) + return 0 + fi + + case "${cmd}" in + get) + __zfs_complete_ordered_arguments "$(__zpool_get_properties)" "$(__zpool_list_pools)" $cur + return 0 + ;; + import) + if [ "x$prev" = "x-d" ] + then + _filedir -d + else + COMPREPLY=($(compgen -W "$(__zpool_list_pools) -d" -- "$cur")) + fi + return 0 + ;; + set) + __zfs_complete_ordered_arguments "$(__zpool_get_editable_properties)" "$(__zpool_list_pools)" $cur + return 0 + ;; + add|attach|clear|create|detach|offline|online|remove|replace) + local pools="$(__zpool_list_pools)" + if __zfs_argument_chosen $pools + then + _filedir + else + COMPREPLY=($(compgen -W "$pools" -- "$cur")) + fi + return 0 + ;; + *) + COMPREPLY=($(compgen -W "$(__zpool_list_pools)" -- "$cur")) + return 0 + ;; + esac + +} + +complete -F __zfs_complete zfs +complete -o filenames -F __zpool_complete zpool diff --git a/sys-fs/zfs/zfs-0.6.0_rc9-r3.ebuild b/sys-fs/zfs/zfs-0.6.0_rc9-r3.ebuild index 4e9acca2483b..e1117019e010 100644 --- a/sys-fs/zfs/zfs-0.6.0_rc9-r3.ebuild +++ b/sys-fs/zfs/zfs-0.6.0_rc9-r3.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs/zfs-0.6.0_rc9-r3.ebuild,v 1.2 2012/06/25 21:19:41 ryao Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs/zfs-0.6.0_rc9-r3.ebuild,v 1.3 2012/07/01 12:29:44 ryao Exp $ EAPI="4" @@ -8,7 +8,7 @@ AT_M4DIR="config" AUTOTOOLS_AUTORECONF="1" AUTOTOOLS_IN_SOURCE_BUILD="1" -inherit flag-o-matic linux-mod toolchain-funcs autotools-utils +inherit bash-completion-r1 flag-o-matic linux-mod toolchain-funcs autotools-utils if [ ${PV} == "9999" ] ; then inherit git-2 @@ -130,6 +130,8 @@ src_install() { doexe "${FILESDIR}/linuxrc" fi + newbashcomp "${FILESDIR}/bash-completion" zfs + } pkg_postinst() { diff --git a/sys-fs/zfs/zfs-0.6.0_rc9.ebuild b/sys-fs/zfs/zfs-0.6.0_rc9.ebuild index 56b9ed2068c5..7eb180e3d2c1 100644 --- a/sys-fs/zfs/zfs-0.6.0_rc9.ebuild +++ b/sys-fs/zfs/zfs-0.6.0_rc9.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs/zfs-0.6.0_rc9.ebuild,v 1.5 2012/06/18 15:19:14 ryao Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs/zfs-0.6.0_rc9.ebuild,v 1.6 2012/07/01 12:29:44 ryao Exp $ EAPI="4" @@ -8,7 +8,7 @@ AT_M4DIR="config" AUTOTOOLS_AUTORECONF="1" AUTOTOOLS_IN_SOURCE_BUILD="1" -inherit flag-o-matic linux-mod toolchain-funcs autotools-utils +inherit bash-completion-r1 flag-o-matic linux-mod toolchain-funcs autotools-utils if [ ${PV} == "9999" ] ; then inherit git-2 @@ -26,7 +26,7 @@ HOMEPAGE="http://zfsonlinux.org/" LICENSE="CDDL GPL-2" SLOT="0" -IUSE="custom-cflags debug dracut +rootfs test test-suite static-libs" +IUSE="bash-completion custom-cflags debug dracut +rootfs test test-suite static-libs" DEPEND=" =sys-kernel/spl-${PV}* @@ -127,6 +127,8 @@ src_install() { doexe "${FILESDIR}/linuxrc" fi + newbashcomp "${FILESDIR}/bash-completion" zfs + } pkg_postinst() { diff --git a/sys-fs/zfs/zfs-9999.ebuild b/sys-fs/zfs/zfs-9999.ebuild index 82f35e385b05..4059e0764d3b 100644 --- a/sys-fs/zfs/zfs-9999.ebuild +++ b/sys-fs/zfs/zfs-9999.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs/zfs-9999.ebuild,v 1.25 2012/06/25 21:19:41 ryao Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs/zfs-9999.ebuild,v 1.26 2012/07/01 12:29:44 ryao Exp $ EAPI="4" @@ -8,7 +8,7 @@ AT_M4DIR="config" AUTOTOOLS_AUTORECONF="1" AUTOTOOLS_IN_SOURCE_BUILD="1" -inherit flag-o-matic linux-mod toolchain-funcs autotools-utils +inherit bash-completion-r1 flag-o-matic linux-mod toolchain-funcs autotools-utils if [ ${PV} == "9999" ] ; then inherit git-2 @@ -26,7 +26,7 @@ HOMEPAGE="http://zfsonlinux.org/" LICENSE="CDDL GPL-2" SLOT="0" -IUSE="custom-cflags debug dracut +rootfs test test-suite static-libs" +IUSE="bash-completion custom-cflags debug dracut +rootfs test test-suite static-libs" DEPEND=" =sys-kernel/spl-${PV}* @@ -64,9 +64,7 @@ pkg_setup() { MODULES ZLIB_DEFLATE ZLIB_INFLATE" - use rootfs && \ - CONFIG_CHECK="${CONFIG_CHECK} BLK_DEV_INITRD - DEVTMPFS" + use rootfs && CONFIG_CHECK="${CONFIG_CHECK} DEVTMPFS" kernel_is ge 2 6 26 || die "Linux 2.6.26 or newer required" check_extra_config } @@ -86,7 +84,6 @@ src_prepare() { epatch "${FILESDIR}/${P}-remove-pfmalloc-1-of-3.patch" epatch "${FILESDIR}/${P}-remove-pfmalloc-2-of-3.patch" epatch "${FILESDIR}/${P}-remove-pfmalloc-3-of-3.patch" - epatch "${FILESDIR}/${P}-range-lock-caller-allocate.patch" fi autotools-utils_src_prepare @@ -130,6 +127,8 @@ src_install() { doexe "${FILESDIR}/linuxrc" fi + newbashcomp "${FILESDIR}/bash-completion" zfs + } pkg_postinst() { |