From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10786 invoked from network); 4 Oct 2009 13:13:46 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.5 Received: from new-brage.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.254.104) by ns1.primenet.com.au with SMTP; 4 Oct 2009 13:13:46 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 18468 invoked from network); 4 Oct 2009 13:07:02 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 4 Oct 2009 13:07:02 -0000 Received: (qmail 29670 invoked by alias); 4 Oct 2009 13:06:58 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 27305 Received: (qmail 29656 invoked from network); 4 Oct 2009 13:06:57 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 4 Oct 2009 13:06:57 -0000 Received: from mail-yw0-f178.google.com (mail-yw0-f178.google.com [209.85.211.178]) by bifrost.dotsrc.org (Postfix) with ESMTP id 9F0B3801E2BF for ; Sun, 4 Oct 2009 15:06:49 +0200 (CEST) Received: by ywh8 with SMTP id 8so2177411ywh.3 for ; Sun, 04 Oct 2009 06:06:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id :disposition-notification-to:date:from:user-agent:mime-version:to :subject:content-type; bh=iWxNQNECaFcTyB+YCI4TpI7L5/xEV8AvK/yY7LWMXMQ=; b=cvDSGtQEK1DifVMxs8PLYF6dc7DCcl6/zh8QDZRorIvLmWRbbvy0V5jXToi5pGT7Ta hQz+29GNfIFoI+4w8Kbf233XcSmbwdoLE+Jqbmoqz4eSto5eWIVlVJjN13xA1qihMsRZ WlCl+HeOc6Q9CgvyomSL7fo9AXFtDPfEiugI0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:disposition-notification-to:date:from:user-agent :mime-version:to:subject:content-type; b=isUcRqFQB8Mci2g13cKjdlnEc350Sv0PSB8hhvgE8hAJ9Uh2X12O23OlxuUv9Q7t0b QvjzIZJs21LEi1wkOLujg+aJEsyHJqZrjPcgwVtp1agpBTqc0irt5WEVSKu/Gybs4mB/ qK/fOj79I+zEcFf59FyTeI57KYwW399v1rqec= Received: by 10.100.74.21 with SMTP id w21mr4344031ana.165.1254661608532; Sun, 04 Oct 2009 06:06:48 -0700 (PDT) Received: from ?10.110.79.77? ([200.92.188.101]) by mx.google.com with ESMTPS id 22sm1344712yxe.11.2009.10.04.06.06.47 (version=SSLv3 cipher=RC4-MD5); Sun, 04 Oct 2009 06:06:48 -0700 (PDT) Message-ID: <4AC89D4E.6050608@gmail.com> Date: Sun, 04 Oct 2009 08:04:14 -0500 From: Edgar Merino User-Agent: Thunderbird 2.0.0.22 (X11/20090719) MIME-Version: 1.0 To: zsh-workers@sunsite.dk Subject: Completion function patches Content-Type: multipart/mixed; boundary="------------070907000007080807070602" X-Virus-Scanned: ClamAV 0.94.2/9866/Sat Oct 3 16:49:15 2009 on bifrost X-Virus-Status: Clean This is a multi-part message in MIME format. --------------070907000007080807070602 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hello, I recently had to work with two utility functions for the completion system: _services and _init_d. I'm running archlinux and here services are under the /etc/rc.d directory, instead of the default directory that appears in those 2 scripts (/etc/init.d). Attached I provide you with pataches for both scripts, so that they work fine when running a system with an init framework similar to mine. Please let me know if I should do something else to contribute this code. Edgar Merino --------------070907000007080807070602 Content-Type: text/plain; name="_init_d.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="_init_d.patch" --- _init_d 2009-10-04 07:54:44.000000000 -0500 +++ _init_d.new 2009-10-04 07:38:15.000000000 -0500 @@ -7,7 +7,7 @@ # This should probably be system specific... script=$words[1] -[[ $script = */* ]] || script=/etc/init.d/$script +[[ $script = */* ]] || script=`[ -d /etc/init.d ] && echo /etc/init.d || echo /etc/rc.d`/$script # If the file starts with `#!' we hope that this is a shell script # and get lines looking like foo|bar) with the words in $what. --------------070907000007080807070602 Content-Type: text/plain; name="_services.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="_services.patch" --- _services 2009-10-04 08:00:36.000000000 -0500 +++ _services.new 2009-10-04 07:38:25.000000000 -0500 @@ -12,7 +12,8 @@ 'init:init service:compadd -a inits' \ 'xinetd:xinetd service:compadd -a xinetds' && ret=0 else - _wanted services expl service compadd "$@" - /etc/init.d/*(-*:t) && ret=0 + services_directory=`[ -d /etc/init.d ] && echo /etc/init.d || echo /etc/rc.d`; + _wanted services expl service compadd "$@" - $services_directory/*(-*:t) && ret=0 fi return ret --------------070907000007080807070602--