1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
|
--- sbin/depscan.sh 2005-07-22 01:24:27.000000000 +0100
+++ sbin/depscan.sh 2006-03-02 20:28:03.000000000 +0000
@@ -1,58 +1,64 @@
#!/bin/bash
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout/files/baselayout-1.11.14-depscan.patch,v 1.3 2006/03/02 22:27:16 uberlord Exp $
-source /etc/init.d/functions.sh
-
-if [[ $1 == "--debug" ]] ; then
+. /sbin/functions.sh
+mysvcdir="${svcdir}"
+update=false
+
+while [[ -n $1 ]] ; do
+ case "$1" in
+ --debug|-d)
+ set -x
+ ;;
+ --svcdir|-s)
+ if [[ -z $2 || $2 == -* ]] ; then
+ eerror "No svcdir specified"
+ else
+ shift
+ mysvcdir="$1"
+ fi
+ ;;
+ --update|-u)
+ update=true
+ ;;
+ esac
shift
- set -x
-fi
+done
-if [ ! -d "${svcdir}" ]
-then
- if ! mkdir -p -m 0755 "${svcdir}" 2>/dev/null
- then
- eerror " Could not create needed directory '${svcdir}'!"
+if [[ ! -d ${mysvcdir} ]] ; then
+ if ! mkdir -p -m 0755 "${mysvcdir}" 2>/dev/null ; then
+ eerror "Could not create needed directory '${mysvcdir}'!"
fi
fi
-for x in softscripts snapshot options started
-do
- if [ ! -d "${svcdir}/${x}" ]
- then
- if ! mkdir -p -m 0755 "${svcdir}/${x}" 2>/dev/null
- then
- eerror " Could not create needed directory '${svcdir}/${x}'!"
+for x in softscripts snapshot options started ; do
+ if [[ ! -d "${mysvcdir}/${x}" ]] ; then
+ if ! mkdir -p -m 0755 "${mysvcdir}/${x}" 2>/dev/null ; then
+ eerror "Could not create needed directory '${mysvcdir}/${x}'!"
fi
fi
done
# Only update if files have actually changed
-update=1
-if [ "$1" == "-u" ]
-then
- update=0
- for config in /etc/conf.d /etc/init.d /etc/rc.conf
- do
- if [ "${config}" -nt "${svcdir}/depcache" ]
- then
- update=1
+if ! ${update} ; then
+ for config in /etc/conf.d /etc/init.d /etc/rc.conf ; do
+ if [[ ${config} -nt "${mysvcdir}/depcache" ]] ; then
+ update=true
break
fi
done
- shift
fi
-[ ${update} -eq 0 ] && exit 0
+
+! ${update} && exit 0
ebegin "Caching service dependencies"
# Clean out the non volitile directories ...
-rm -rf "${svcdir}"/dep{cache,tree} "${svcdir}"/{broken,snapshot}/*
+rm -rf "${mysvcdir}"/dep{cache,tree} "${mysvcdir}"/{broken,snapshot}/*
retval=0
-SVCDIR="${svcdir}"
+SVCDIR="${mysvcdir}"
DEPTYPES="${deptypes}"
ORDTYPES="${ordtypes}"
@@ -65,17 +71,17 @@
-f /lib/rcscripts/awk/cachedepends.awk || \
retval=1
-bash "${svcdir}/depcache" | \
+bash "${mysvcdir}/depcache" | \
/bin/gawk \
-f /lib/rcscripts/awk/functions.awk \
-f /lib/rcscripts/awk/gendepends.awk || \
retval=1
-touch -m "${svcdir}"/dep{cache,tree}
+touch "${mysvcdir}"/dep{cache,tree}
+chmod 0644 "${mysvcdir}"/dep{cache,tree}
eend ${retval} "Failed to cache service dependencies"
exit ${retval}
-
# vim:ts=4
--- sbin/rc 2006-03-02 22:10:56.000000000 +0000
+++ sbin/rc 2006-03-02 20:28:03.000000000 +0000
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2005 Gentoo Foundation
+# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout/files/baselayout-1.11.14-depscan.patch,v 1.3 2006/03/02 22:27:16 uberlord Exp $
@@ -111,7 +111,7 @@
echo
echo -e "${GOOD}Gentoo Linux${GENTOO_VERS}; ${BRACKET}http://www.gentoo.org/${NORMAL}"
- echo -e " Copyright 1999-2005 Gentoo Foundation; Distributed under the GPLv2"
+ echo -e " Copyright 1999-2006 Gentoo Foundation; Distributed under the GPLv2"
echo
check_statedir /proc
@@ -407,7 +407,7 @@
grep -ve '\(depcache\|deptree\|envcache\)')
# Update the dependency cache
- /sbin/depscan.sh -u
+ /sbin/depscan.sh
# Now that the dependency cache are up to date, make sure these
# are marked as started ...
--- sbin/rc-services.sh 2005-03-08 16:07:30.000000000 +0000
+++ sbin/rc-services.sh 2006-03-02 20:28:03.000000000 +0000
@@ -10,7 +10,7 @@
if [ "${RC_GOT_DEPTREE_INFO}" != "yes" ]
then
- if ! /sbin/depscan.sh -u
+ if ! /sbin/depscan.sh
then
echo
eerror "Error running '/sbin/depscan.sh'!"
|