Update of /cvsroot/fink/dists/10.4/unstable/main/finkinfo/base
In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv12625

Modified Files:
        daemonic.info 
Log Message:
Add bash_completion script and dep on bash_completion

Index: daemonic.info
===================================================================
RCS file: /cvsroot/fink/dists/10.4/unstable/main/finkinfo/base/daemonic.info,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- daemonic.info       20 Feb 2006 00:47:35 -0000      1.2
+++ daemonic.info       6 Dec 2007 21:21:13 -0000       1.3
@@ -1,14 +1,61 @@
 Package: daemonic
 Version: 20010902
-Revision: 2
+Revision: 3
 Maintainer: Fink Core Group <[EMAIL PROTECTED]>
-Depends: libxml2-bin, libxml2-shlibs
+Depends: libxml2-bin, libxml2-shlibs, bash-completion
 BuildDepends: libiconv-dev, libxml2
 Source: mirror:sourceforge:%n/%n-%v.tar.gz
 Source-MD5: 20fde65b727578d721bc947d669de7b3
-PatchScript: perl -pi.bak -e 's/static void/void/g' parse.c
+PatchScript: <<
+#!/bin/sh -e
+  perl -pi -e 's/static void/void/g' parse.c
+  cat >bash_completion <<EOF
+_daemonic_daemons()
+{
+       ls %p/etc/daemons 2>/dev/null | sed -e 's/\.xml//'
+}
+
+_daemonic()
+{
+       local cur prev special i
+
+       COMPREPLY=()
+       cur=\${COMP_WORDS[COMP_CWORD]}
+       prev=\${COMP_WORDS[COMP_CWORD-1]}
+
+       for (( i=0; i < \${#COMP_WORDS}-1; i++ )); do
+            if [[ \${COMP_WORDS[i]} == 
@(enable|disable|install|update|remove|dump) ]]; then
+                 special=\${COMP_WORDS[i]}
+            fi
+       done
+
+       if [ -n "\${special}" ]; then
+            case \$special in
+                 enable|disable|install|update|remove)
+                      COMPREPLY=( \$( _daemonic_daemons ) )
+                      ;;
+                 dump)
+                      COMPREPLY=()
+                      ;;
+            esac
+
+            return 0
+       fi
+
+       COMPREPLY=( \$( compgen -W 'enable disable install update remove dump' 
-- \$cur ) )
+
+       return 0
+}
+complete -F _daemonic daemonic
+EOF
+<<
 CompileScript: make prefix=%p
-InstallScript: make install prefix=%i
+InstallScript: <<
+  make install prefix=%i
+  mkdir -p %i/etc/bash_completion.d
+  install -m755 bash_completion %i/etc/bash_completion.d/daemonic
+<<
+ConfFiles: %p/etc/bash_completion.d/daemonic
 DocFiles: COPYING
 #
 Description: Interface to daemon init scripts


-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Fink-commits mailing list
Fink-commits@lists.sourceforge.net
http://news.gmane.org/gmane.os.apple.fink.cvs

Reply via email to