[Bash-completion-commits] [SCM] debian-package branch, master, updated. debian/1.3-1-32-g653f34e

David Paleino dapal at debian.org
Tue Apr 12 10:44:38 UTC 2011


The following commit has been merged in the master branch:
commit dfc80b9aff94d9f1e7f5dc09a854923414c8d99f
Author: David Paleino <dapal at debian.org>
Date:   Sun Apr 10 11:47:12 2011 +0200

    Remove get-completions, and improve the overall code. Now it *is* SPEEDY.

diff --git a/debian/extra/get-completions b/debian/extra/get-completions
deleted file mode 100755
index 0fe21b4..0000000
--- a/debian/extra/get-completions
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/bash
-
-commands=$(compgen -c)
-
-for c in $commands; do
-	line=$(grep -w -F $c $1)
-	if [ -n "$line" ]; then
-		comp=$(echo $line | cut -d: -f1)
-		val=$(echo -n $line | cut -d: -f2 | tr ' ' '|')
-		fixedval=$(printf "%s|\n" $val)
-
-		if [ -n "$(echo $fixedval | grep "$c|")" ]; then
-			echo $comp
-		fi
-	fi
-done
diff --git a/debian/extra/update-bash-completion b/debian/extra/update-bash-completion
index 0ca9e7c..e6bb946 100755
--- a/debian/extra/update-bash-completion
+++ b/debian/extra/update-bash-completion
@@ -1,6 +1,5 @@
 #!/bin/bash
 
-GET_COMP=/usr/share/bash-completion/get-completions
 COMPDICT=/usr/share/bash-completion/compdict
 COMPDIR=/usr/share/bash-completion
 RUNCOMPDIR=/etc/bash_completion.d/triggered
@@ -19,9 +18,13 @@ elif [ "$1" == "clean" ]; then
     rm -rf $RUNCOMPDIR/*
 fi
 
+commands=$(compgen -f /usr/bin/ ; compgen -f /usr/sbin/ ; compgen -f /usr/games/ ; compgen -f /bin/ ; compgen -f /sbin/)
+commands=$(echo $commands | sed 's, /[^ ]*/,|\n,g;s,/[^ ]*/,,;s,$,|,')
 
 echo -n "bash-completion: updating completion symlinks... "
-for c in $($GET_COMP $COMPDICT | sort -u); do
+completions=$(grep -w -F "$commands" $COMPDICT | cut -d: -f1 | sort -u)
+
+for c in $completions; do
     [ -L "$RUNCOMPDIR/${c##*/}" ] || ln -s $COMPDIR/$c $RUNCOMPDIR/
 done
 echo "done."
diff --git a/debian/install b/debian/install
index 6aa8b26..d7308ad 100644
--- a/debian/install
+++ b/debian/install
@@ -2,7 +2,6 @@ debian/extra/dh_bash-completion	/usr/bin/
 debian/extra/bash_completion.pm	/usr/share/perl5/Debian/Debhelper/Sequence/
 
 debian/compdict	/usr/share/bash-completion/
-debian/extra/get-completions	/usr/share/bash-completion/
 debian/extra/update-bash-completion	/usr/sbin/
 debian/extra/bash-completion.cron	/etc/cron.monthly/
 debian/extra/99-bash-completion		/etc/apt/apt.conf.d/

-- 
debian-package



More information about the Bash-completion-commits mailing list