From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11540 invoked from network); 10 Dec 2004 11:12:33 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 10 Dec 2004 11:12:33 -0000 Received: (qmail 19841 invoked from network); 10 Dec 2004 11:12:27 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 10 Dec 2004 11:12:27 -0000 Received: (qmail 11437 invoked by alias); 10 Dec 2004 11:12:12 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20617 Received: (qmail 11423 invoked from network); 10 Dec 2004 11:12:11 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 10 Dec 2004 11:12:11 -0000 Received: (qmail 19199 invoked from network); 10 Dec 2004 11:11:12 -0000 Received: from mx1.mail.ru (194.67.23.121) by a.mx.sunsite.dk with SMTP; 10 Dec 2004 11:11:10 -0000 Received: from [83.237.61.28] (port=33166 helo=ppp83-237-61-28.pppoe.mtu-net.ru) by mx1.mail.ru with asmtp id 1Ccig0-000MGU-00 for zsh-workers@sunsite.dk; Fri, 10 Dec 2004 14:11:09 +0300 From: Andrey Borzenkov To: zsh-workers@sunsite.dk Subject: [PATCH] _modutils update for kernel 2.6 Date: Fri, 10 Dec 2004 14:10:58 +0300 User-Agent: KMail/1.7.1 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_CRYuBz4UIfzg/3h" Message-Id: <200412101410.58449.arvidjaar@mail.ru> X-Spam: Not detected X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 --Boundary-00=_CRYuBz4UIfzg/3h Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Mandrake ships compressed modules for 2.6, currently they are completed to module.ko that modprobe does not like. Patch simply strips off everything after first dot (I do not think any module is using dot in names or vene if this is allowed). Also it adds trivial insmod support for module-init-tools enough for 2.6 (I am testing kernel module and being lazy ... :) I set styles as if [[ "$(modprobe -V 2> /dev/null)" == module-init-tools* ]]; then zstyle ':completion:*:*:insmod:*' file-patterns '*.ko:modules *(-/):directories' '*:all-files' else zstyle ':completion:*:*:insmod:*' file-patterns '*.o:modules *(-/):directories' '*:all-files' fi may be it makes sense to put in _modutils as default. regards -andrey --Boundary-00=_CRYuBz4UIfzg/3h Content-Type: text/x-diff; charset="us-ascii"; name="_modutils.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="_modutils.diff" Index: Completion/Linux/Command/_modutils =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Linux/Command/_modutils,v retrieving revision 1.4 diff -u -p -r1.4 _modutils --- Completion/Linux/Command/_modutils 13 Feb 2004 18:42:25 -0000 1.4 +++ Completion/Linux/Command/_modutils 10 Dec 2004 10:52:38 -0000 @@ -1,4 +1,4 @@ -#compdef lsmod modinfo modprobe rmmod +#compdef lsmod modinfo modprobe rmmod insmod local curcontext="$curcontext" expl state line modules ign args ret=1 @@ -51,6 +51,12 @@ case "$service" in '(-v --verbose)'{-v,--verbose}'[be verbose]' \ '*:loaded module:->loaded_modules' && ret=0 ;; + + insmod) + _arguments \ + '1:module file:_files' \ + '*:module parameters:' && ret=0 + ;; esac case "$state" in @@ -67,7 +73,7 @@ case "$state" in ;; all_modules) - modules=( ${${${${(f)"$(_call_program modules ${(M)words[1]##*/}modprobe -l 2>/dev/null)"}:#}##*/}%.*} ) + modules=( ${${${${(f)"$(_call_program modules ${(M)words[1]##*/}modprobe -l 2>/dev/null)"}:#}##*/}%%.*} ) _wanted modules expl module compadd -a modules && return ;; --Boundary-00=_CRYuBz4UIfzg/3h--