/[baselayout]/trunk/sh/gendepends.sh
Gentoo

Contents of /trunk/sh/gendepends.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2680 - (hide annotations) (download) (as text)
Thu May 3 08:08:59 2007 UTC (11 years, 2 months ago) by uberlord
File MIME type: text/x-sh
File size: 1124 byte(s)
Load the config file before the init script to stop badly coded init scripts from erroring, #176548
1 uberlord 2547 #!/bin/sh
2     # Shell wrapper to list our dependencies
3     # Copyright 2007 Gentoo Foundation
4     # Distributed under the terms of the GNU General Public License v2
5    
6     . /etc/init.d/functions.sh
7    
8     need() {
9     [ -n "$*" ] && echo "${SVCNAME} ineed $*"
10     }
11     use() {
12     [ -n "$*" ] && echo "${SVCNAME} iuse $*"
13     }
14     before() {
15     [ -n "$*" ] && echo "${SVCNAME} ibefore $*"
16     }
17     after() {
18     [ -n "$*" ] && echo "${SVCNAME} iafter $*"
19     }
20     provide() {
21     [ -n "$*" ] && echo "${SVCNAME} iprovide $*"
22     }
23     depend() {
24     :
25     }
26    
27     cd /etc/init.d
28     for SVCNAME in * ; do
29     [ -x "${SVCNAME}" ] || continue
30     case "${SVCNAME}" in
31     *.sh) continue ;;
32     esac
33    
34     SVCNAME=${SVCNAME##*/}
35     (
36 uberlord 2680 rc_c=${SVCNAME%%.*}
37     if [ -n "${rc_c}" -a "${rc_c}" != "${SVCNAME}" ] ; then
38     [ -e /etc/conf.d/"${rc_c}" ] && . /etc/conf.d/"${rc_c}" >&2
39     fi
40     unset rc_c
41    
42     [ -e /etc/conf.d/"${SVCNAME}" ] && . /etc/conf.d/"${SVCNAME}" >&2
43    
44 uberlord 2547 if . /etc/init.d/"${SVCNAME}" ; then
45    
46     echo "${SVCNAME}"
47     depend
48    
49     # Add any user defined depends
50     need ${RC_NEED}
51     use ${RC_USE}
52     before ${RC_BEFORE}
53     after ${RC_AFTER}
54     provide ${RC_PROVIDE}
55     fi
56     )
57     done
58    
59     # vim: set ts=4 :

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20