[Bash-completion-devel] Ubuntu bash-completion 20080705ubuntu3

Ubuntu Merge-o-Matic mom at ubuntu.com
Thu Feb 5 11:41:20 UTC 2009


This e-mail has been sent due to an upload to Ubuntu that contains Ubuntu
changes.  It contains the difference between the new version and the
previous version of the same source package in Ubuntu.
-------------- next part --------------
Format: 1.7
Date: Thu, 05 Feb 2009 09:10:57 +0100
Source: bash-completion
Binary: bash-completion
Architecture: source
Version: 20080705ubuntu3
Distribution: jaunty
Urgency: low
Maintainer: Ubuntu Core Developers <ubuntu-devel-discuss at lists.ubuntu.com>
Changed-By: Colin Watson <cjwatson at ubuntu.com>
Description: 
 bash-completion - programmable completion for the bash shell
Changes: 
 bash-completion (20080705ubuntu3) jaunty; urgency=low
 .
   * Revert previous 'modprobe -r' completion fix in favour of Ville Skyttä's
     upstream fix. See Debian #512556.
Files: 
 9f51d351316ae55cdea5520bf843c773 1115 shells standard bash-completion_20080705ubuntu3.dsc
 dd4e545477e665132d57a1148927186e 103378 shells standard bash-completion_20080705ubuntu3.tar.gz
Original-Maintainer: Bash Completion Maintainers <bash-completion-devel at lists.alioth.debian.org>
-------------- next part --------------
diff -pruN 20080705ubuntu2/bash_completion 20080705ubuntu3/bash_completion
--- 20080705ubuntu2/bash_completion	2009-01-21 18:15:40.000000000 +0000
+++ 20080705ubuntu3/bash_completion	2009-02-05 08:02:15.000000000 +0000
@@ -443,6 +443,14 @@ _modules()
 			sed -ne 's/^\('$cur'.*\)\.k\?o\(\|.gz\)$/\1/p') )
 }
 
+# This function completes on installed modules
+#
+_installed_modules()
+{
+	COMPREPLY=( $( compgen -W "$( /sbin/lsmod | \
+				  awk '{if (NR != 1) print $1}' )" -- $1 ) )
+}
+
 # this function complete on user:group format
 #
 _usergroup()
@@ -776,8 +784,7 @@ _rmmod()
 	COMPREPLY=()
 	cur=`_get_cword`
 
-	COMPREPLY=( $( /sbin/lsmod | \
-		  awk '{if (NR != 1 && $1 ~ /^'$cur'/) print $1}' 2>/dev/null ))
+	_installed_modules "$cur"
 	return 0
 }
 complete -F _rmmod rmmod
@@ -794,17 +801,16 @@ _insmod()
 	cur=`_get_cword`
 	prev=${COMP_WORDS[COMP_CWORD-1]}
 
-	# do filename completion if we're giving a path to a module
-	if [[ "$cur" == */* ]]; then
-		_filedir '@(?(k)o?(.gz))'
-		return 0
-	fi
-
 	# behave like lsmod for modprobe -r
 	if [ $1 = "modprobe" ] &&
 	   [ "${COMP_WORDS[1]}" = "-r" ]; then
-		COMPREPLY=( $( /sbin/lsmod | \
-				awk '{if (NR != 1 && $1 ~ /^'$cur'/) print $1}' ) )
+		_installed_modules "$cur"
+		return 0
+	fi
+
+	# do filename completion if we're giving a path to a module
+	if [[ "$cur" == */* ]]; then
+		_filedir '@(?(k)o?(.gz))'
 		return 0
 	fi
 
diff -pruN 20080705ubuntu2/debian/changelog 20080705ubuntu3/debian/changelog
--- 20080705ubuntu2/debian/changelog	2009-01-21 18:33:07.000000000 +0000
+++ 20080705ubuntu3/debian/changelog	2009-02-05 08:10:58.000000000 +0000
@@ -1,3 +1,10 @@
+bash-completion (20080705ubuntu3) jaunty; urgency=low
+
+  * Revert previous 'modprobe -r' completion fix in favour of Ville Skyttä's
+    upstream fix. See Debian #512556.
+
+ -- Colin Watson <cjwatson at ubuntu.com>  Thu, 05 Feb 2009 09:10:57 +0100
+
 bash-completion (20080705ubuntu2) jaunty; urgency=low
 
   * modprobe: Check for */* before checking for 'modprobe -r', to avoid


More information about the Bash-completion-devel mailing list