Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/openrc:master commit in: scripts/, init.d/, sh/, support/openvpn/, init.d.misc/
Date: Mon, 02 Dec 2013 08:09:34
Message-Id: 1385971720.60d288a877a3671ea5b3483ed7c4612ec897b99a.williamh@OpenRC
1 commit: 60d288a877a3671ea5b3483ed7c4612ec897b99a
2 Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
3 AuthorDate: Mon Dec 2 01:25:01 2013 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Mon Dec 2 08:08:40 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=60d288a8
7
8 remove type command
9
10 The posix equivalent of the type command is "command -v", so now we use
11 that. Thanks to Jonathan Callen <jcallen <AT> gentoo.org> for informing me
12 wrt the fix.
13
14 ---
15 init.d.misc/openvpn.in | 2 +-
16 init.d/bootmisc.in | 2 +-
17 init.d/hostid.in | 2 +-
18 init.d/local.in | 4 ++--
19 init.d/loopback.in | 2 +-
20 init.d/pf.in | 2 +-
21 scripts/on_ac_power | 2 +-
22 sh/init-early.sh.Linux.in | 2 +-
23 sh/rc-mount.sh | 2 +-
24 support/openvpn/down.sh | 2 +-
25 support/openvpn/up.sh | 2 +-
26 11 files changed, 12 insertions(+), 12 deletions(-)
27
28 diff --git a/init.d.misc/openvpn.in b/init.d.misc/openvpn.in
29 index 7915623..699fc04 100644
30 --- a/init.d.misc/openvpn.in
31 +++ b/init.d.misc/openvpn.in
32 @@ -53,7 +53,7 @@ start_pre()
33 eend $?
34 fi
35 else
36 - if type kldload >/dev/null 2>&1; then
37 + if command -v kldload >/dev/null 2>&1; then
38 # Hammer the modules home by default
39 sysctl -a | grep -q '\.tun\.' || kldload if_tun
40 sysctl -a | grep -q '\.tap\.' || kldload if_tap
41
42 diff --git a/init.d/bootmisc.in b/init.d/bootmisc.in
43 index 526ebff..1b35a0a 100644
44 --- a/init.d/bootmisc.in
45 +++ b/init.d/bootmisc.in
46 @@ -68,7 +68,7 @@ cleanup_var_run_dir()
47 do
48 # Clean stale sockets
49 if [ -S "$x" ]; then
50 - if type fuser >/dev/null 2>&1; then
51 + if command -v fuser >/dev/null 2>&1; then
52 fuser "$x" >/dev/null 2>&1 || rm -- "$x"
53 else
54 rm -- "$x"
55
56 diff --git a/init.d/hostid.in b/init.d/hostid.in
57 index e98ff91..ce5574b 100644
58 --- a/init.d/hostid.in
59 +++ b/init.d/hostid.in
60 @@ -40,7 +40,7 @@ reset()
61 {
62 local uuid= x="[0-9a-f]" y="$x$x$x$x"
63
64 - if type kenv >/dev/null 2>&1; then
65 + if command -v kenv >/dev/null 2>&1; then
66 uuid=$(kenv smbios.system.uuid 2>/dev/null)
67 fi
68 case "$uuid" in
69
70 diff --git a/init.d/local.in b/init.d/local.in
71 index fb2f9b1..e82d3cc 100644
72 --- a/init.d/local.in
73 +++ b/init.d/local.in
74 @@ -19,7 +19,7 @@ start()
75 [ -x "$file" ] && "$file"
76 done
77
78 - if type local_start >/dev/null 2>&1; then
79 + if command -v local_start >/dev/null 2>&1; then
80 ewarn "@SYSCONFDIR@/conf.d/local should be removed."
81 ewarn "Please move the code from the local_start function"
82 ewarn "to scripts with an .start extension"
83 @@ -39,7 +39,7 @@ stop()
84 [ -x "$file" ] && "$file"
85 done
86
87 - if type local_start >/dev/null 2>&1; then
88 + if command -v local_stop >/dev/null 2>&1; then
89 ewarn "@SYSCONFDIR@/conf.d/local should be removed."
90 ewarn "Please move the code from the local_stop function"
91 ewarn "to scripts with an .stop extension"
92
93 diff --git a/init.d/loopback.in b/init.d/loopback.in
94 index 0139b56..6267ec4 100644
95 --- a/init.d/loopback.in
96 +++ b/init.d/loopback.in
97 @@ -13,7 +13,7 @@ start()
98 {
99 if [ "$RC_UNAME" = Linux ]; then
100 ebegin "Bringing up network interface lo"
101 - if type ip > /dev/null 2>&1; then
102 + if command -v ip > /dev/null 2>&1; then
103 ip addr add 127.0.0.1/8 dev lo brd + scope host
104 ip route add 127.0.0.0/8 dev lo scope host
105 ip link set lo up
106
107 diff --git a/init.d/pf.in b/init.d/pf.in
108 index aed6539..a8b301d 100644
109 --- a/init.d/pf.in
110 +++ b/init.d/pf.in
111 @@ -17,7 +17,7 @@ depend() {
112 start()
113 {
114 ebegin "Starting $name"
115 - if type kldload >/dev/null 2>&1; then
116 + if command -v kldload >/dev/null 2>&1; then
117 kldload pf 2>/dev/null
118 fi
119 pfctl -q -F all
120
121 diff --git a/scripts/on_ac_power b/scripts/on_ac_power
122 index 5dd516f..b35094f 100755
123 --- a/scripts/on_ac_power
124 +++ b/scripts/on_ac_power
125 @@ -19,7 +19,7 @@ elif [ -f /proc/pmu/info ]; then
126 "AC Power"*": 0") exit 128;;
127 esac
128 done
129 -elif type envstat >/dev/null 2>&1; then
130 +elif command -v envstat >/dev/null 2>&1; then
131 # NetBSD has envstat
132 envstat -d acpiacad0 2>/dev/null | while read line; do
133 case "$line" in
134
135 diff --git a/sh/init-early.sh.Linux.in b/sh/init-early.sh.Linux.in
136 index 9270e7f..a4116fc 100644
137 --- a/sh/init-early.sh.Linux.in
138 +++ b/sh/init-early.sh.Linux.in
139 @@ -31,7 +31,7 @@ if service_present "$RC_DEFAULTLEVEL" consolefont ||
140 service_present "$RC_BOOTLEVEL" consolefont; then
141 printf "\033%s" "$termencoding" >"$CONSOLE" 2>/dev/null
142 if [ -r "$RC_LIBEXECDIR"/console/font ] && \
143 - type setfont > /dev/null 2>&1; then
144 + command -v setfont > /dev/null 2>&1; then
145 [ -c "$CONSOLE" ] && cons="-C $CONSOLE"
146 setfont $cons "$RC_LIBEXECDIR"/console/font 2>/dev/null
147 fi
148
149 diff --git a/sh/rc-mount.sh b/sh/rc-mount.sh
150 index 454f9f9..cd5d0f7 100644
151 --- a/sh/rc-mount.sh
152 +++ b/sh/rc-mount.sh
153 @@ -40,7 +40,7 @@ do_unmount()
154
155 retry=4 # Effectively TERM, sleep 1, TERM, sleep 1, KILL, sleep 1
156 while ! LC_ALL=C $cmd "$mnt" 2>/dev/null; do
157 - if type fuser >/dev/null 2>&1; then
158 + if command -v fuser >/dev/null 2>&1; then
159 pids="$(timeout -k 10 -s KILL "${rc_fuser_timeout:-60}" \
160 fuser $f_opts "$mnt" 2>/dev/null)"
161 fi
162
163 diff --git a/support/openvpn/down.sh b/support/openvpn/down.sh
164 index 93dd53c..b94862b 100755
165 --- a/support/openvpn/down.sh
166 +++ b/support/openvpn/down.sh
167 @@ -6,7 +6,7 @@
168 [ -x "${RC_SVCNAME}"-down.sh ] && "${RC_SVCNAME}"-down.sh
169
170 # Restore resolv.conf to how it was
171 -if type resolvconf >/dev/null 2>&1; then
172 +if command -v resolvconf >/dev/null 2>&1; then
173 resolvconf -d "${dev}"
174 elif [ -e /etc/resolv.conf-"${dev}".sv ]; then
175 # Important that we copy instead of move incase resolv.conf is
176
177 diff --git a/support/openvpn/up.sh b/support/openvpn/up.sh
178 index f207dce..8e21069 100755
179 --- a/support/openvpn/up.sh
180 +++ b/support/openvpn/up.sh
181 @@ -45,7 +45,7 @@ if [ -n "${NS}" ]; then
182 DNS="${DNS}domain ${DOMAIN}\n"
183 fi
184 DNS="${DNS}${NS}"
185 - if type resolvconf >/dev/null 2>&1; then
186 + if command -v resolvconf >/dev/null 2>&1; then
187 printf "${DNS}" | resolvconf -a "${dev}"
188 else
189 # Preserve the existing resolv.conf