[Pkg-dkms-commits] [SCM] Maintenance of the dkms package branch, master, updated. upstream/2.0.20.4-31-g4c43a08

Giuseppe Iuculano giuseppe at iuculano.it
Tue Dec 30 14:35:23 UTC 2008


The following commit has been merged in the master branch:
commit 04dbf65aa1d3a7bc166c0b9075fdc0e6c30309bb
Author: Giuseppe Iuculano <giuseppe at iuculano.it>
Date:   Tue Dec 30 15:33:12 2008 +0100

    debian/patches/11-bash-completition.patch: Improve bash-completition support (Origin Mandriva)

diff --git a/debian/patches/11-bash-completition.patch b/debian/patches/11-bash-completition.patch
new file mode 100644
index 0000000..ad75395
--- /dev/null
+++ b/debian/patches/11-bash-completition.patch
@@ -0,0 +1,60 @@
+--- a/dkms.bash-completion
++++ b/dkms.bash-completion
+@@ -8,6 +8,20 @@ _kernels()
+         COMPREPLY=( $( command ls /lib/modules | grep "^$cur" ) )
+ }
+ 
++# complete on full directory names under $1
++_subdirectories()
++{
++	COMPREPLY=( $( command ls -F $1 2>/dev/null | awk -F \/ '/\/$/ \
++		{print $1}' | grep "^$cur" ) )
++}
++
++# complete on $2 part of filenames matching pattern $1 under /usr/src
++_filename_parts()
++{
++	COMPREPLY=( $( command ls -F /usr/src 2>/dev/null | grep -E '^'$1'/$' \
++		| sed -r -e 's/^([^-]+)-(.+)\/$/\'$2'/' | grep "^$cur" ) )
++}
++
+ _dkms()
+ {
+ 	local cur prev command module i
+@@ -22,9 +36,14 @@ _dkms()
+ 	else
+ 
+ 		prev=${COMP_WORDS[COMP_CWORD-1]}
++		command=${COMP_WORDS[1]}
+ 		case $prev in
+ 			-m)
+-				COMPREPLY=( $( command ls -F /var/lib/dkms | grep '/$' | sed -e 's|/$||' | grep "^$cur" ) )
++				if [ "$command" = 'add' ]; then
++					_filename_parts '.*-.*' 1
++				else
++					_subdirectories /var/lib/dkms
++				fi
+ 				return 0
+ 				;;
+ 			-v)
+@@ -35,7 +54,11 @@ _dkms()
+ 					fi
+ 				done
+ 				if [ -n "$module" ]; then
+-					COMPREPLY=( $( command ls -F /var/lib/dkms/$module | grep '/$' | sed -e 's|/$||' | grep "^$cur" ) )
++					if [ "$command" = 'add' ]; then
++						_filename_parts "$module-.*" 2
++					else
++						_subdirectories /var/lib/dkms/$module
++					fi
+ 					return 0
+ 				fi
+ 				;;
+@@ -53,7 +76,6 @@ _dkms()
+ 				;;
+ 		esac
+ 
+-		command=${COMP_WORDS[1]}
+ 
+ 		if [[ "$cur" == -* ]]; then
+ 			case $command in
diff --git a/debian/patches/series b/debian/patches/series
index af6d102..0bb850c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -8,3 +8,4 @@
 08-support_kernel-img.conf.patch
 09-lilo_detection.patch
 10-lsb.patch
+11-bash-completition.patch

-- 
Maintenance of the dkms package



More information about the Pkg-dkms-commits mailing list