From 9f99d31c591f30e8ed07d30b83665743e14356b4 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Tue, 1 Nov 2016 17:17:35 +0000 Subject: [PATCH] bash_completion: fix patchset. --- .../bash_completion-2.3.recipe | 2 +- .../patches/bash_completion-2.3.patchset | 96 +++++++++++++++++++ 2 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 app-shells/bash_completion/patches/bash_completion-2.3.patchset diff --git a/app-shells/bash_completion/bash_completion-2.3.recipe b/app-shells/bash_completion/bash_completion-2.3.recipe index 508bf3dd0..41e566636 100644 --- a/app-shells/bash_completion/bash_completion-2.3.recipe +++ b/app-shells/bash_completion/bash_completion-2.3.recipe @@ -17,7 +17,7 @@ REVISION="2" SOURCE_URI="https://github.com/scop/bash-completion/releases/download/2.3/bash-completion-2.3.tar.xz" CHECKSUM_SHA256="b2e081af317f3da4fff3a332bfdbebeb5514ebc6c2d2a9cf781180acab15e8e9" SOURCE_DIR="bash-completion-$portVersion" -PATCHES="bash_completion-haiku.patch" +PATCHES="bash_completion-$portVersion.patchset" ARCHITECTURES="!any" diff --git a/app-shells/bash_completion/patches/bash_completion-2.3.patchset b/app-shells/bash_completion/patches/bash_completion-2.3.patchset new file mode 100644 index 000000000..543df517e --- /dev/null +++ b/app-shells/bash_completion/patches/bash_completion-2.3.patchset @@ -0,0 +1,96 @@ +From e2a76ee024fcf5ac70ebdd6bf875dd3010c193cc Mon Sep 17 00:00:00 2001 +From: Kostadin Damyanov +Date: Wed, 23 Sep 2015 22:55:52 +0300 +Subject: Add pkgman and finddir support. + + +diff --git a/completions/Makefile.am b/completions/Makefile.am +index 99c283c..9279511 100644 +--- a/completions/Makefile.am ++++ b/completions/Makefile.am +@@ -411,7 +411,10 @@ bashcomp_DATA = 2to3 \ + _yum \ + yum-arch \ + zopfli \ +- zopflipng ++ zopflipng \ ++ pkgman \ ++ finddir ++ + + EXTRA_DIST = $(bashcomp_DATA) + +diff --git a/completions/finddir b/completions/finddir +new file mode 100644 +index 0000000..cf7f6e4 +--- /dev/null ++++ b/completions/finddir +@@ -0,0 +1,17 @@ ++_finddir() ++{ ++ local cur words ++ _init_completion || return ++ ++ COMPREPLY=() ++ cur=${COMP_WORDS[COMP_CWORD]} ++ ++ if [[ "$cur" == -* ]]; then ++ COMPREPLY=( $( compgen -W '-l -v' -- "$cur" ) ) ++ else ++ COMPREPLY=( $( compgen -W '$( finddir -l )' -- "$cur" ) ) ++ fi ++ ++ return 0 ++} && ++complete -F _finddir finddir +diff --git a/completions/pkgman b/completions/pkgman +new file mode 100644 +index 0000000..f1f942f +--- /dev/null ++++ b/completions/pkgman +@@ -0,0 +1,42 @@ ++_pkgman() ++{ ++ local cur words ++ _init_completion || return ++ ++ COMPREPLY=() ++ cur=${COMP_WORDS[COMP_CWORD]} ++ ++ local special i ++ for (( i=0; i < ${#words[@]}-1; i++ )); do ++ if [[ ${words[i]} == @(install|uninstall) ]]; then ++ special=${words[i]} ++ fi ++ done ++ ++ if [[ -n $special ]]; then ++ case $special in ++ install) ++ COMPREPLY=( $( compgen -W "$( pkgman search -a -D | awk 'NR>2 { print $2 }' )" -- "$cur" ) ) ++ return 0 ++ ;; ++ uninstall) ++ COMPREPLY=( $( compgen -W "$( pkgman search -a -i | awk 'NR>2 { print $2 }' )" -- "$cur" ) ) ++ return 0 ++ ;; ++ *) ++ return 0 ++ ;; ++ esac ++ fi ++ ++ if [[ "$cur" == -* ]]; then ++ COMPREPLY=( $( compgen -W '-h --help' -- "$cur" ) ) ++ else ++ COMPREPLY=( $( compgen -W 'full-sync install search \ ++ uninstall update add-repo drop-repo list-repos refresh \ ++ resolve-dependencies' -- "$cur" ) ) ++ fi ++ ++ return 0 ++} && ++complete -F _pkgman pkgman +-- +2.2.2 +