aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorChris Larson <clarson@kergoth.com>2004-07-17 00:51:51 +0000
committerChris Larson <clarson@kergoth.com>2004-07-17 00:51:51 +0000
commit2492ddb5466f0de8edae4205e84786f83bf4a438 (patch)
treeb874617efcbc3b83a30ca2dd53cab829dac96980 /contrib
parentc71ae4ab664419cc7d53277fb9e70f68982bf8be (diff)
downloadbitbake-2492ddb5466f0de8edae4205e84786f83bf4a438.tar.gz
mvdir
Diffstat (limited to 'contrib')
-rw-r--r--contrib/bash-completion59
1 files changed, 59 insertions, 0 deletions
diff --git a/contrib/bash-completion b/contrib/bash-completion
new file mode 100644
index 000000000..2740f317e
--- /dev/null
+++ b/contrib/bash-completion
@@ -0,0 +1,59 @@
+#
+# Bash completion for oemake
+#
+# contact: oe at haslup dot com
+#
+#
+# Uses $OEDIR to find your local.conf in which it
+# expects OEFILES to be defined.
+#
+# If it's not, feel free to add an OEFILES like below:
+#OEFILES="/data/zaurus/openembedded/packages/*/*.oe"
+#
+
+
+_oefiles_update ()
+{
+ if [ -e $OEDIR/conf/local.conf ]; then
+ OEFILES=`grep -E "^OEFILES" $OEDIR/conf/local.conf|sed 's/^.*= *//'`
+ else
+ echo "Couldn't find conf/local.conf, maybe set OEDIR?"
+ fi
+
+ export COMPLETE_OE_PKG_CACHE=$(for f in `ls ${OEFILES//\"/}` ; do basename $f | sed 's/\_.*$//' ; done)
+}
+
+_oemake_cached ()
+{
+ local packages cur
+
+ COMPREPLY=()
+ cur=${COMP_WORDS[COMP_CWORD]}
+
+ COMPREPLY=( $(compgen -W '$COMPLETE_OE_PKG_CACHE' -- $cur ) )
+}
+
+_oemake ()
+{
+ local packages cur
+
+ COMPREPLY=()
+ cur=${COMP_WORDS[COMP_CWORD]}
+
+ _oefiles_update
+
+ COMPREPLY=( $(compgen -W '$COMPLETE_OE_PKG_CACHE' -- $cur ) )
+ #COMPREPLY=( $( (compgen -W '$(for f in `find $OE_PKG_DIR -not -path "*SCCS*" -name "*.oe" -exec basename {} \;` ; do echo $f | sed 's/\_.*$//' ;
+done)' -- $cur ) ) )
+}
+
+_oefiles_update
+
+# Choose one of the commands below... the cached version is pretty quick, but might need
+# refreshing each time you update your packages directory. Non-cached is too slow
+# on my P4-1.8ghz.
+#
+# If you can use the non-cached, more power to you and your speedy machine :)
+#
+complete -F _oemake_cached oemake
+#complete -F _oemake oemake