* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2012-02-15 2:16 Christian Ruppert
0 siblings, 0 replies; 37+ messages in thread
From: Christian Ruppert @ 2012-02-15 2:16 UTC (permalink / raw
To: gentoo-commits
commit: 83e767fc1d59776c8a36af4f58d1afd0756fefb3
Author: Christian Ruppert <idl0r <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 15 02:16:07 2012 +0000
Commit: Christian Ruppert <idl0r <AT> gentoo <DOT> org>
CommitDate: Wed Feb 15 02:16:07 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=83e767fc
Make the dist and tag target git compatible
---
Makefile | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/Makefile b/Makefile
index 8d6f04b..62f4ea7 100644
--- a/Makefile
+++ b/Makefile
@@ -18,19 +18,19 @@ install:
"$(DESTDIR)/etc/bash_completion.d/gentoo"
tag:
- svn up ../
- svn cp ../trunk ../tags/release-$(distver)
+ git pull
+ git tag $(distpkg)
@echo
- @echo "tag created remember to check it in"
+ @echo "tag created remember to push it"
@echo
dist: tag
- mkdir -p "$(distpkg)"
- cp AUTHORS COPYING gentoo layman repoman Makefile TODO "$(distpkg)/"
- svn up
- svn2cl -o "$(distpkg)/"ChangeLog
- tar cjf "$(distpkg).tar.bz2" "$(distpkg)"
- rm -fr "$(distpkg)/"
+ git archive --prefix=$(distpkg)/ --format=tar -o $(distpkg).tar $(distpkg)
+ mkdir $(distpkg)/
+ git log > $(distpkg)/ChangeLog
+ tar vfr $(distpkg).tar $(distpkg)/ChangeLog
+ bzip2 $(distpkg).tar
+ rm -rf $(distpkg)/
@echo "success."
dist-upload: dist
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2012-04-24 16:10 Jeremy Olexa
0 siblings, 0 replies; 37+ messages in thread
From: Jeremy Olexa @ 2012-04-24 16:10 UTC (permalink / raw
To: gentoo-commits
commit: eea21f58d292a12141b19fd5ce371cf93941ba7e
Author: Jacek Sowiński <mruwek.gentoo <AT> vcf <DOT> pl>
AuthorDate: Sat Apr 21 23:20:15 2012 +0000
Commit: Jeremy Olexa <darkside <AT> gentoo <DOT> org>
CommitDate: Tue Apr 24 16:09:09 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=eea21f58
Update equery module list drop 'glsa' and 'stats' add 'has' and 'keywords'
--HG--
extra : source : e2d4bcca497f4d1cde9825e1b75db31df5234292
---
gentoo | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/gentoo b/gentoo
index e30256d..73b1c5d 100644
--- a/gentoo
+++ b/gentoo
@@ -1099,7 +1099,7 @@ _equery()
if [[ $j -lt $COMP_CWORD ]]; then
j=$((j + 1))
case $i in
- @(belongs|ch@(anges|eck)|dep@(ends|graph)|files|glsa|list|meta|s@(ize|tats)|uses|which|hasuse|b|c|k|d|g|f|a|h|l|m|s|t|u|w))
+ @(belongs|ch@(anges|eck)|dep@(ends|graph)|files|has?(use)|keywords|list|meta|size|uses|which|b|c|k|d|g|f|a|h|y|l|m|s|u|w))
mode=$i
;;
esac
@@ -1114,11 +1114,11 @@ _equery()
COMPREPLY=($(compgen -W "-q --quiet -C --nocolor -h --help -V --version" -- $cur))
;;
*)
- COMPREPLY=($(compgen -W "belongs changes check depends depgraph files glsa hasuse list meta size stats uses which" -- $cur))
+ COMPREPLY=($(compgen -W "belongs changes check depends depgraph files has hasuse keywords list meta size uses which" -- $cur))
;;
esac
;;
- a|glsa|t|stats)
+ a|has|y|keywords)
# These commands have not been implemented in 'equery' yet ...
echo -n "# Not implemented! "
;;
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2012-04-24 16:10 Jeremy Olexa
0 siblings, 0 replies; 37+ messages in thread
From: Jeremy Olexa @ 2012-04-24 16:10 UTC (permalink / raw
To: gentoo-commits
commit: 2477f682f903bb0fa0e7688f3c0cb0fe6e752de6
Author: Jacek Sowiński <mruwek.gentoo <AT> vcf <DOT> pl>
AuthorDate: Sat Apr 21 17:01:37 2012 +0000
Commit: Jeremy Olexa <darkside <AT> gentoo <DOT> org>
CommitDate: Tue Apr 24 16:09:09 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=2477f682
Update options completion for majority of equery modules
belongs, check, depends, depgraph, files, list, size
---
gentoo | 24 ++++++++++++++++--------
1 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/gentoo b/gentoo
index 1d38106..2ae86f9 100644
--- a/gentoo
+++ b/gentoo
@@ -1139,8 +1139,8 @@ _equery()
-W "dir obj sym dev fifo path conf cmd doc man info"))
;;
-*)
- COMPREPLY=($(compgen -W "--help --timestamp --md5sum
- --type --filter=" -- $cur))
+ COMPREPLY=($(compgen -W "-h --help -m --md5sum -s --timestamp -t
+ --type --tree -f --filter=" -- $cur))
;;
*)
# Only installed packages can have their files listed.
@@ -1155,7 +1155,10 @@ _equery()
if [[ ${prev} == ${mode} || ${prev:0:1} == "-" ]]; then
case "${cur}" in
-*)
- COMPREPLY=($(compgen -W "--help -i --installed -I --exclude-installed -p --portage-tree -o --overlay-tree" -- $cur))
+ COMPREPLY=($(compgen -W "-h --help -d --duplicates -b
+ --missing-binpkgs -f --full-regex -m --mask-reason -I
+ --exclude-installed -o --overlay-tree -p --portage-tree -F
+ --format" -- $cur))
;;
*)
case "${prev}" in
@@ -1188,7 +1191,8 @@ _equery()
then
case $cur in
-*)
- COMPREPLY=($(compgen -W "--help -c --category -e --earlyout" -- $cur))
+ COMPREPLY=($(compgen -W "-h --help -f --full-regex -e
+ --early-out -n --name-only" -- $cur))
;;
*)
COMPREPLY=($(compgen -f -- $cur) \
@@ -1236,7 +1240,8 @@ _equery()
if [[ ${prev} == ${mode} || ${prev:0:1} == "-" ]]; then
case $cur in
-*)
- COMPREPLY=($(compgen -W "--help -U --no-useflags -l --linear" -- $cur))
+ COMPREPLY=($(compgen -W "-h --help -A --no-atom -M --no-mask -U
+ --no-useflags -l --linear --depth" -- $cur))
;;
*)
# Complete on all package names.
@@ -1251,7 +1256,8 @@ _equery()
if [[ ${prev} == ${mode} || ${prev:0:1} == "-" ]]; then
case $cur in
-*)
- COMPREPLY=($(compgen -W "--help -a --all-packages -d --direct -D --indirect" -- $cur))
+ COMPREPLY=($(compgen -W "-h --help -a --all-packages -D
+ --indirect --depth" -- $cur))
;;
*)
case $prev in
@@ -1288,7 +1294,8 @@ _equery()
if [[ ${prev} == ${mode} ]]; then
case $cur in
-*)
- COMPREPLY=($(compgen -W "${COMPREPLY[@]} --help" -- ${cur}))
+ COMPREPLY=($(compgen -W "${COMPREPLY[@]} -h --help -f
+ --full-regex -o --only-failures" -- ${cur}))
;;
*)
# Only installed packages can have their integrity verified.
@@ -1303,7 +1310,8 @@ _equery()
if [[ ${prev} == ${mode} || ${prev:0:1} == "-" ]]; then
case $cur in
-*)
- COMPREPLY=($(compgen -W "--help -b --bytes" -- $cur))
+ COMPREPLY=($(compgen -W "-h --help -b --bytes -f
+ --full-regex" -- $cur))
;;
*)
# Only installed packages can have their size calculated.
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2012-04-24 16:10 Jeremy Olexa
0 siblings, 0 replies; 37+ messages in thread
From: Jeremy Olexa @ 2012-04-24 16:10 UTC (permalink / raw
To: gentoo-commits
commit: 1656f36e346d8d19255291a8d35006a7d15c1d28
Author: Jacek Sowiński <mruwek.gentoo <AT> vcf <DOT> pl>
AuthorDate: Sat Apr 21 17:01:05 2012 +0000
Commit: Jeremy Olexa <darkside <AT> gentoo <DOT> org>
CommitDate: Tue Apr 24 16:09:09 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=1656f36e
#350179 fix the completion for 'uses' and 'which' modules of equery
- fix pkgspec completion
- separate completion for these modules, as they have another sets of
options
---
gentoo | 31 ++++++++++++++++++++++++++-----
1 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/gentoo b/gentoo
index bb253bc..1d38106 100644
--- a/gentoo
+++ b/gentoo
@@ -1200,13 +1200,34 @@ _equery()
COMPREPLY=($(builtin cd ${portdir}/metadata/cache; compgen -W "$(compgen -G '*')" -- $cur))
fi
;;
- @(u?(ses)|w?(hich)))
+ u?(ses))
# Only complete if the previous entry on the command line is not
# a package name.
- if [[ ${prev} == ${mode} ]]; then
- # Complete on all package names.
- _pkgname -A $cur
- COMPREPLY=($(compgen -W "${COMPREPLY[@]} --help" -- ${cur}))
+ if [[ ${prev} == ${mode} || ${prev:0:1} == "-" ]]; then
+ case $cur in
+ -*)
+ COMPREPLY=($(compgen -W "-h --help -a --all" -- $cur))
+ ;;
+ *)
+ # Complete on all package names.
+ _pkgname -A $cur
+ ;;
+ esac
+ fi
+ ;;
+ w?(hich))
+ # Only complete if the previous entry on the command line is not
+ # a package name.
+ if [[ ${prev} == ${mode} || ${prev:0:1} == "-" ]]; then
+ case $cur in
+ -*)
+ COMPREPLY=($(compgen -W "-h --help -m --include-masked" -- $cur))
+ ;;
+ *)
+ # Complete on all package names.
+ _pkgname -A $cur
+ ;;
+ esac
fi
;;
g|depgraph)
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2012-04-24 16:10 Jeremy Olexa
0 siblings, 0 replies; 37+ messages in thread
From: Jeremy Olexa @ 2012-04-24 16:10 UTC (permalink / raw
To: gentoo-commits
commit: 27287b31e3f1819bb52e914228f53771632d7954
Author: Jacek Sowiński <mruwek.gentoo <AT> vcf <DOT> pl>
AuthorDate: Sat Apr 21 21:41:13 2012 +0000
Commit: Jeremy Olexa <darkside <AT> gentoo <DOT> org>
CommitDate: Tue Apr 24 16:09:09 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=27287b31
Completion for `equery changes` 1. There is inconsitency in output of `equery changes --help`: * "Usage" and "examples" give different order of args. * In "Usage" it is: [options] pkgspec * In "examples" it is: pkgspec [options] 2. I chose "examples" approach so: * `equery c <TAB><TAB>` will complete pkgspec * `equery c -<TAB><TAB>` will complete -h and --help * `equery c pkgspec <TAB><TAB>` will complete other options
--HG--
extra : source : 1476935140c182f435d6de80dab035a931d5edb6
---
gentoo | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/gentoo b/gentoo
index e93fd78..e30256d 100644
--- a/gentoo
+++ b/gentoo
@@ -1118,10 +1118,29 @@ _equery()
;;
esac
;;
- c?(hanges)|a|glsa|t|stats)
+ a|glsa|t|stats)
# These commands have not been implemented in 'equery' yet ...
echo -n "# Not implemented! "
;;
+ c?(hanges))
+ # Complete package name only if it is not yet supplied.
+ if [[ ${prev} == ${mode} ]]; then
+ case $cur in
+ -*)
+ COMPREPLY=($(compgen -W "-h --help" -- $cur))
+ ;;
+ *)
+ _pkgname -A $cur
+ ;;
+ esac
+ else
+ case $cur in
+ *)
+ COMPREPLY=($(compgen -W "-h --help -l --latest -f --full --limit --from --to" -- $cur))
+ ;;
+ esac
+ fi
+ ;;
f?(iles))
# Only complete if the previous entry on the command line is not
# a package name.
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2012-04-24 16:10 Jeremy Olexa
0 siblings, 0 replies; 37+ messages in thread
From: Jeremy Olexa @ 2012-04-24 16:10 UTC (permalink / raw
To: gentoo-commits
commit: 60fb879749f0e5d506f2ba4995d815b3d7f3392e
Author: Jacek Sowiński <mruwek.gentoo <AT> vcf <DOT> pl>
AuthorDate: Sat Apr 21 17:47:00 2012 +0000
Commit: Jeremy Olexa <darkside <AT> gentoo <DOT> org>
CommitDate: Tue Apr 24 16:09:09 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=60fb8797
Fix completion for `equery belongs`
1. Remove -c and --category options as they are not present in
`equery belongs --help` output.
2. Make code indentation more readable.
3. "Only complete if the previous entry on the command line is not
a file name." now works properly also with options.
--HG--
extra : source : 9f755f92ba552dcd20d20e473ff6cf5848c27e9e
---
gentoo | 36 +++++++++++-------------------------
1 files changed, 11 insertions(+), 25 deletions(-)
diff --git a/gentoo b/gentoo
index 2ae86f9..e93fd78 100644
--- a/gentoo
+++ b/gentoo
@@ -1177,31 +1177,17 @@ _equery()
b?(elongs))
# Only complete if the previous entry on the command line is not
# a file name.
- if \
- [[ \
- ${prev} == ${mode} || \
- ${prev:0:1} == "-" || \
- ${COMP_WORDS[COMP_CWORD-2]} == "-c" || \
- ${COMP_WORDS[COMP_CWORD-2]} == "--category" \
- ]] && \
- [[ \
- ${prev} != "-c" && \
- ${prev} != "--category" \
- ]]
- then
- case $cur in
- -*)
- COMPREPLY=($(compgen -W "-h --help -f --full-regex -e
- --early-out -n --name-only" -- $cur))
- ;;
- *)
- COMPREPLY=($(compgen -f -- $cur) \
- $(compgen -d -S '/' -- $cur))
- ;;
- esac
- # Are we completing a category?
- elif [[ ${prev} == "-c" || ${prev} == "--category" ]]; then
- COMPREPLY=($(builtin cd ${portdir}/metadata/cache; compgen -W "$(compgen -G '*')" -- $cur))
+ if [[ ${prev} == ${mode} || ${prev:0:1} == "-" ]]; then
+ case $cur in
+ -*)
+ COMPREPLY=($(compgen -W "-h --help -f --full-regex -e
+ --early-out -n --name-only" -- $cur))
+ ;;
+ *)
+ COMPREPLY=($(compgen -f -- $cur) \
+ $(compgen -d -S '/' -- $cur))
+ ;;
+ esac
fi
;;
u?(ses))
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2012-04-24 16:10 Jeremy Olexa
0 siblings, 0 replies; 37+ messages in thread
From: Jeremy Olexa @ 2012-04-24 16:10 UTC (permalink / raw
To: gentoo-commits
commit: 8d7b628117fe61121d952dd6be2e319ab968e720
Author: Jacek Sowiński <mruwek.gentoo <AT> vcf <DOT> pl>
AuthorDate: Tue Apr 24 13:36:03 2012 +0000
Commit: Jeremy Olexa <darkside <AT> gentoo <DOT> org>
CommitDate: Tue Apr 24 16:09:10 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=8d7b6281
Proper calling of _pkgname() in `equery list`
---
gentoo | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/gentoo b/gentoo
index f4e0ee6..a0097f2 100644
--- a/gentoo
+++ b/gentoo
@@ -1191,18 +1191,18 @@ _equery()
case "${cur}" in
-*)
COMPREPLY=($(compgen -W "-h --help -d --duplicates -b
- --missing-binpkgs -f --full-regex -m --mask-reason -I
+ --binpkgs-missing -f --full-regex -m --mask-reason -I
--exclude-installed -o --overlay-tree -p --portage-tree -F
--format" -- $cur))
;;
*)
case "${prev}" in
- -i|--installed)
- _pkgname -I $cur
+ -p|--?(portage|overlay)-tree)
+ _pkgname -A $cur
;;
*)
- # Complete on all package names.
- _pkgname -A $cur
+ # Complete on installed package names by default.
+ _pkgname -I $cur
;;
esac
;;
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2012-04-24 16:10 Jeremy Olexa
0 siblings, 0 replies; 37+ messages in thread
From: Jeremy Olexa @ 2012-04-24 16:10 UTC (permalink / raw
To: gentoo-commits
commit: 2065e70870f370b7d6a3ffe9678a61f5e4852725
Author: Jacek Sowiński <mruwek.gentoo <AT> vcf <DOT> pl>
AuthorDate: Sun Apr 22 00:18:35 2012 +0000
Commit: Jeremy Olexa <darkside <AT> gentoo <DOT> org>
CommitDate: Tue Apr 24 16:09:10 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=2065e708
Preliminary support for `equery keywords`
--HG--
extra : source : a29f54778b77d71486990ff8130848ebbd02acc5
---
gentoo | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/gentoo b/gentoo
index 06da8b8..f4e0ee6 100644
--- a/gentoo
+++ b/gentoo
@@ -1118,10 +1118,6 @@ _equery()
;;
esac
;;
- y|keywords)
- # These commands have not been implemented in 'equery' yet ...
- echo -n "# Not implemented! "
- ;;
c?(hanges))
# Complete package name only if it is not yet supplied.
if [[ ${prev} == ${mode} ]]; then
@@ -1172,6 +1168,22 @@ _equery()
COMPREPLY=($(compgen -W "-h --help -I --exclude-installed -o \
--overlay-tree -p --portage-tree -F --format" -- $cur))
;;
+ y|keywords)
+ # Only complete if the previous entry on the command line is not
+ # a package name.
+ if [[ ${prev} == ${mode} || ${prev:0:1} == "-" ]]; then
+ case "${cur}" in
+ -*)
+ COMPREPLY=($(compgen -W "-h --help -v --version -a --arch -A
+ --align -T --top-position -B --bold -C --color -O --overlays
+ -P --prefix -S --ignore-slot" -- $cur))
+ ;;
+ *)
+ _pkgname -A $cur
+ ;;
+ esac
+ fi
+ ;;
l?(ist))
# Only complete if the previous entry on the command line is not
# a package name.
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2012-04-24 16:10 Jeremy Olexa
0 siblings, 0 replies; 37+ messages in thread
From: Jeremy Olexa @ 2012-04-24 16:10 UTC (permalink / raw
To: gentoo-commits
commit: f6587e2e7793707a5a93a17187a98c78f9817925
Author: Jacek Sowiński <mruwek.gentoo <AT> vcf <DOT> pl>
AuthorDate: Sun Apr 22 00:16:41 2012 +0000
Commit: Jeremy Olexa <darkside <AT> gentoo <DOT> org>
CommitDate: Tue Apr 24 16:09:09 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=f6587e2e
Completion for `equery has` options
--HG--
extra : source : 61ccc1fd1399c57af02ffc5489c55261c043d418
---
gentoo | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/gentoo b/gentoo
index 73b1c5d..06da8b8 100644
--- a/gentoo
+++ b/gentoo
@@ -1118,7 +1118,7 @@ _equery()
;;
esac
;;
- a|has|y|keywords)
+ y|keywords)
# These commands have not been implemented in 'equery' yet ...
echo -n "# Not implemented! "
;;
@@ -1168,6 +1168,10 @@ _equery()
esac
fi
;;
+ a|has)
+ COMPREPLY=($(compgen -W "-h --help -I --exclude-installed -o \
+ --overlay-tree -p --portage-tree -F --format" -- $cur))
+ ;;
l?(ist))
# Only complete if the previous entry on the command line is not
# a package name.
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2012-04-24 16:10 Jeremy Olexa
0 siblings, 0 replies; 37+ messages in thread
From: Jeremy Olexa @ 2012-04-24 16:10 UTC (permalink / raw
To: gentoo-commits
commit: 40e2c50ad20b5b8bc7bae0fcd008af50cd3c8200
Author: Jacek Sowiński <mruwek.gentoo <AT> vcf <DOT> pl>
AuthorDate: Tue Apr 24 14:03:47 2012 +0000
Commit: Jeremy Olexa <darkside <AT> gentoo <DOT> org>
CommitDate: Tue Apr 24 16:09:10 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=40e2c50a
Check options in `equery list` further than just in $prev
--HG--
extra : source : e6a0424d3176b724b00098f21973e76e10cc6405
---
gentoo | 15 ++++++---------
1 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/gentoo b/gentoo
index a0097f2..1ca0334 100644
--- a/gentoo
+++ b/gentoo
@@ -1196,17 +1196,14 @@ _equery()
--format" -- $cur))
;;
*)
- case "${prev}" in
- -p|--?(portage|overlay)-tree)
- _pkgname -A $cur
- ;;
- *)
- # Complete on installed package names by default.
+ if [[ ${COMP_WORDS[@]} =~ -(p|o) || ${COMP_WORDS[@]} =~ --(portage|overlay)-tree ]]; then
+ _pkgname -A $cur
+ else
_pkgname -I $cur
- ;;
- esac
- ;;
+ fi
+ ;;
esac
+ dupa=${COMP_WORDS[@]}
fi
;;
b?(elongs))
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2012-05-06 20:35 Jeremy Olexa
0 siblings, 0 replies; 37+ messages in thread
From: Jeremy Olexa @ 2012-05-06 20:35 UTC (permalink / raw
To: gentoo-commits
commit: b7449cc04fbeed2b786ce7478e79e1e87cc5d8b7
Author: atlaua <luchsmail-gh <AT> yahoo <DOT> com>
AuthorDate: Mon Apr 30 14:44:36 2012 +0000
Commit: Jeremy Olexa <darkside <AT> gentoo <DOT> org>
CommitDate: Sun May 6 20:37:10 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=b7449cc0
Added a completion function for epkginfo.
epkginfo is just a shortcut for equery meta,
so I reused the code for that.
---
gentoo | 49 +++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 41 insertions(+), 8 deletions(-)
diff --git a/gentoo b/gentoo
index 1ca0334..edf90f0 100644
--- a/gentoo
+++ b/gentoo
@@ -1082,6 +1082,24 @@ complete -F _browserconfig browser-config
}
#
+# Helper routine for the subcommand 'meta' of 'equery'
+# (Used two times, by _equery and _epkginfo, therefore in an extra function)
+#
+_equery_meta()
+{
+ local cur="$1"
+
+ case $cur in
+ -*)
+ COMPREPLY=($(compgen -W "--help -h --description -d --herd -H --keywords -k --maintainer -m --useflags -u --upstream -U --xml -x" -- $cur))
+ ;;
+ *)
+ _pkgname -A $cur
+ ;;
+ esac
+}
+
+#
# Bash completion for the Gentoo 'equery' command
#
have equery && {
@@ -1296,14 +1314,7 @@ _equery()
# Only complete if the previous entry on the command line is not
# a package name.
if [[ ${prev} == ${mode} || ${prev:0:1} == "-" ]]; then
- case $cur in
- -*)
- COMPREPLY=($(compgen -W "--help -h --description -d --herd -H --keywords -k --maintainer -m --useflags -u --upstream -U --xml -x" -- $cur))
- ;;
- *)
- _pkgname -A $cur
- ;;
- esac
+ _equery_meta $cur
fi
;;
k|check)
@@ -1364,6 +1375,28 @@ complete -F _equery equery
}
#
+# epkginfo completion
+#
+
+have epkginfo && {
+_epkginfo()
+{
+ local cur prev
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
+
+ # Only complete if the previous entry on the command line is not
+ # a package name.
+ if [[ ${COMP_CWORD} -eq 1 || ${prev:0:1} == "-" ]]; then
+ _equery_meta $cur
+ fi
+
+ return 0
+}
+complete -F _epkginfo epkginfo
+}
+
+#
# ekeyword completion
#
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2012-10-10 2:43 Ryan Hill
0 siblings, 0 replies; 37+ messages in thread
From: Ryan Hill @ 2012-10-10 2:43 UTC (permalink / raw
To: gentoo-commits
commit: a96f5010f825fc9f299096ddd8a271e2491824ce
Author: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 8 11:24:05 2012 +0000
Commit: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
CommitDate: Mon Oct 8 11:35:55 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=a96f5010
Source /usr/share/portage/config/make.globals directly (bug #431034).
As of portage-2.1.11.10/2.2.0_alpha121 the /etc/make.globals symlink no
longer exists (see bug #427862).
---
gentoo | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gentoo b/gentoo
index edf90f0..f533d8b 100644
--- a/gentoo
+++ b/gentoo
@@ -21,7 +21,7 @@ have()
_portdir()
{
(
- source @GENTOO_PORTAGE_EPREFIX@/etc/make.globals 2>/dev/null
+ source @GENTOO_PORTAGE_EPREFIX@/usr/share/portage/config/make.globals 2>/dev/null
source @GENTOO_PORTAGE_EPREFIX@/etc/make.conf 2>/dev/null
echo ${PORTDIR}
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2012-10-10 2:43 Ryan Hill
0 siblings, 0 replies; 37+ messages in thread
From: Ryan Hill @ 2012-10-10 2:43 UTC (permalink / raw
To: gentoo-commits
commit: 84a02aded4ccff613844f868317ad6e204bdb289
Author: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 7 16:46:16 2012 +0000
Commit: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
CommitDate: Sun Oct 7 16:46:16 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=84a02ade
Add a basic gitignore.
---
.gitignore | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..f6b6303
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,11 @@
+*~
+*.swp
+*.tmp
+
+*.bz2
+*.tar
+
+*.diff
+*.orig
+*.patch
+*.rej
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2012-10-10 2:43 Ryan Hill
0 siblings, 0 replies; 37+ messages in thread
From: Ryan Hill @ 2012-10-10 2:43 UTC (permalink / raw
To: gentoo-commits
commit: 5760ed3e83158ab70dc43de5bbf21431f3f1ecd4
Author: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 8 11:58:14 2012 +0000
Commit: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
CommitDate: Mon Oct 8 12:01:08 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=5760ed3e
Add support for /etc/portage/make.conf (bug #424777).
---
gentoo | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/gentoo b/gentoo
index f533d8b..82aef7a 100644
--- a/gentoo
+++ b/gentoo
@@ -23,6 +23,7 @@ _portdir()
(
source @GENTOO_PORTAGE_EPREFIX@/usr/share/portage/config/make.globals 2>/dev/null
source @GENTOO_PORTAGE_EPREFIX@/etc/make.conf 2>/dev/null
+ source @GENTOO_PORTAGE_EPREFIX@/etc/portage/make.conf 2>/dev/null
echo ${PORTDIR}
if [[ $1 == '-o' ]] ; then
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2012-10-11 5:01 Ryan Hill
0 siblings, 0 replies; 37+ messages in thread
From: Ryan Hill @ 2012-10-11 5:01 UTC (permalink / raw
To: gentoo-commits
commit: 8609efe8432a76300d7208b16c19a7305b96aa8a
Author: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 11 04:48:30 2012 +0000
Commit: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
CommitDate: Thu Oct 11 05:03:47 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=8609efe8
Add support for md5 cache format (bug #431576).
(Based on a patch by Jacek Sowiński)
Now that the main portage tree is using the md5-cache format by default
we need to be sure we're checking both locations.
Also clean up some bad indentation and useless line continuations.
---
gentoo | 121 +++++++++++++++++++++++++++++++++++++---------------------------
1 files changed, 70 insertions(+), 51 deletions(-)
diff --git a/gentoo b/gentoo
index 82aef7a..04563dd 100644
--- a/gentoo
+++ b/gentoo
@@ -104,16 +104,20 @@ _pkgname()
))
# When we've completed most of the name, also display the version for
# possible completion.
- if [[ ${#COMPREPLY[@]} -le 1 || ${cur:${#cur}-1:1} == "-" ]] &&
- [[ ${cur} != */ ]]; then
- # The portage cache is appropriate to complete specific versions from.
- COMPREPLY=(${COMPREPLY[@]} $(\
- for pd in ${portdir} ; do \
- if [[ -d ${pd}/metadata/cache ]] ; then \
- builtin cd ${pd}/metadata/cache; \
- compgen -W "$(compgen -G "${cur}*")" -- "${cur}" ; \
- fi ; \
- done))
+ if [[ ${#COMPREPLY[@]} -le 1 || ${cur:${#cur}-1:1} == "-" ]] \
+ && [[ ${cur} != */ ]]; then
+ # Use the portage cache to complete specific versions from
+ COMPREPLY=(${COMPREPLY[@]} $(
+ for pd in ${portdir}; do
+ if [[ -d ${pd}/metadata/md5-cache ]]; then
+ builtin cd ${pd}/metadata/md5-cache
+ compgen -W "$(compgen -G "${cur}*")" -- "${cur}"
+ elif [[ -d ${pd}/metadata/cache ]]; then
+ builtin cd ${pd}/metadata/cache
+ compgen -W "$(compgen -G "${cur}*")" -- "${cur}"
+ fi
+ done
+ ))
fi
else
# 1. Collect all the categories among ${portdir}
@@ -129,14 +133,19 @@ _pkgname()
local words=$(echo -e ${w} | sort -u)
COMPREPLY=($(compgen -W "$words" -- $cur))
- if [[ ${#COMPREPLY[@]} == 1 ]]; then
- COMPREPLY=($(compgen -W "$(\
- for pd in ${portdir} ; do \
- if [[ -d ${pd}/metadata/cache ]] ; then
- builtin cd ${pd}/metadata/cache; \
- compgen -G "$COMPREPLY*" ; \
- fi ; \
- done)" -- $cur))
+
+ if [[ ${#COMPREPLY[@]} == 1 ]]; then
+ COMPREPLY=($(compgen -W "$(
+ for pd in ${portdir}; do
+ if [[ -d ${pd}/metadata/md5-cache ]]; then
+ builtin cd ${pd}/metadata/md5-cache
+ compgen -G "$COMPREPLY*"
+ elif [[ -d ${pd}/metadata/cache ]]; then
+ builtin cd ${pd}/metadata/cache
+ compgen -G "$COMPREPLY*"
+ fi
+ done
+ )" -- $cur))
fi
fi
@@ -516,29 +525,33 @@ _emerge()
COMPREPLY=( ${words} )
# Complete on the specific versions (if appropriate).
- if [[ ${#COMPREPLY[@]} -le 1 ]] ; then
- COMPREPLY=($(\
- for pd in ${portdir} ; do \
- if [[ -d ${pd}/metadata/cache ]] ; then
- builtin cd ${pd}/metadata/cache; \
- compgen ${prepend} -G "${cur}*" -- "${cur}" ; \
- else \
- builtin cd ${pd} ; \
- local cat="${cur%/*}" ; \
- local pkg="$(echo ${cur%-[0-9]*}*)" ; \
- pkg="${pkg##*/}" ; \
- for x in ${cat}/${pkg}/*.ebuild ; do \
- [[ -f "${x}" ]] || continue ; \
- x="${x/${pkg}\/}" ; \
- if [[ ${cond:0:1} == "'" ]] || \
- [[ ${cond:0:1} == '"' ]] ; then
- echo "${c}${x%*.ebuild}" ; \
+ # TODO - see if we can use _pkgname
+ if [[ ${#COMPREPLY[@]} -le 1 ]]; then
+ COMPREPLY=($(
+ for pd in ${portdir}; do
+ if [[ -d ${pd}/metadata/md5-cache ]]; then
+ builtin cd ${pd}/metadata/md5-cache
+ compgen ${prepend} -G "${cur}*" -- "${cur}"
+ elif [[ -d ${pd}/metadata/cache ]]; then
+ builtin cd ${pd}/metadata/cache
+ compgen ${prepend} -G "${cur}*" -- "${cur}"
+ else
+ builtin cd ${pd}
+ local cat="${cur%/*}"
+ local pkg="$(echo ${cur%-[0-9]*}*)"
+ pkg="${pkg##*/}"
+ for x in ${cat}/${pkg}/*.ebuild; do
+ [[ -f "${x}" ]] || continue
+ x="${x/${pkg}\/}"
+ if [[ ${cond:0:1} == "'" ]] || [[ ${cond:0:1} == '"' ]]; then
+ echo "${c}${x%*.ebuild}"
else
- echo "${x%*.ebuild}" ; \
- fi ; \
- done ; \
- fi ; \
- done))
+ echo "${x%*.ebuild}"
+ fi
+ done
+ fi
+ done
+ ))
else
COMPREPLY=($(compgen ${prepend} -W "${words}" -- $cur))
fi
@@ -585,17 +598,23 @@ _emerge()
COMPREPLY=($(compgen ${prepend} -W "${words}" -- ${cur}))
if [[ ${#COMPREPLY[@]} -le 1 ]]; then
- # Now complete on the specific versions.
- words="$(\
- for pd in ${portdir} ; do \
- if [[ -d ${pd}/metadata/cache ]] ; then \
- builtin cd ${pd}/metadata/cache; \
- for i in */${cur}*; do \
- [[ -f $i ]] && echo ${i##*/}; \
- done ; \
- fi ; \
- done)"
- COMPREPLY=($(compgen ${prepend} -W "${words}" -- "${cur}"))
+ # Now complete on the specific versions.
+ words="$(
+ for pd in ${portdir}; do
+ if [[ -d ${pd}/metadata/md5-cache ]]; then
+ builtin cd ${pd}/metadata/md5-cache
+ for i in */${cur}*; do
+ [[ -f $i ]] && echo ${i##*/}
+ done
+ elif [[ -d ${pd}/metadata/cache ]]; then
+ builtin cd ${pd}/metadata/cache
+ for i in */${cur}*; do
+ [[ -f $i ]] && echo ${i##*/}
+ done
+ fi
+ done
+ )"
+ COMPREPLY=($(compgen ${prepend} -W "${words}" -- "${cur}"))
fi
fi
return 0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2012-10-21 9:57 Ryan Hill
0 siblings, 0 replies; 37+ messages in thread
From: Ryan Hill @ 2012-10-21 9:57 UTC (permalink / raw
To: gentoo-commits
commit: 9c42e4346e7342d20e4a04a85646043de4d9e2de
Author: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 21 09:49:12 2012 +0000
Commit: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
CommitDate: Sun Oct 21 09:49:12 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=9c42e434
Rewrite repoman completion.
- use _parse_help rather than a hardcoded list of options
- use _get_comp_words_by_ref and _split_longopt for proper handling of
options requiring arguments
- fix --commitmsgfile to complete on filenames
- add proper completions for --mode and --vcs
---
repoman | 60 +++++++++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 45 insertions(+), 15 deletions(-)
diff --git a/repoman b/repoman
index c13d334..a4fb080 100644
--- a/repoman
+++ b/repoman
@@ -2,33 +2,63 @@
#
# $Id$
#
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
# repoman completion by Jeremy Olexa <darkside@gentoo.org>
+# rewrite by Ryan Hill <dirtyepic@gentoo.org>
_repoman()
{
- local cur
+ local cur prev opts modes split=false
COMPREPLY=()
- cur=`_get_cword`
+ opts="$(_parse_help ${COMP_WORDS[0]}) --commitmsg --commitmsgfile"
+ modes="ci commit fix full help manifest manifest-check scan"
- case "$cur" in
+ _get_comp_words_by_ref -n = cur prev
+ _split_longopt && split=true
+
+ case $prev in
+ -h|--help|help|-m|--commitmsg|-V|--version)
+ return 0
+ ;;
+ --commitmsgfile)
+ _filedir
+ return 0
+ ;;
+ --digest|--if-modified)
+ COMPREPLY=( $(compgen -W 'y n' -- "$cur") )
+ return 0
+ ;;
+ --echangelog)
+ COMPREPLY=( $(compgen -W 'y n force' -- "$cur") )
+ return 0
+ ;;
+ --mode)
+ COMPREPLY=( $(compgen -W "${modes}" -- "$cur") )
+ return 0
+ ;;
+ --vcs)
+ COMPREPLY=( $(compgen -W 'cvs svn git bzr hg' -- "$cur") )
+ return 0
+ ;;
+ esac
+
+ $split && return 0
+
+ case $cur in
-*)
- COMPREPLY=( $( compgen -W '-h --help -m -M -p --pretend -q --quiet -f \
- --force -v --verbose -V --version -x --xmlparse -i --ignore-arches -I \
- --ignore-masked -d --include-dev --without-mask --mode=' -- $cur ) )
- ;;
+ COMPREPLY=( $(compgen -W "$opts" -- "$cur") )
+ return 0
+ ;;
*)
- if [ $COMP_CWORD -eq 1 ]; then
- COMPREPLY=( $( compgen -W 'ci commit fix full help manifest scan' \
- -- $cur ) )
- fi
- ;;
+ COMPREPLY=( $(compgen -W "$modes" -- "$cur") )
+ return 0
+ ;;
esac
return 0
-
}
-complete -F _repoman -o filenames repoman
+
+complete -F _repoman repoman
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2012-10-22 0:51 Ryan Hill
0 siblings, 0 replies; 37+ messages in thread
From: Ryan Hill @ 2012-10-22 0:51 UTC (permalink / raw
To: gentoo-commits
commit: 6a9662fd54d22f36062279886686e84b79928f2d
Author: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 21 23:03:48 2012 +0000
Commit: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
CommitDate: Mon Oct 22 00:55:01 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=6a9662fd
Add modelines and retab.
---
gentoo | 199 +++++++++++++++++++++++++++++++--------------------------------
layman | 115 ++++++++++++++++++------------------
repoman | 87 ++++++++++++++--------------
3 files changed, 200 insertions(+), 201 deletions(-)
diff --git a/gentoo b/gentoo
index 04563dd..1e58fa9 100644
--- a/gentoo
+++ b/gentoo
@@ -1937,107 +1937,106 @@ complete -F _metagen metagen
have rc-service && {
_rc_service() {
- local cur prev numwords opts
- local words i x filename
- local action actionpos
- COMPREPLY=()
- cur="${COMP_WORDS[COMP_CWORD]}"
- prev="${COMP_WORDS[COMP_CWORD-1]}"
- numwords=${#COMP_WORDS[*]}
-
- if [[ ${prev} == '>' || ${prev} == '<' ]] ; then
- COMPREPLY=($(compgen -f -- ${cur}))
- return 0
- fi
-
- # find action
- for x in ${COMP_LINE} ; do
- if [[ ${x} =~ --(list|exists|resolve) ]] || \
- [[ ${x} =~ -(l|e|r) ]]
- then
- action=${x}
- break
- fi
- done
- if [[ -n ${action} ]]; then
- for ((i = 0; i < ${numwords}; i++ )); do
- if [[ ${COMP_WORDS[${i}]} == "${action}" ]]; then
- actionpos=${i}
- break
- fi
- done
-
- for ((i = 1; i < ${numwords}; i++ )); do
- if [[ ! ${COMP_WORDS[$i]} == -* ]]; then
- break
- fi
- done
- fi
-
- if [[ ${COMP_CWORD} -eq 3 ]]; then
- return 1
- fi
-
- # check if an option was typed
- if [[ ${cur} == -* ]]; then
- if [[ ${cur} == --* ]]; then
- opts="--list --exists --resolve"
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- return 0
- elif [[ ${cur} == -* ]]; then
- opts="-l -e -r"
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- return 0
- fi
-
-
- # NOTE: This slows things down!
- # (Adapted from bash_completion by Ian Macdonald <ian@caliban.org>)
- # This removes any options from the list of completions that have
- # already been specified on the command line.
- COMPREPLY=($(echo "${COMP_WORDS[@]}" | \
- (while read -d ' ' i; do
- [[ -z ${i} ]] && continue
- # flatten array with spaces on either side,
- # otherwise we cannot grep on word boundaries of
- # first and last word
- COMPREPLY=" ${COMPREPLY[@]} "
- # remove word from list of completions
- COMPREPLY=(${COMPREPLY/ ${i%% *} / })
- done
- echo ${COMPREPLY[@]})))
-
- return 0
- # if no option typed
- else
- if [[ ${COMP_CWORD} -eq 1 ]]; then # if first word typed
- words="`rc-service -l | grep ^${cur}`" # complete for init scripts
- COMPREPLY=($(for i in ${words} ; do \
- [[ ${i} == ${cur}* ]] && echo ${i} ; \
- done))
- return 0
- elif [[ ${COMP_CWORD} -eq 2 ]] && [[ ${prev} != -* ]]; then # if second word typed and we didn't type in a function
- filename=`rc-service -r ${prev}`
- opts=`cat ${filename} | grep "^\w*()" | sed "s/().*$//"` # Greps the functions included in the init script
- if [[ "x${opts}" == "x" ]] ; then # if no options found loosen the grep algorhythm
- opts=`cat ${filename} | grep "\w*()" | sed "s/().*$//"`
- fi
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- return 0
- fi
- fi
- if [[ ${action} == '--exists' ]] || [[ ${action} == '-e' ]] || \
- [[ ${action} == '--resolve' ]] || [[ ${action} == '-r' ]]; then
- words="`rc-service -l | grep ^${cur}`"
- COMPREPLY=($(for i in ${words} ; do \
- [[ ${i} == ${cur}* ]] && echo ${i} ; \
- done))
- return 0
- fi
-
+ local cur prev numwords opts
+ local words i x filename
+ local action actionpos
+ COMPREPLY=()
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
+ numwords=${#COMP_WORDS[*]}
+
+ if [[ ${prev} == '>' || ${prev} == '<' ]] ; then
+ COMPREPLY=($(compgen -f -- ${cur}))
+ return 0
+ fi
+
+ # find action
+ for x in ${COMP_LINE} ; do
+ if [[ ${x} =~ --(list|exists|resolve) ]] || \
+ [[ ${x} =~ -(l|e|r) ]]
+ then
+ action=${x}
+ break
+ fi
+ done
+ if [[ -n ${action} ]]; then
+ for ((i = 0; i < ${numwords}; i++ )); do
+ if [[ ${COMP_WORDS[${i}]} == "${action}" ]]; then
+ actionpos=${i}
+ break
+ fi
+ done
+
+ for ((i = 1; i < ${numwords}; i++ )); do
+ if [[ ! ${COMP_WORDS[$i]} == -* ]]; then
+ break
+ fi
+ done
+ fi
+
+ if [[ ${COMP_CWORD} -eq 3 ]]; then
+ return 1
+ fi
+
+ # check if an option was typed
+ if [[ ${cur} == -* ]]; then
+ if [[ ${cur} == --* ]]; then
+ opts="--list --exists --resolve"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
+ elif [[ ${cur} == -* ]]; then
+ opts="-l -e -r"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
+ fi
+
+
+ # NOTE: This slows things down!
+ # (Adapted from bash_completion by Ian Macdonald <ian@caliban.org>)
+ # This removes any options from the list of completions that have
+ # already been specified on the command line.
+ COMPREPLY=($(echo "${COMP_WORDS[@]}" | \
+ (while read -d ' ' i; do
+ [[ -z ${i} ]] && continue
+ # flatten array with spaces on either side,
+ # otherwise we cannot grep on word boundaries of
+ # first and last word
+ COMPREPLY=" ${COMPREPLY[@]} "
+ # remove word from list of completions
+ COMPREPLY=(${COMPREPLY/ ${i%% *} / })
+ done
+ echo ${COMPREPLY[@]})))
+
+ return 0
+ # if no option typed
+ else
+ if [[ ${COMP_CWORD} -eq 1 ]]; then # if first word typed
+ words="`rc-service -l | grep ^${cur}`" # complete for init scripts
+ COMPREPLY=($(for i in ${words} ; do \
+ [[ ${i} == ${cur}* ]] && echo ${i} ; \
+ done))
+ return 0
+ elif [[ ${COMP_CWORD} -eq 2 ]] && [[ ${prev} != -* ]]; then # if second word typed and we didn't type in a function
+ filename=`rc-service -r ${prev}`
+ opts=`cat ${filename} | grep "^\w*()" | sed "s/().*$//"` # Greps the functions included in the init script
+ if [[ "x${opts}" == "x" ]] ; then # if no options found loosen the grep algorhythm
+ opts=`cat ${filename} | grep "\w*()" | sed "s/().*$//"`
+ fi
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
+ fi
+ fi
+ if [[ ${action} == '--exists' ]] || [[ ${action} == '-e' ]] || \
+ [[ ${action} == '--resolve' ]] || [[ ${action} == '-r' ]]; then
+ words="`rc-service -l | grep ^${cur}`"
+ COMPREPLY=($(for i in ${words} ; do \
+ [[ ${i} == ${cur}* ]] && echo ${i} ; \
+ done))
+ return 0
+ fi
+
return 0
}
complete -F _rc_service rc-service
}
-
-# vim: set ft=sh tw=80 sw=4 et :
+# vim: ft=sh:et:ts=4:sw=4:tw=80
diff --git a/layman b/layman
index c3457db..0463f9a 100644
--- a/layman
+++ b/layman
@@ -2,7 +2,7 @@
#
# $Id$
#
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
#
# Originally licensed as 'public-domain'
@@ -10,66 +10,65 @@
have layman && {
- _layman()
- {
- local cur prev opts r_overlays l_overlays
- opts="-a --add -d --delete -s --sync -i --info -S --sync-all -L --list \
- -l --list-local -f --fetch -n --nofetch -p --priority -c --config \
- -o --overlays -v --verbose -q --quiet -N --nocolor -Q --quietness \
- -k --nocheck --debug --debug-level --debug-verbose --debug-methods \
- --debug-classes --debug-variables --debug-class-vars --debug-nocolor"
+ _layman()
+ {
+ local cur prev opts r_overlays l_overlays
+ opts="-a --add -d --delete -s --sync -i --info -S --sync-all -L --list \
+ -l --list-local -f --fetch -n --nofetch -p --priority -c --config \
+ -o --overlays -v --verbose -q --quiet -N --nocolor -Q --quietness \
+ -k --nocheck --debug --debug-level --debug-verbose --debug-methods \
+ --debug-classes --debug-variables --debug-class-vars --debug-nocolor"
- r_overlays="$(layman -LkN 2>/dev/null | grep '(source' | awk '{print $2}')"
- l_overlays="$(layman -lkN 2>/dev/null | grep '(source' | awk '{print $2}')"
- ls_overlays="${l_overlays} ALL"
+ r_overlays="$(layman -LkN 2>/dev/null | grep '(source' | awk '{print $2}')"
+ l_overlays="$(layman -lkN 2>/dev/null | grep '(source' | awk '{print $2}')"
+ ls_overlays="${l_overlays} ALL"
- COMPREPLY=()
+ COMPREPLY=()
- cur="${COMP_WORDS[COMP_CWORD]}"
- prev="${COMP_WORDS[COMP_CWORD-1]}"
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]]
- then
- COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
- return 0
- fi
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]]
+ then
+ COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
+ return 0
+ fi
- case "${prev}" in
- -a|--add)
- COMPREPLY=($(compgen -W "${r_overlays}" -- ${cur}))
- return 0
- ;;
- -d|--delete)
- COMPREPLY=($(compgen -W "${l_overlays}" -- "${cur}"))
- return 0
- ;;
- -s|--sync)
- COMPREPLY=($(compgen -W "${ls_overlays}" -- "${cur}"))
- return 0
- ;;
- -i|--info)
- COMPREPLY=($(compgen -W "${r_overlays}" -- "${cur}"))
- return 0
- ;;
- -p|--priority)
- COMPREPLY=($(compgen -W "$(seq 0 100)" -- "${cur}"))
- return 0
- ;;
- -Q|--quietness)
- COMPREPLY=($(compgen -W "$(seq 0 4)" -- "${cur}"))
- return 0
- ;;
- --debug-level)
- COMPREPLY=($(compgen -W "$(seq 0 10)" -- "${cur}"))
- return 0
- ;;
- --debug-verbose)
- COMPREPLY=($(compgen -W "$(seq 1 3)" -- "${cur}"))
- return 0
- ;;
- esac
- }
- complete -F _layman layman
+ case "${prev}" in
+ -a|--add)
+ COMPREPLY=($(compgen -W "${r_overlays}" -- ${cur}))
+ return 0
+ ;;
+ -d|--delete)
+ COMPREPLY=($(compgen -W "${l_overlays}" -- "${cur}"))
+ return 0
+ ;;
+ -s|--sync)
+ COMPREPLY=($(compgen -W "${ls_overlays}" -- "${cur}"))
+ return 0
+ ;;
+ -i|--info)
+ COMPREPLY=($(compgen -W "${r_overlays}" -- "${cur}"))
+ return 0
+ ;;
+ -p|--priority)
+ COMPREPLY=($(compgen -W "$(seq 0 100)" -- "${cur}"))
+ return 0
+ ;;
+ -Q|--quietness)
+ COMPREPLY=($(compgen -W "$(seq 0 4)" -- "${cur}"))
+ return 0
+ ;;
+ --debug-level)
+ COMPREPLY=($(compgen -W "$(seq 0 10)" -- "${cur}"))
+ return 0
+ ;;
+ --debug-verbose)
+ COMPREPLY=($(compgen -W "$(seq 1 3)" -- "${cur}"))
+ return 0
+ ;;
+ esac
+ }
+ complete -F _layman layman
}
-
-# vim: set ft=sh tw=80 sw=4 et :
+# vim: ft=sh:et:ts=4:sw=4:tw=80
diff --git a/repoman b/repoman
index a4fb080..addf238 100644
--- a/repoman
+++ b/repoman
@@ -10,55 +10,56 @@
_repoman()
{
- local cur prev opts modes split=false
+ local cur prev opts modes split=false
- COMPREPLY=()
- opts="$(_parse_help ${COMP_WORDS[0]}) --commitmsg --commitmsgfile"
- modes="ci commit fix full help manifest manifest-check scan"
+ COMPREPLY=()
+ opts="$(_parse_help ${COMP_WORDS[0]}) --commitmsg --commitmsgfile"
+ modes="ci commit fix full help manifest manifest-check scan"
- _get_comp_words_by_ref -n = cur prev
- _split_longopt && split=true
+ _get_comp_words_by_ref -n = cur prev
+ _split_longopt && split=true
- case $prev in
- -h|--help|help|-m|--commitmsg|-V|--version)
- return 0
- ;;
- --commitmsgfile)
- _filedir
- return 0
- ;;
- --digest|--if-modified)
- COMPREPLY=( $(compgen -W 'y n' -- "$cur") )
- return 0
- ;;
- --echangelog)
- COMPREPLY=( $(compgen -W 'y n force' -- "$cur") )
- return 0
- ;;
- --mode)
- COMPREPLY=( $(compgen -W "${modes}" -- "$cur") )
- return 0
- ;;
- --vcs)
- COMPREPLY=( $(compgen -W 'cvs svn git bzr hg' -- "$cur") )
- return 0
- ;;
- esac
+ case $prev in
+ -h|--help|help|-m|--commitmsg|-V|--version)
+ return 0
+ ;;
+ --commitmsgfile)
+ _filedir
+ return 0
+ ;;
+ --digest|--if-modified)
+ COMPREPLY=( $(compgen -W 'y n' -- "$cur") )
+ return 0
+ ;;
+ --echangelog)
+ COMPREPLY=( $(compgen -W 'y n force' -- "$cur") )
+ return 0
+ ;;
+ --mode)
+ COMPREPLY=( $(compgen -W "${modes}" -- "$cur") )
+ return 0
+ ;;
+ --vcs)
+ COMPREPLY=( $(compgen -W 'cvs svn git bzr hg' -- "$cur") )
+ return 0
+ ;;
+ esac
- $split && return 0
+ $split && return 0
- case $cur in
- -*)
- COMPREPLY=( $(compgen -W "$opts" -- "$cur") )
- return 0
- ;;
- *)
- COMPREPLY=( $(compgen -W "$modes" -- "$cur") )
- return 0
- ;;
- esac
+ case $cur in
+ -*)
+ COMPREPLY=( $(compgen -W "$opts" -- "$cur") )
+ return 0
+ ;;
+ *)
+ COMPREPLY=( $(compgen -W "$modes" -- "$cur") )
+ return 0
+ ;;
+ esac
- return 0
+ return 0
}
complete -F _repoman repoman
+# vim: ft=sh:et:ts=4:sw=4:tw=80
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2012-10-22 3:37 Ryan Hill
0 siblings, 0 replies; 37+ messages in thread
From: Ryan Hill @ 2012-10-22 3:37 UTC (permalink / raw
To: gentoo-commits
commit: 06eab778510f2c40adb5c87efe974ca1035aaa7f
Author: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 22 03:40:53 2012 +0000
Commit: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
CommitDate: Mon Oct 22 03:40:53 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=06eab778
Clean up metagen completion.
---
gentoo | 34 +++++++++++++++-------------------
1 files changed, 15 insertions(+), 19 deletions(-)
diff --git a/gentoo b/gentoo
index 1e58fa9..d15745f 100644
--- a/gentoo
+++ b/gentoo
@@ -1906,34 +1906,30 @@ _epm() {
complete -o filenames -F _epm epm
}
-#
-# metagen completion
-#
-
-have metagen && {
+have metagen &&
_metagen() {
local cur prev opts
COMPREPLY=()
- cur="${COMP_WORDS[COMP_CWORD]}"
- prev="${COMP_WORDS[COMP_CWORD-1]}"
- opts="-h --help -H -e -n -m -d -l -o -f -v -q -Q"
-
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
- COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
- return 0
- fi
+ _get_comp_words_by_ref cur prev
+ opts="$(_parse_help ${COMP_WORDS[0]})"
- case "${prev}" in
- -H|-e|-n|-d|-l|-o)
- COMPREPLY=()
+ case $prev in
+ -h|--help|--version)
+ return 0
;;
- *)
- COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
+ -H|-e|-n|-d|-l)
+ return 0
+ ;;
+ -o)
+ _filedir
+ return 0
;;
esac
+
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
}
complete -F _metagen metagen
-}
have rc-service && {
_rc_service() {
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2012-10-24 3:42 Ryan Hill
0 siblings, 0 replies; 37+ messages in thread
From: Ryan Hill @ 2012-10-24 3:42 UTC (permalink / raw
To: gentoo-commits
commit: 2cc4bd2f3296c33565f8fc147e2617df5bc77332
Author: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 24 03:44:05 2012 +0000
Commit: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
CommitDate: Wed Oct 24 03:44:05 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=2cc4bd2f
Remove debugging variable.
https://bugs.gentoo.org/show_bug.cgi?id=431578#c2
---
gentoo | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/gentoo b/gentoo
index d15745f..ac93a02 100644
--- a/gentoo
+++ b/gentoo
@@ -1241,7 +1241,6 @@ _equery()
fi
;;
esac
- dupa=${COMP_WORDS[@]}
fi
;;
b?(elongs))
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2012-10-24 3:42 Ryan Hill
0 siblings, 0 replies; 37+ messages in thread
From: Ryan Hill @ 2012-10-24 3:42 UTC (permalink / raw
To: gentoo-commits
commit: fac5f13d465a4b31af653919c49d9b5b2f19e8f1
Author: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 24 03:45:53 2012 +0000
Commit: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
CommitDate: Wed Oct 24 03:45:53 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=fac5f13d
Add myself to AUTHORS.
---
AUTHORS | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/AUTHORS b/AUTHORS
index 9a3d71a..083c1f2 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,6 +1,7 @@
Maintainers
===========
Jeremy Olexa <darkside@gentoo.org>
+Ryan Hill <dirtyepic@gentoo.org>
Previous Maintainers
====================
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2012-10-24 4:01 Ryan Hill
0 siblings, 0 replies; 37+ messages in thread
From: Ryan Hill @ 2012-10-24 4:01 UTC (permalink / raw
To: gentoo-commits
commit: 0abd60101f2358537e39381973d51f86ada264d5
Author: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 24 04:05:31 2012 +0000
Commit: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
CommitDate: Wed Oct 24 04:05:31 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=0abd6010
Create annotated tags.
---
Makefile | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 62f4ea7..e8f87cd 100644
--- a/Makefile
+++ b/Makefile
@@ -19,9 +19,9 @@ install:
tag:
git pull
- git tag $(distpkg)
+ git tag -a $(distpkg) -m "tag $(distpkg)"
@echo
- @echo "tag created remember to push it"
+ @echo "created tag $(distpkg) - remember to push it"
@echo
dist: tag
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2012-11-03 5:51 Ryan Hill
0 siblings, 0 replies; 37+ messages in thread
From: Ryan Hill @ 2012-11-03 5:51 UTC (permalink / raw
To: gentoo-commits
commit: da5fba4f2bc976c573bf658e05fe0f854796dbf6
Author: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 3 05:52:22 2012 +0000
Commit: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
CommitDate: Sat Nov 3 05:52:22 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=da5fba4f
Make layman completion work again.
Sometime in the last three years the output of layman changed and broke
the overlay parsing. Also updated options, fixed handling of opts
containing "=" with bash-4, and cleaned up a bunch of stuff.
---
layman | 93 +++++++++++++++++++++++++++++++---------------------------------
1 files changed, 45 insertions(+), 48 deletions(-)
diff --git a/layman b/layman
index 0463f9a..40219f8 100644
--- a/layman
+++ b/layman
@@ -9,66 +9,63 @@
# Originally written by: Peter "Link" Sterk <link@penguindevelopment.org>
-have layman && {
- _layman()
- {
- local cur prev opts r_overlays l_overlays
- opts="-a --add -d --delete -s --sync -i --info -S --sync-all -L --list \
- -l --list-local -f --fetch -n --nofetch -p --priority -c --config \
- -o --overlays -v --verbose -q --quiet -N --nocolor -Q --quietness \
- -k --nocheck --debug --debug-level --debug-verbose --debug-methods \
- --debug-classes --debug-variables --debug-class-vars --debug-nocolor"
+have layman &&
+_layman() {
+ local cur prev opts r_overlays l_overlays splitopt
- r_overlays="$(layman -LkN 2>/dev/null | grep '(source' | awk '{print $2}')"
- l_overlays="$(layman -lkN 2>/dev/null | grep '(source' | awk '{print $2}')"
- ls_overlays="${l_overlays} ALL"
+ COMPREPLY=()
- COMPREPLY=()
+ opts="--version -h --help -a --add -d --delete -s --sync -i --info
+ -S --sync-all -L --list -l --list-local -n --nofetch -p --priority
+ -c --config -O --overlay_defs -o --overlays -v --verbose -q --quiet
+ -N --nocolor -Q --quietness -W --width -k --nocheck --debug-level"
+ r_overlays="$(layman -LkNq 2>/dev/null | grep -v '^$' | cut -d' ' -f3)"
+ l_overlays="$(layman -lkNq 2>/dev/null | grep -v '^$' | cut -d' ' -f3)"
+ splitopt=false
- cur="${COMP_WORDS[COMP_CWORD]}"
- prev="${COMP_WORDS[COMP_CWORD-1]}"
+ _get_comp_words_by_ref -n = cur prev
+ _split_longopt && splitopt=true
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]]
- then
- COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
+ case ${prev} in
+ --version|-h|--help|-W|--width|-o|--overlays)
+ # these end processing or require an arg we can't complete on
return 0
- fi
-
- case "${prev}" in
- -a|--add)
- COMPREPLY=($(compgen -W "${r_overlays}" -- ${cur}))
- return 0
;;
- -d|--delete)
- COMPREPLY=($(compgen -W "${l_overlays}" -- "${cur}"))
- return 0
+ -a|--add|-i|--info)
+ COMPREPLY=( $(compgen -W "${r_overlays}" -- "${cur}") )
+ return 0
;;
- -s|--sync)
- COMPREPLY=($(compgen -W "${ls_overlays}" -- "${cur}"))
- return 0
+ -d|--delete)
+ COMPREPLY=( $(compgen -W "${l_overlays}" -- "${cur}") )
+ return 0
;;
- -i|--info)
- COMPREPLY=($(compgen -W "${r_overlays}" -- "${cur}"))
- return 0
+ -s|--sync)
+ COMPREPLY=( $(compgen -W "${l_overlays} ALL" -- "${cur}") )
+ return 0
;;
- -p|--priority)
- COMPREPLY=($(compgen -W "$(seq 0 100)" -- "${cur}"))
- return 0
+ -p|--priority)
+ # this seems excessive
+ COMPREPLY=( $(compgen -W "$(seq 0 100)" -- "${cur}") )
+ return 0
;;
- -Q|--quietness)
- COMPREPLY=($(compgen -W "$(seq 0 4)" -- "${cur}"))
- return 0
+ -Q|--quietness)
+ COMPREPLY=( $(compgen -W "$(seq 0 4)" -- "${cur}") )
+ return 0
;;
- --debug-level)
- COMPREPLY=($(compgen -W "$(seq 0 10)" -- "${cur}"))
- return 0
+ --debug-level)
+ COMPREPLY=( $(compgen -W "$(seq 0 10)" -- "${cur}") )
+ return 0
;;
- --debug-verbose)
- COMPREPLY=($(compgen -W "$(seq 1 3)" -- "${cur}"))
- return 0
+ -c|--config|-O|--overlay_defs)
+ _filedir
+ return 0
;;
- esac
- }
- complete -F _layman layman
+ esac
+
+ $splitopt && return 0
+
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
}
+complete -F _layman layman
+
# vim: ft=sh:et:ts=4:sw=4:tw=80
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2013-07-30 1:36 Ryan Hill
0 siblings, 0 replies; 37+ messages in thread
From: Ryan Hill @ 2013-07-30 1:36 UTC (permalink / raw
To: gentoo-commits
commit: 454d3250f82f1bc29d0f27b386dd63d54cd2e0de
Author: Alexander Tsoy <alexander <AT> tsoy <DOT> me>
AuthorDate: Tue Jul 30 01:45:41 2013 +0000
Commit: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
CommitDate: Tue Jul 30 01:45:41 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=454d3250
Support bash-completion-2.1 (bug #477024).
- Do not use deprecated have() function.
- Move gentoo_style_init completion in separate file. It doesn't support
dynamic loading so it should be installed in compatdir.
- Cleanup spaces at the end of lines.
---
gentoo | 189 ++++++++++++++++--------------------------------------
gentoo-style-init | 27 ++++++++
layman | 3 +-
repoman | 4 +-
4 files changed, 87 insertions(+), 136 deletions(-)
diff --git a/gentoo b/gentoo
index ac93a02..a15a08b 100644
--- a/gentoo
+++ b/gentoo
@@ -5,15 +5,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
-# also defined in bash_completion proper however, will produce command
-# not found warnings when this is only enabled "locally" so we define it
-# here as well.
-have()
-{
- unset -v have
- PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin type $1 >&/dev/null && have="yes"
-}
-
#
# Retrieve PORTDIR/PORTDIR_OVERLAY location from user's make.conf or, if it
# is not defined there, from make.globals.
@@ -169,7 +160,7 @@ _pkgname()
#
# This is an helper function for completion of "-o <list>" / "--option=<list>"
# kind of command lines options.
-#
+#
# Usage: _list_compgen <current> <sep> <item1>[<sep><item2> ...]
# - <current>: what we have so far on the command line
# - <sep>: the separator character used in lists
@@ -177,12 +168,12 @@ _pkgname()
# Returns: the function outputs each possible completion (one per line),
# and returns 0. Typical usage is COMPREPLY=($(_list_compgen ...)).
#
-# Note: items must not contain the <sep> character (no backslash escaping has
+# Note: items must not contain the <sep> character (no backslash escaping has
# been implemented).
#
_list_compgen()
{
- # Read the three parameters.
+ # Read the three parameters.
local current="${1}" ; shift
local sep="${1}" ; shift
local items="${*}"
@@ -193,7 +184,7 @@ _list_compgen()
# Setting it to 0 means "never list anything" (only suggest <sep>).
# Setting it to a positive value N means "list up to N possible items, and
# only suggest <sep> if there are more".
- # It is probably not worth a parameter, thus it will defaults to my
+ # It is probably not worth a parameter, thus it will defaults to my
# prefered setting (1) if not already defined in the environment.
local max_others_number=${max_others_number:-1}
@@ -309,7 +300,6 @@ _list_compgen()
#
# emerge completion command
#
-have emerge && {
_emerge()
{
local c cur prev curword numwords opts cond prepend
@@ -480,7 +470,7 @@ _emerge()
[[ -z "${COMPREPLY}" ]] && _pkgname_only ${cur} @GENTOO_PORTAGE_EPREFIX@/var/db/pkg
return 0
fi
-
+
# Check for conditional.
cond="${cur%%[A-Za-z0-9]*}"
cur="${cur:${#cond}}"
@@ -490,7 +480,7 @@ _emerge()
else
c="${cond}"
fi
-
+
# Handle cases where a conditional is specified.
if [[ -n "${cond}" ]]; then
if [[ -n "${cur}" ]]; then
@@ -523,7 +513,7 @@ _emerge()
words=$(echo -ne ${w} | sort | uniq)
COMPREPLY=( ${words} )
-
+
# Complete on the specific versions (if appropriate).
# TODO - see if we can use _pkgname
if [[ ${#COMPREPLY[@]} -le 1 ]]; then
@@ -583,7 +573,7 @@ _emerge()
done)"
COMPREPLY=($(compgen -W "${words}" -- "${cur}"))
fi
-
+
# If all else fails, try to complete on package names without the
# category being specified.
if [[ -z "${COMPREPLY}" ]]; then
@@ -706,14 +696,12 @@ _emerge()
fi
return 0
-}
+} &&
complete -o filenames -F _emerge emerge
-}
#
# ebuild completion command
#
-have ebuild && {
_ebuild()
{
local cur opts
@@ -736,39 +724,12 @@ _ebuild()
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
fi
return 0
-}
+} &&
complete -o filenames -F _ebuild ebuild
-}
-
-#
-# Gentoo init.d completion
-#
-
-_gentoo_style_init()
-{
- local script="${COMP_WORDS[0]}"
- local cur="${COMP_WORDS[$COMP_CWORD]}"
-
- if [[ ( -f "${script}" || -h "${script}" ) && -r "${script}" ]] \
- && [[ "${script}" != *.sh ]] \
- && [[ "$(head -n 1 "${script}")" = "#!/sbin/runscript" ]]
- then
- [[ $COMP_CWORD -gt 1 ]] && return 1
- COMPREPLY=($(opts="start stop status restart pause zap ineed needsme iuse usesme broken"; \
- eval "$(grep '^opts=' "${script}")"; echo "${opts}"))
- [[ -n "$COMPREPLY" ]] || COMPREPLY=(start stop restart zap)
- COMPREPLY=($(compgen -W "${COMPREPLY[*]}" -- "${cur}"))
- else
- COMPREPLY=($(compgen -o default -- "${cur}"))
- fi
- return 0
-}
-complete -F _gentoo_style_init @GENTOO_PORTAGE_EPREFIX@/etc/init.d/*
#
# rc completion command
#
-have rc && {
_rc()
{
local cur
@@ -778,14 +739,12 @@ _rc()
COMPREPLY=($(compgen -W "$(for i in @GENTOO_PORTAGE_EPREFIX@/etc/runlevels/*; do echo ${i##*/}; done)" -- $cur))
fi
return 0
-}
+} &&
complete -F _rc rc
-}
#
# rc-status completion command
#
-have rc-status && {
_rcstatus()
{
local cur
@@ -802,14 +761,12 @@ _rcstatus()
unset COMPREPLY
fi
return 0
-}
+} &&
complete -F _rcstatus rc-status
-}
#
# rc-update completion command
#
-have rc-update && {
_rcupdate()
{
local cur show
@@ -838,14 +795,12 @@ _rcupdate()
fi
fi
return 0
-}
+} &&
complete -F _rcupdate rc-update
-}
#
# gcc-config completion command
#
-have gcc-config && {
_gcc_config() {
local cur prev opts
COMPREPLY=()
@@ -879,14 +834,12 @@ _gcc_config() {
$(gcc-config -l | sed -r -e 's/(\[([^]]*)\]) //g')" -- ${cur}) )
;;
esac
-}
+} &&
complete -F _gcc_config gcc-config
-}
#
# distcc-config completion command
#
-have distcc-config && {
_distccconfig()
{
local cur curword numwords opts
@@ -916,14 +869,12 @@ _distccconfig()
fi
COMPREPLY=($(compgen -W "${opts}" | grep ^$cur))
return 0
-}
+} &&
complete -F _distccconfig distcc-config
-}
#
# java-config completion command
#
-have java-config && {
_javaconfig()
{
local cur prev curword numwords opts args arg spec flag sedcmd grepcmd
@@ -1070,14 +1021,12 @@ _javaconfig()
fi
COMPREPLY=($(compgen $nospace -W "${opts}" -- ${cur}))
return 0
-}
+} &&
complete $nospace -F _javaconfig java-config
-}
#
# browser-config completion command
#
-have browser-config && {
_browserconfig()
{
local cur prev
@@ -1097,9 +1046,8 @@ _browserconfig()
unset COMPREPLY
fi
return 0
-}
+} &&
complete -F _browserconfig browser-config
-}
#
# Helper routine for the subcommand 'meta' of 'equery'
@@ -1122,7 +1070,6 @@ _equery_meta()
#
# Bash completion for the Gentoo 'equery' command
#
-have equery && {
_equery()
{
local cur prev mode portdir i j
@@ -1157,7 +1104,7 @@ _equery()
esac
;;
c?(hanges))
- # Complete package name only if it is not yet supplied.
+ # Complete package name only if it is not yet supplied.
if [[ ${prev} == ${mode} ]]; then
case $cur in
-*)
@@ -1186,7 +1133,7 @@ _equery()
return 0
fi
case $cur in
- --f*)
+ --f*)
# don't handle --filter= with others to avoid space after the "="
COMPREPLY=($(compgen -P "--filter=" \
-W "dir obj sym dev fifo path conf cmd doc man info"))
@@ -1317,7 +1264,7 @@ _equery()
*)
case $prev in
-a|--all-packages)
- # Complete on all package names.
+ # Complete on all package names.
_pkgname -A $cur
;;
*)
@@ -1389,15 +1336,13 @@ _equery()
;;
esac
return 0
-}
+} &&
complete -F _equery equery
-}
#
# epkginfo completion
#
-have epkginfo && {
_epkginfo()
{
local cur prev
@@ -1411,15 +1356,13 @@ _epkginfo()
fi
return 0
-}
+} &&
complete -F _epkginfo epkginfo
-}
#
# ekeyword completion
#
-have ekeyword && {
_ekeyword()
{
local cur portdir archl_s archl_u archl_r archl_m arch
@@ -1451,15 +1394,13 @@ _ekeyword()
_filedir 'ebuild'
;;
esac
-}
+} &&
complete -o filenames -F _ekeyword ekeyword
-}
#
# portageq completion
#
-have portageq && {
_portageq() {
local cur prev opts
COMPREPLY=()
@@ -1482,7 +1423,7 @@ _portageq() {
pkgdir \
portdir_overlay \
distdir"
-
+
if [[ $COMP_CWORD -eq 1 ]] ; then
# would always be correct, but it's pretty slow...
#COMPREPLY=($(compgen -W "$(portageq | grep '^ [[:lower:]]' | \
@@ -1495,22 +1436,22 @@ _portageq() {
config*|vdb_path|gentoo_mirrors|*dir*)
COMPREPLY=()
;;
-
+
# this also isn't the fastest, but I welcome an alternative method
envvar)
COMPREPLY=($(compgen -W "$(env -i emerge -v --info | \
sed -n -e '/^[[:upper:]].*=".*"/s/^\(.*\)=".*$/\1/p')" -- ${cur}))
;;
-
+
*v@(isible|ersion)|match)
COMPREPLY=($(compgen $nospace -W '/' -- $cur))
;;
-
+
# $prev is a path, so complete on category/package
*/*)
local x a=0
for x in ${COMP_WORDS[@]} ; do
- # This is the only one
+ # This is the only one
if [[ "${x}" == "all_best_visible" ]] ; then
a=1
break
@@ -1530,18 +1471,15 @@ _portageq() {
_pkgname -A $cur
# fi
fi
- ;;
- esac
-}
-
+ ;;
+ esac
+} &&
complete -F _portageq portageq
-}
#
# webapp-config completion
#
-have webapp-config && {
_webapp_complete_appver()
{
local x proot ibase cur="$2"
@@ -1561,7 +1499,7 @@ _webapp_complete_appver()
fi ; \
done)" -- ${cur}))
;;
-
+
# complete on uninstalled
uninstalled)
COMPREPLY=($(compgen -W "$(\
@@ -1572,7 +1510,7 @@ _webapp_complete_appver()
fi ; \
done)" -- ${cur}))
;;
-
+
# all
all)
COMPREPLY=($(compgen -W "$(\
@@ -1580,7 +1518,7 @@ _webapp_complete_appver()
[[ -d "${x}" ]] && echo "${x##*/}" ; \
done)" -- ${cur}))
;;
-
+
# complete on version
*)
[[ -d "${proot}/$1" ]] || return 1
@@ -1618,7 +1556,7 @@ _webapp_config()
COMPREPLY=($(compgen -W "${opts} ${actions}" -- ${cur}))
return 0
fi
-
+
case "${prev}" in
--bug-report|-p|--pretend)
COMPREPLY=($(compgen -W "${opts} ${actions}" -- ${cur}))
@@ -1640,11 +1578,11 @@ _webapp_config()
--list-unused-installs)
_webapp_complete_appver uninstalled ${cur}
;;
-
+
--list-installs|--show-postinst)
_webapp_complete_appver all ${cur}
;;
-
+
# hrm... anyone know a better way to reliably do this?
-h|--host)
local x
@@ -1653,12 +1591,12 @@ _webapp_config()
[[ -d "${x}" ]] && echo "${x##*/}" ; \
done)" -- ${cur}))
;;
-
+
--virtual*)
COMPREPLY=($(compgen -W "server-owned config-owned virtual" \
-- ${cur}))
;;
-
+
-d|--dir)
local host x i=0
# see if --host has been specified, and if so, get the value
@@ -1676,7 +1614,7 @@ _webapp_config()
eval $(. @GENTOO_PORTAGE_EPREFIX@/etc/vhosts/webapp-config ; \
echo host="${VHOST_HOSTNAME:-localhost}")
fi
-
+
COMPREPLY=($(compgen -W "$(\
for x in ${hostroot}${host}/* ; do \
[[ -d "${x}" ]] && echo "${x}" ; \
@@ -1698,11 +1636,9 @@ _webapp_config()
_webapp_complete_appver all ${cur}
;;
esac
-}
+} &&
complete -F _webapp_config webapp-config
-}
-have revdep-rebuild && {
_revdep_rebuild() {
local cur prev numwords opts
local words i x
@@ -1715,7 +1651,7 @@ _revdep_rebuild() {
if [[ ${prev} == '>' || ${prev} == '<' ]] ; then
COMPREPLY=($(compgen -f -- ${cur}))
return 0
- fi
+ fi
# find action
for ((i = 0; i < ${numwords}; i++ )); do
@@ -1740,7 +1676,7 @@ _revdep_rebuild() {
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
fi
return 0
- fi
+ fi
if [[ ${action} == '--library' ]] || [[ ${action} == '-L' ]] ; then
if [[ "${cur}" == */* ]]; then
COMPREPLY=( $(builtin cd @GENTOO_PORTAGE_EPREFIX@/lib; compgen -f -- "${cur}") )
@@ -1749,11 +1685,9 @@ _revdep_rebuild() {
fi
fi
return 0
-}
+} &&
complete -F _revdep_rebuild revdep-rebuild
-}
-have splat && {
_splat() {
local cur prev opts
COMPREPLY=()
@@ -1776,11 +1710,9 @@ _splat() {
COMPREPLY=($(compgen -W "${COMPREPLY[@]} ${opts}" -- ${cur}))
;;
esac
-}
+} &&
complete -o filenames -F _splat splat
-}
-have euse && {
_euse() {
local cur prev opts sopts use portdir
COMPREPLY=()
@@ -1830,11 +1762,9 @@ _euse() {
COMPREPLY=($(compgen -W "${use}" -- ${cur}))
fi
esac
-}
+} &&
complete -F _euse euse
-}
-have glsa-check && {
_glsa_check() {
local cur opts
COMPREPLY=()
@@ -1859,11 +1789,9 @@ _glsa_check() {
fi
COMPREPLY=($(compgen -W "${opts} $(< ${ROOT}/tmp/gc.out)" -- ${cur}))
-}
+} &&
complete -F _glsa_check glsa-check
-}
-have epm && {
_epm() {
local cur prev opts
COMPREPLY=()
@@ -1901,11 +1829,9 @@ _epm() {
fi
;;
esac
-}
+} &&
complete -o filenames -F _epm epm
-}
-have metagen &&
_metagen() {
local cur prev opts
COMPREPLY=()
@@ -1927,10 +1853,9 @@ _metagen() {
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
-}
+} &&
complete -F _metagen metagen
-have rc-service && {
_rc_service() {
local cur prev numwords opts
local words i x filename
@@ -1943,7 +1868,7 @@ _rc_service() {
if [[ ${prev} == '>' || ${prev} == '<' ]] ; then
COMPREPLY=($(compgen -f -- ${cur}))
return 0
- fi
+ fi
# find action
for x in ${COMP_LINE} ; do
@@ -1961,7 +1886,7 @@ _rc_service() {
break
fi
done
-
+
for ((i = 1; i < ${numwords}; i++ )); do
if [[ ! ${COMP_WORDS[$i]} == -* ]]; then
break
@@ -1972,7 +1897,7 @@ _rc_service() {
if [[ ${COMP_CWORD} -eq 3 ]]; then
return 1
fi
-
+
# check if an option was typed
if [[ ${cur} == -* ]]; then
if [[ ${cur} == --* ]]; then
@@ -1985,7 +1910,7 @@ _rc_service() {
return 0
fi
-
+
# NOTE: This slows things down!
# (Adapted from bash_completion by Ian Macdonald <ian@caliban.org>)
# This removes any options from the list of completions that have
@@ -2029,9 +1954,9 @@ _rc_service() {
done))
return 0
fi
-
-return 0
-}
+
+ return 0
+} &&
complete -F _rc_service rc-service
-}
+
# vim: ft=sh:et:ts=4:sw=4:tw=80
diff --git a/gentoo-style-init b/gentoo-style-init
new file mode 100644
index 0000000..e800c8c
--- /dev/null
+++ b/gentoo-style-init
@@ -0,0 +1,27 @@
+# Gentoo init.d completion
+#
+# $Id$
+#
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+_gentoo_style_init()
+{
+ local script="${COMP_WORDS[0]}"
+ local cur="${COMP_WORDS[$COMP_CWORD]}"
+
+ if [[ ( -f "${script}" || -h "${script}" ) && -r "${script}" ]] \
+ && [[ "${script}" != *.sh ]] \
+ && [[ "$(head -n 1 "${script}")" = "#!/sbin/runscript" ]]
+ then
+ [[ $COMP_CWORD -gt 1 ]] && return 1
+ COMPREPLY=($(opts="start stop status restart pause zap ineed needsme iuse usesme broken"; \
+ eval "$(grep '^opts=' "${script}")"; echo "${opts}"))
+ [[ -n "$COMPREPLY" ]] || COMPREPLY=(start stop restart zap)
+ COMPREPLY=($(compgen -W "${COMPREPLY[*]}" -- "${cur}"))
+ else
+ COMPREPLY=($(compgen -o default -- "${cur}"))
+ fi
+ return 0
+}
+complete -F _gentoo_style_init @GENTOO_PORTAGE_EPREFIX@/etc/init.d/*
diff --git a/layman b/layman
index 40219f8..81811b0 100644
--- a/layman
+++ b/layman
@@ -9,7 +9,6 @@
# Originally written by: Peter "Link" Sterk <link@penguindevelopment.org>
-have layman &&
_layman() {
local cur prev opts r_overlays l_overlays splitopt
@@ -65,7 +64,7 @@ _layman() {
$splitopt && return 0
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
-}
+} &&
complete -F _layman layman
# vim: ft=sh:et:ts=4:sw=4:tw=80
diff --git a/repoman b/repoman
index addf238..b9dac93 100644
--- a/repoman
+++ b/repoman
@@ -59,7 +59,7 @@ _repoman()
esac
return 0
-}
-
+} &&
complete -F _repoman repoman
+
# vim: ft=sh:et:ts=4:sw=4:tw=80
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2013-08-04 19:21 Ryan Hill
0 siblings, 0 replies; 37+ messages in thread
From: Ryan Hill @ 2013-08-04 19:21 UTC (permalink / raw
To: gentoo-commits
commit: d6cf3a0eca4abc011936b31704e60858746abcdb
Author: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 4 19:31:41 2013 +0000
Commit: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
CommitDate: Sun Aug 4 19:31:41 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=d6cf3a0e
Credit Alexander.
---
AUTHORS | 3 +++
1 file changed, 3 insertions(+)
diff --git a/AUTHORS b/AUTHORS
index 083c1f2..6a6be53 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -35,6 +35,9 @@ Peter "Link" Sterk <link@penguindevelopment.org>
- original layman completion (licensed under public-domain)
- http://www.penguindevelopment.org/
+Alexander Tsoy <alexander@tsoy.me>
+ - bash-completion-2 porting and ebuild updates
+
Note
====
Modifications were made in a version of this script found in
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2013-08-04 19:21 Ryan Hill
0 siblings, 0 replies; 37+ messages in thread
From: Ryan Hill @ 2013-08-04 19:21 UTC (permalink / raw
To: gentoo-commits
commit: bf91db09a102544196b21cd792ac423262656a9a
Author: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 4 18:53:24 2013 +0000
Commit: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
CommitDate: Sun Aug 4 18:53:24 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=bf91db09
Add support for repos.conf (bug #478444).
Newer portage versions use repos.conf to set paths to different repos
rather than PORTDIR/PORTDIR_OVERLAY. This adds a parser for these
ini-style config files.
---
gentoo | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 94 insertions(+), 15 deletions(-)
diff --git a/gentoo b/gentoo
index a15a08b..f262fcc 100644
--- a/gentoo
+++ b/gentoo
@@ -2,25 +2,104 @@
#
# $Id$
#
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
+# Retrieve PORTDIR/PORTDIR_OVERLAY location.
#
-# Retrieve PORTDIR/PORTDIR_OVERLAY location from user's make.conf or, if it
-# is not defined there, from make.globals.
+# In order of highest to lowest priority:
+# /etc/portage/repos.conf{,/*}
+# /usr/share/portage/config/repos.conf
+# /etc/portage/make.conf
+# /etc/make.conf
+# /usr/share/portage/config/make.globals
#
-_portdir()
-{
- (
- source @GENTOO_PORTAGE_EPREFIX@/usr/share/portage/config/make.globals 2>/dev/null
- source @GENTOO_PORTAGE_EPREFIX@/etc/make.conf 2>/dev/null
- source @GENTOO_PORTAGE_EPREFIX@/etc/portage/make.conf 2>/dev/null
-
- echo ${PORTDIR}
- if [[ $1 == '-o' ]] ; then
- echo ${PORTDIR_OVERLAY}
- fi
- )
+# The first two files are in repos.conf format and must be parsed for the
+# variable "location". The rest are make.conf style and are simply sourced
+# for PORTDIR and PORTDIR_OVERLAY. While repos.conf overrides any value of
+# PORTDIR set in make.conf, PORTDIR_OVERLAY is incremental (combined across
+# available sources).
+#
+# This would be a hell of a lot simpler if we used portageq, but also about
+# 500 times slower.
+_portdir() {
+ if [[ -e @GENTOO_PORTAGE_EPREFIX@/usr/share/portage/config/repos.conf ]]; then
+ if [[ ${1} == '-o' ]]; then
+ for overlayname in $(_parsereposconf -l); do
+ overlaypath+=($(_parsereposconf ${overlayname} location))
+ done
+
+ source @GENTOO_PORTAGE_EPREFIX@/etc/make.conf 2>/dev/null
+ source @GENTOO_PORTAGE_EPREFIX@/etc/portage/make.conf 2>/dev/null
+
+ overlaypath+=(${PORTDIR_OVERLAY})
+
+ # strip out duplicates
+ overlaypath=($(printf "%s\n" "${overlaypath[@]}" | sort -u))
+
+ echo "${overlaypath[@]}"
+ else
+ mainreponame=$(_parsereposconf DEFAULT main-repo)
+ mainrepopath=$(_parsereposconf ${mainreponame} location)
+
+ echo "${mainrepopath}"
+ fi
+ else
+ source @GENTOO_PORTAGE_EPREFIX@/usr/share/portage/config/make.globals 2>/dev/null
+ source @GENTOO_PORTAGE_EPREFIX@/etc/make.conf 2>/dev/null
+ source @GENTOO_PORTAGE_EPREFIX@/etc/portage/make.conf 2>/dev/null
+
+ echo "${PORTDIR}"
+
+ if [[ ${1} == '-o' ]]; then
+ echo "${PORTDIR_OVERLAY}"
+ fi
+ fi
+}
+
+# _parsereposconf [-l] <repo> <variable>
+# -l lists available repos
+_parsereposconf() {
+ local f insection line section v value var
+
+ for f in @GENTOO_PORTAGE_EPREFIX@/usr/share/portage/config/repos.conf \
+ @GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf \
+ @GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf/*.conf; do
+
+ if [[ -f ${f} ]]; then
+ insection=0
+
+ while read line; do
+ # skip comments and blank lines
+ [[ -z ${line} || ${line:0:1} == "#" ]] && continue
+
+ if [[ ${insection} == 1 && ${line} =~ ^\[.*\]$ ]]; then
+ # End of the section we were interested in so stop
+ secname+=(${line//[(\[|\])]/}) # record name for -l
+ 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 [[ ${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}"
+ fi
+ continue
+ done < "${f}"
+ fi
+ done
+
+ if [[ ${1} == -l ]]; then
+ echo "${secname[@]}"
+ else
+ echo "${v}"
+ fi
}
# like _pkgname but completes on package names only (no category)
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2013-08-12 16:43 Ryan Hill
0 siblings, 0 replies; 37+ messages in thread
From: Ryan Hill @ 2013-08-12 16:43 UTC (permalink / raw
To: gentoo-commits
commit: e799368d0bbee27a5fa0e685f50fa2dd40505d10
Author: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 12 16:52:57 2013 +0000
Commit: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
CommitDate: Mon Aug 12 16:52:57 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=e799368d
Style and performance improvements based on suggestions by Steven J. Long.
---
gentoo | 57 ++++++++++++++++++++++++++++-----------------------------
1 file changed, 28 insertions(+), 29 deletions(-)
diff --git a/gentoo b/gentoo
index 5266731..0e54841 100644
--- a/gentoo
+++ b/gentoo
@@ -1,7 +1,5 @@
# Gentoo Linux Bash Shell Command Completion
#
-# $Id$
-#
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
@@ -23,8 +21,10 @@
# This would be a hell of a lot simpler if we used portageq, but also about
# 500 times slower.
_portdir() {
+ local mainreponame mainrepopath overlayname overlaypath
+
if [[ -e @GENTOO_PORTAGE_EPREFIX@/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
@@ -51,7 +51,7 @@ _portdir() {
echo "${PORTDIR}"
- if [[ ${1} == '-o' ]]; then
+ if [[ ${1} == -o ]]; then
echo "${PORTDIR_OVERLAY}"
fi
fi
@@ -66,33 +66,32 @@ _parsereposconf() {
@GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf \
@GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf/*.conf; do
- if [[ -f ${f} ]]; then
- insection=0
+ [[ -f ${f} ]] || continue
+ insection=0
- while read line; do
- # skip comments and blank lines
- [[ -z ${line} || ${line:0:1} == "#" ]] && continue
+ while read -r line; do
+ # skip comments and blank lines
+ [[ -z ${line} || ${line} == '#'* ]] && continue
- if [[ ${insection} == 1 && ${line} =~ ^\[.*\]$ ]]; then
- # End of the section we were interested in so stop
- secname+=(${line//[(\[|\])]/}) # record name for -l
- 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 [[ ${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}"
- fi
- continue
- done < "${f}"
- fi
+ if [[ ${insection} == 1 && ${line} == '['*']' ]]; then
+ # End of the section we were interested in so stop
+ secname+=(${line//[(\[|\])]/}) # record name for -l
+ 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 [[ ${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}
+ fi
+ continue
+ done < "${f}"
done
if [[ ${1} == -l ]]; then
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2013-08-12 16:43 Ryan Hill
0 siblings, 0 replies; 37+ messages in thread
From: Ryan Hill @ 2013-08-12 16:43 UTC (permalink / raw
To: gentoo-commits
commit: 496329ce9e22cd4d0a91e3039224e58e3be4857b
Author: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 12 16:47:00 2013 +0000
Commit: Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
CommitDate: Mon Aug 12 16:47:00 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=496329ce
Fix whitespace.
---
gentoo | 144 ++++++++++++++++++++++++++++++++---------------------------------
1 file changed, 72 insertions(+), 72 deletions(-)
diff --git a/gentoo b/gentoo
index f262fcc..5266731 100644
--- a/gentoo
+++ b/gentoo
@@ -23,83 +23,83 @@
# This would be a hell of a lot simpler if we used portageq, but also about
# 500 times slower.
_portdir() {
- if [[ -e @GENTOO_PORTAGE_EPREFIX@/usr/share/portage/config/repos.conf ]]; then
- if [[ ${1} == '-o' ]]; then
- for overlayname in $(_parsereposconf -l); do
- overlaypath+=($(_parsereposconf ${overlayname} location))
- done
-
- source @GENTOO_PORTAGE_EPREFIX@/etc/make.conf 2>/dev/null
- source @GENTOO_PORTAGE_EPREFIX@/etc/portage/make.conf 2>/dev/null
-
- overlaypath+=(${PORTDIR_OVERLAY})
-
- # strip out duplicates
- overlaypath=($(printf "%s\n" "${overlaypath[@]}" | sort -u))
-
- echo "${overlaypath[@]}"
- else
- mainreponame=$(_parsereposconf DEFAULT main-repo)
- mainrepopath=$(_parsereposconf ${mainreponame} location)
-
- echo "${mainrepopath}"
- fi
- else
- source @GENTOO_PORTAGE_EPREFIX@/usr/share/portage/config/make.globals 2>/dev/null
- source @GENTOO_PORTAGE_EPREFIX@/etc/make.conf 2>/dev/null
- source @GENTOO_PORTAGE_EPREFIX@/etc/portage/make.conf 2>/dev/null
-
- echo "${PORTDIR}"
-
- if [[ ${1} == '-o' ]]; then
- echo "${PORTDIR_OVERLAY}"
- fi
- fi
+ if [[ -e @GENTOO_PORTAGE_EPREFIX@/usr/share/portage/config/repos.conf ]]; then
+ if [[ ${1} == '-o' ]]; then
+ for overlayname in $(_parsereposconf -l); do
+ overlaypath+=($(_parsereposconf ${overlayname} location))
+ done
+
+ source @GENTOO_PORTAGE_EPREFIX@/etc/make.conf 2>/dev/null
+ source @GENTOO_PORTAGE_EPREFIX@/etc/portage/make.conf 2>/dev/null
+
+ overlaypath+=(${PORTDIR_OVERLAY})
+
+ # strip out duplicates
+ overlaypath=($(printf "%s\n" "${overlaypath[@]}" | sort -u))
+
+ echo "${overlaypath[@]}"
+ else
+ mainreponame=$(_parsereposconf DEFAULT main-repo)
+ mainrepopath=$(_parsereposconf ${mainreponame} location)
+
+ echo "${mainrepopath}"
+ fi
+ else
+ source @GENTOO_PORTAGE_EPREFIX@/usr/share/portage/config/make.globals 2>/dev/null
+ source @GENTOO_PORTAGE_EPREFIX@/etc/make.conf 2>/dev/null
+ source @GENTOO_PORTAGE_EPREFIX@/etc/portage/make.conf 2>/dev/null
+
+ echo "${PORTDIR}"
+
+ if [[ ${1} == '-o' ]]; then
+ echo "${PORTDIR_OVERLAY}"
+ fi
+ fi
}
# _parsereposconf [-l] <repo> <variable>
# -l lists available repos
_parsereposconf() {
- local f insection line section v value var
-
- for f in @GENTOO_PORTAGE_EPREFIX@/usr/share/portage/config/repos.conf \
- @GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf \
- @GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf/*.conf; do
-
- if [[ -f ${f} ]]; then
- insection=0
-
- while read line; do
- # skip comments and blank lines
- [[ -z ${line} || ${line:0:1} == "#" ]] && continue
-
- if [[ ${insection} == 1 && ${line} =~ ^\[.*\]$ ]]; then
- # End of the section we were interested in so stop
- secname+=(${line//[(\[|\])]/}) # record name for -l
- 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 [[ ${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}"
- fi
- continue
- done < "${f}"
- fi
- done
-
- if [[ ${1} == -l ]]; then
- echo "${secname[@]}"
- else
- echo "${v}"
- fi
+ local f insection line section v value var
+
+ for f in @GENTOO_PORTAGE_EPREFIX@/usr/share/portage/config/repos.conf \
+ @GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf \
+ @GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf/*.conf; do
+
+ if [[ -f ${f} ]]; then
+ insection=0
+
+ while read line; do
+ # skip comments and blank lines
+ [[ -z ${line} || ${line:0:1} == "#" ]] && continue
+
+ if [[ ${insection} == 1 && ${line} =~ ^\[.*\]$ ]]; then
+ # End of the section we were interested in so stop
+ secname+=(${line//[(\[|\])]/}) # record name for -l
+ 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 [[ ${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}"
+ fi
+ continue
+ done < "${f}"
+ fi
+ done
+
+ if [[ ${1} == -l ]]; then
+ echo "${secname[@]}"
+ else
+ echo "${v}"
+ fi
}
# like _pkgname but completes on package names only (no category)
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
2018-03-02 18:06 Michał Górny
@ 2014-08-31 21:19 ` Michał Górny
0 siblings, 0 replies; 37+ messages in thread
From: Michał Górny @ 2014-08-31 21:19 UTC (permalink / raw
To: gentoo-commits
commit: 83db19445f037ff9385f80ae7f9ed787bfc55262
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 31 18:42:59 2014 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Aug 31 18:42:59 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=83db1944
Makefile: remove the outdated install target temporarily.
It is just wrong, so there is no point in keeping it for now. I will
write new rules after refactoring the code.
---
Makefile | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/Makefile b/Makefile
index e8f87cd..da4702b 100644
--- a/Makefile
+++ b/Makefile
@@ -5,18 +5,9 @@ distapp = gentoo-bashcomp
distver := $(shell date -u +%Y%m%d)
distpkg := $(distapp)-$(distver)
-PREFIX = /usr
-
all:
@echo Nothing to compile.
-install:
- install -d "$(DESTDIR)$(PREFIX)/share/bash-completion"
- install -m0644 gentoo "$(DESTDIR)$(PREFIX)/share/bash-completion"
- install -d "$(DESTDIR)/etc/bash_completion.d"
- ln -snf "../..$(PREFIX)/share/bash-completion/gentoo" \
- "$(DESTDIR)/etc/bash_completion.d/gentoo"
-
tag:
git pull
git tag -a $(distpkg) -m "tag $(distpkg)"
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2014-08-31 21:19 Michał Górny
2018-03-02 18:06 ` Michał Górny
0 siblings, 1 reply; 37+ messages in thread
From: Michał Górny @ 2014-08-31 21:19 UTC (permalink / raw
To: gentoo-commits
commit: ce8ecda4ece83c04d481acacbed97a61e989cb64
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 31 20:30:03 2014 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Aug 31 21:18:58 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=ce8ecda4
Makefile: introduce a new 'install' rule.
That handles proper install paths and substitutions.
---
Makefile | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/Makefile b/Makefile
index da4702b..f167c7b 100644
--- a/Makefile
+++ b/Makefile
@@ -5,9 +5,40 @@ distapp = gentoo-bashcomp
distver := $(shell date -u +%Y%m%d)
distpkg := $(distapp)-$(distver)
+DESTDIR =
+EPREFIX =
+
+# prefer paths from pkg-config, fallback to sane defaults
+completionsdir ?= $(or \
+ $(shell pkg-config --variable=completionsdir bash-completion 2>/dev/null), \
+ ${EPREFIX}/usr/share/bash-completion/completions)
+helpersdir ?= $(or \
+ $(shell pkg-config --variable=helpersdir bash-completion 2>/dev/null), \
+ ${EPREFIX}/usr/share/bash-completion/helpers)
+compatdir ?= $(or \
+ $(shell pkg-config --variable=compatdir bash-completion 2>/dev/null), \
+ ${EPREFIX}/etc/bash_completion.d)
+
+completions := $(wildcard completions/*)
+helpers := $(wildcard helpers/*)
+compats := $(wildcard compat/*)
+
+POSTINST_SED = sed -i -e "s|@GENTOO_PORTAGE_EPREFIX@|${EPREFIX}|g" -e "s|@helpersdir@|$(helpersdir)|"
+
all:
@echo Nothing to compile.
+install:
+ install -d "$(DESTDIR)$(completionsdir)"
+ install -m0644 $(completions) "$(DESTDIR)$(completionsdir)"
+ $(POSTINST_SED) $(addprefix "$(DESTDIR)$(completionsdir)"/,$(notdir $(completions)))
+ install -d "$(DESTDIR)$(helpersdir)"
+ install -m0644 $(helpers) "$(DESTDIR)$(helpersdir)"
+ $(POSTINST_SED) $(addprefix "$(DESTDIR)$(helpersdir)"/,$(notdir $(helpers)))
+ install -d "$(DESTDIR)$(compatdir)"
+ install -m0644 $(compats) "$(DESTDIR)$(compatdir)"
+ $(POSTINST_SED) $(addprefix "$(DESTDIR)$(compatdir)"/,$(notdir $(compats)))
+
tag:
git pull
git tag -a $(distpkg) -m "tag $(distpkg)"
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2015-10-10 20:18 Patrice Clement
0 siblings, 0 replies; 37+ messages in thread
From: Patrice Clement @ 2015-10-10 20:18 UTC (permalink / raw
To: gentoo-commits
commit: 9f3ef4ef2b43043c66f97d5fb07b65da0c33c794
Author: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 10 20:16:37 2015 +0000
Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
CommitDate: Sat Oct 10 20:16:37 2015 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=9f3ef4ef
Add a whitespace.
TODO | 1 +
1 file changed, 1 insertion(+)
diff --git a/TODO b/TODO
index 1f7630e..2c8155c 100644
--- a/TODO
+++ b/TODO
@@ -1,3 +1,4 @@
Todo List for gentoo-bashcomp
Todo list is motivated by bugs filed at http://bugs.gentoo.org
+
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2016-01-14 13:19 Patrice Clement
0 siblings, 0 replies; 37+ messages in thread
From: Patrice Clement @ 2016-01-14 13:19 UTC (permalink / raw
To: gentoo-commits
commit: c53f2c946634eb3cd440cef570729866277734de
Author: Louis Sautier <sautier.louis <AT> gmail <DOT> com>
AuthorDate: Thu Jan 7 10:35:56 2016 +0000
Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
CommitDate: Thu Jan 7 10:35:56 2016 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=c53f2c94
Add completion for emerge --autounmask-write
gentoo | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gentoo b/gentoo
index 0e54841..8935a40 100644
--- a/gentoo
+++ b/gentoo
@@ -456,7 +456,8 @@ _emerge()
fi
elif [[ ${cur} == --* ]]; then
# Complete on long options.
- opts="--alphabetical --ask \
+ opts="--alphabetical \
+ --ask --autounmask-write \
--buildpkg --buildpkgonly \
--changelog --clean --color=y --color=n --columns --complete-graph --config \
--debug --deep --depclean \
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2016-01-14 13:19 Patrice Clement
0 siblings, 0 replies; 37+ messages in thread
From: Patrice Clement @ 2016-01-14 13:19 UTC (permalink / raw
To: gentoo-commits
commit: eac314dc58d45a336e5808296cacc580cb17bc7f
Author: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 14 13:14:29 2016 +0000
Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
CommitDate: Thu Jan 14 13:16:37 2016 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=eac314dc
Merge remote-tracking branch 'github/pr/1'. Courtesy of Louis Sautier <sautier.louis <AT> gmail.com>.
Signed-off-by: Patrice Clement <monsieurp <AT> gentoo.org>
gentoo | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
^ permalink raw reply [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2016-03-16 11:55 Patrice Clement
0 siblings, 0 replies; 37+ messages in thread
From: Patrice Clement @ 2016-03-16 11:55 UTC (permalink / raw
To: gentoo-commits
commit: c35f6a954e9bc6098edbfc4be686867272862f6c
Author: Louis Sautier <sautier.louis <AT> gmail <DOT> com>
AuthorDate: Mon Feb 15 00:15:46 2016 +0000
Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
CommitDate: Wed Mar 16 11:41:55 2016 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=c35f6a95
add completion for emerge --rage-clean
This PR adds the --rage-clean option.
Closes: https://github.com/gentoo/gentoo-bashcomp/pull/2
gentoo | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/gentoo b/gentoo
index 8935a40..deee23f 100644
--- a/gentoo
+++ b/gentoo
@@ -399,7 +399,7 @@ _emerge()
# find action
for x in ${COMP_LINE} ; do
if [[ ${x} =~ ^(system|world)$ ]] || [[ ${x} =~ -[CPcs] ]] || \
- [[ ${x} =~ --(clean|config|depclean|info|metadata|prune|regen|resume|search|sync|unmerge) ]]
+ [[ ${x} =~ --(clean|config|depclean|info|metadata|prune|rage-clean|regen|resume|search|sync|unmerge) ]]
then
action=${x}
break
@@ -471,7 +471,7 @@ _emerge()
--newuse --noconfmem --nodeps --noreplace --nospinner \
--oneshot --onlydeps \
--pretend --prune \
- --quiet \
+ --quiet --rage-clean \
--reinstall=changed-use --regen \
--search \
--sync \
@@ -523,7 +523,7 @@ _emerge()
fi
# Complete on installed packages when unmerging.
- if [[ "${action}" == '--unmerge' ]]; then
+ if [[ "${action}" =~ --(rage-clean|unmerge) ]]; then
if [[ -n "${cur}" ]] ; then
if [[ "${cur}" == */* ]]; then
words=$(builtin cd @GENTOO_PORTAGE_EPREFIX@/var/db/pkg; compgen -G "${cur}*")
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2018-03-02 18:06 Michał Górny
2014-08-31 21:19 ` Michał Górny
0 siblings, 1 reply; 37+ messages in thread
From: Michał Górny @ 2018-03-02 18:06 UTC (permalink / raw
To: gentoo-commits
commit: 83db19445f037ff9385f80ae7f9ed787bfc55262
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 31 18:42:59 2014 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Aug 31 18:42:59 2014 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=83db1944
Makefile: remove the outdated install target temporarily.
It is just wrong, so there is no point in keeping it for now. I will
write new rules after refactoring the code.
Makefile | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/Makefile b/Makefile
index e8f87cd..da4702b 100644
--- a/Makefile
+++ b/Makefile
@@ -5,18 +5,9 @@ distapp = gentoo-bashcomp
distver := $(shell date -u +%Y%m%d)
distpkg := $(distapp)-$(distver)
-PREFIX = /usr
-
all:
@echo Nothing to compile.
-install:
- install -d "$(DESTDIR)$(PREFIX)/share/bash-completion"
- install -m0644 gentoo "$(DESTDIR)$(PREFIX)/share/bash-completion"
- install -d "$(DESTDIR)/etc/bash_completion.d"
- ln -snf "../..$(PREFIX)/share/bash-completion/gentoo" \
- "$(DESTDIR)/etc/bash_completion.d/gentoo"
-
tag:
git pull
git tag -a $(distpkg) -m "tag $(distpkg)"
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
2014-08-31 21:19 Michał Górny
@ 2018-03-02 18:06 ` Michał Górny
0 siblings, 0 replies; 37+ messages in thread
From: Michał Górny @ 2018-03-02 18:06 UTC (permalink / raw
To: gentoo-commits
commit: ce8ecda4ece83c04d481acacbed97a61e989cb64
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 31 20:30:03 2014 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Aug 31 21:18:58 2014 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=ce8ecda4
Makefile: introduce a new 'install' rule.
That handles proper install paths and substitutions.
Makefile | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/Makefile b/Makefile
index da4702b..f167c7b 100644
--- a/Makefile
+++ b/Makefile
@@ -5,9 +5,40 @@ distapp = gentoo-bashcomp
distver := $(shell date -u +%Y%m%d)
distpkg := $(distapp)-$(distver)
+DESTDIR =
+EPREFIX =
+
+# prefer paths from pkg-config, fallback to sane defaults
+completionsdir ?= $(or \
+ $(shell pkg-config --variable=completionsdir bash-completion 2>/dev/null), \
+ ${EPREFIX}/usr/share/bash-completion/completions)
+helpersdir ?= $(or \
+ $(shell pkg-config --variable=helpersdir bash-completion 2>/dev/null), \
+ ${EPREFIX}/usr/share/bash-completion/helpers)
+compatdir ?= $(or \
+ $(shell pkg-config --variable=compatdir bash-completion 2>/dev/null), \
+ ${EPREFIX}/etc/bash_completion.d)
+
+completions := $(wildcard completions/*)
+helpers := $(wildcard helpers/*)
+compats := $(wildcard compat/*)
+
+POSTINST_SED = sed -i -e "s|@GENTOO_PORTAGE_EPREFIX@|${EPREFIX}|g" -e "s|@helpersdir@|$(helpersdir)|"
+
all:
@echo Nothing to compile.
+install:
+ install -d "$(DESTDIR)$(completionsdir)"
+ install -m0644 $(completions) "$(DESTDIR)$(completionsdir)"
+ $(POSTINST_SED) $(addprefix "$(DESTDIR)$(completionsdir)"/,$(notdir $(completions)))
+ install -d "$(DESTDIR)$(helpersdir)"
+ install -m0644 $(helpers) "$(DESTDIR)$(helpersdir)"
+ $(POSTINST_SED) $(addprefix "$(DESTDIR)$(helpersdir)"/,$(notdir $(helpers)))
+ install -d "$(DESTDIR)$(compatdir)"
+ install -m0644 $(compats) "$(DESTDIR)$(compatdir)"
+ $(POSTINST_SED) $(addprefix "$(DESTDIR)$(compatdir)"/,$(notdir $(compats)))
+
tag:
git pull
git tag -a $(distpkg) -m "tag $(distpkg)"
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2024-05-11 3:13 Sam James
0 siblings, 0 replies; 37+ messages in thread
From: Sam James @ 2024-05-11 3:13 UTC (permalink / raw
To: gentoo-commits
commit: c0a9b924a6e546c2865a375496d27ff6bea7a494
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat May 11 03:13:25 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat May 11 03:13:25 2024 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=c0a9b924
Makefile: bzip2 -> xz
Signed-off-by: Sam James <sam <AT> gentoo.org>
Makefile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index f167c7b..5947e9e 100644
--- a/Makefile
+++ b/Makefile
@@ -51,10 +51,10 @@ dist: tag
mkdir $(distpkg)/
git log > $(distpkg)/ChangeLog
tar vfr $(distpkg).tar $(distpkg)/ChangeLog
- bzip2 $(distpkg).tar
+ xz $(distpkg).tar
rm -rf $(distpkg)/
@echo "success."
dist-upload: dist
- scp $(distpkg).tar.bz2 dev.gentoo.org:/space/distfiles-local/
- ssh dev.gentoo.org chmod ug+rw /space/distfiles-local/$(distpkg).tar.bz2
+ scp $(distpkg).tar.xz dev.gentoo.org:/space/distfiles-local/
+ ssh dev.gentoo.org chmod ug+rw /space/distfiles-local/$(distpkg).tar.xz
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
@ 2024-05-25 7:54 Arthur Zamarin
0 siblings, 0 replies; 37+ messages in thread
From: Arthur Zamarin @ 2024-05-25 7:54 UTC (permalink / raw
To: gentoo-commits
commit: 0430b6d232abcd98de7d6a4246db2bbb0d96446a
Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sat May 25 07:54:24 2024 +0000
Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sat May 25 07:54:24 2024 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=0430b6d2
Makefile: remove legacy dist rules
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>
Makefile | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/Makefile b/Makefile
index 5947e9e..9302f35 100644
--- a/Makefile
+++ b/Makefile
@@ -45,16 +45,3 @@ tag:
@echo
@echo "created tag $(distpkg) - remember to push it"
@echo
-
-dist: tag
- git archive --prefix=$(distpkg)/ --format=tar -o $(distpkg).tar $(distpkg)
- mkdir $(distpkg)/
- git log > $(distpkg)/ChangeLog
- tar vfr $(distpkg).tar $(distpkg)/ChangeLog
- xz $(distpkg).tar
- rm -rf $(distpkg)/
- @echo "success."
-
-dist-upload: dist
- scp $(distpkg).tar.xz dev.gentoo.org:/space/distfiles-local/
- ssh dev.gentoo.org chmod ug+rw /space/distfiles-local/$(distpkg).tar.xz
^ permalink raw reply related [flat|nested] 37+ messages in thread
end of thread, other threads:[~2024-05-25 7:54 UTC | newest]
Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-12 16:43 [gentoo-commits] proj/gentoo-bashcomp:master commit in: / Ryan Hill
-- strict thread matches above, loose matches on Subject: below --
2024-05-25 7:54 Arthur Zamarin
2024-05-11 3:13 Sam James
2018-03-02 18:06 Michał Górny
2014-08-31 21:19 ` Michał Górny
2016-03-16 11:55 Patrice Clement
2016-01-14 13:19 Patrice Clement
2016-01-14 13:19 Patrice Clement
2015-10-10 20:18 Patrice Clement
2014-08-31 21:19 Michał Górny
2018-03-02 18:06 ` Michał Górny
2013-08-12 16:43 Ryan Hill
2013-08-04 19:21 Ryan Hill
2013-08-04 19:21 Ryan Hill
2013-07-30 1:36 Ryan Hill
2012-11-03 5:51 Ryan Hill
2012-10-24 4:01 Ryan Hill
2012-10-24 3:42 Ryan Hill
2012-10-24 3:42 Ryan Hill
2012-10-22 3:37 Ryan Hill
2012-10-22 0:51 Ryan Hill
2012-10-21 9:57 Ryan Hill
2012-10-11 5:01 Ryan Hill
2012-10-10 2:43 Ryan Hill
2012-10-10 2:43 Ryan Hill
2012-10-10 2:43 Ryan Hill
2012-05-06 20:35 Jeremy Olexa
2012-04-24 16:10 Jeremy Olexa
2012-04-24 16:10 Jeremy Olexa
2012-04-24 16:10 Jeremy Olexa
2012-04-24 16:10 Jeremy Olexa
2012-04-24 16:10 Jeremy Olexa
2012-04-24 16:10 Jeremy Olexa
2012-04-24 16:10 Jeremy Olexa
2012-04-24 16:10 Jeremy Olexa
2012-04-24 16:10 Jeremy Olexa
2012-02-15 2:16 Christian Ruppert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox