Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/livecd-tools:bl2-only commit in: /
Date: Thu, 10 Feb 2011 23:58:03
Message-Id: 8d8fbc97a3d1485f0aa7e407e0d59eacd42ceef1.williamH@gentoo
1 commit: 8d8fbc97a3d1485f0aa7e407e0d59eacd42ceef1
2 Author: William Hubbs <williamh <AT> gentoo <DOT> org>
3 AuthorDate: Thu Feb 10 23:57:38 2011 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Thu Feb 10 23:57:38 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/livecd-tools.git;a=commit;h=8d8fbc97
7
8 migrate yes/no tests to use if yesno
9
10 ---
11 autoconfig | 35 +++++++++++++++++------------------
12 1 files changed, 17 insertions(+), 18 deletions(-)
13
14 diff --git a/autoconfig b/autoconfig
15 index 0f5ea58..c05a3d1 100755
16 --- a/autoconfig
17 +++ b/autoconfig
18 @@ -226,7 +226,7 @@ check_svc() {
19 list_services() {
20 get_config
21 # Must not print anything here
22 - if [ "${DETECT}" = "yes" ]
23 + if yesno "${DETECT}"
24 then
25 local arch="$(uname -m)"
26
27 @@ -402,14 +402,12 @@ start() {
28 echo "0" > /proc/sys/kernel/printk
29 get_config
30
31 - # DONE: BRLTTY migrated to depend
32 -
33 - if [ "${SPEAKUP}" = "yes" ]
34 + if yesno "${SPEAKUP}"
35 then
36 modprobe ${SPEAKUP_MODULE} ${SPEAKUP_OPTIONS}
37 fi
38
39 - if [ "${DETECT}" = "yes" ]
40 + if yesno "${DETECT}"
41 then
42 ebegin "Hardware detection started"
43 local numcpu="$(grep -c '^processor[[:space:]]\+:' /proc/cpuinfo)"
44 @@ -455,7 +453,7 @@ start() {
45 fi
46
47 # Now, we check if we are supposed to run a coldplug script.
48 - if [ "${COLDPLUG}" = "yes" ]
49 + if yesno "${COLDPLUG}"
50 then
51 # Check whether we should be using hotplug/coldplug or whether we should
52 # just let udev do it all.
53 @@ -475,7 +473,7 @@ start() {
54 ewarn "Hotplug/Coldplug disabled via cmdline ..."
55 fi
56
57 - if [ "${APM}" = "yes" ]
58 + if yesno "${APM}"
59 then
60 modprobe apm power_off=1 >/dev/null 2>&1 && \
61 einfo "APM BIOS found, power management functions enabled ..."
62 @@ -484,7 +482,7 @@ start() {
63 einfo "Not Loading APM Bios support ..."
64 fi
65
66 - if [ "${ACPI}" = "yes" ]
67 + if yesno "${ACPI}"
68 then
69 modprobe processor >/dev/null 2>&1 && \
70 ebegin "ACPI power management functions enabled" && \
71 @@ -502,21 +500,21 @@ start() {
72 einfo "Not Loading ACPI support ..."
73 fi
74
75 - if [ "${IDEDMA}" = "yes" ]
76 + if yesno "${IDEDMA}"
77 then
78 [ -x /etc/init.d/hdparm ] && /etc/init.d/hdparm start
79 else
80 ewarn "Disabling IDE DMA support ..."
81 fi
82
83 - if [ "${PCMCIA}" = "yes" ]
84 + if yesno "${PCMCIA}"
85 then
86 [ -x /etc/init.d/pcmcia ] && /etc/init.d/pcmcia start
87 else
88 ewarn "PCMCIA disabled via cmdline ..."
89 fi
90
91 - if [ "${DHCP}" = "no" ]
92 + if ! yesno "${DHCP}"
93 then
94 sed -i -e '/^ifconfig_eth.*dhcp.*/ s/^/#/' \
95 -e '/^iface_eth.*dhcp.*/ s/^/#/' \
96 @@ -548,7 +546,7 @@ start() {
97 then
98 for nics in ${NETDEVICES}
99 do
100 - if [ "${DHCP}" = "yes" ]
101 + if yesno "${DHCP}"
102 then
103 einfo "Network device ${HILITE}${nics}${NORMAL} detected, DHCP broadcasting for IP ..."
104 if [ -f /var/run/dhcpcd-${nics}.pid ]
105 @@ -562,22 +560,22 @@ start() {
106 fi
107 fi
108 done
109 - if [ "${NFS}" = "yes" ]
110 + if yesno "${NFS}"
111 then
112 [ -x /etc/init.d/portmap ] && /etc/init.d/portmap start
113 [ -x /etc/init.d/nfsmount ] && /etc/init.d/nfsmount start
114 fi
115 - if [ "${PASSWD}" = "no" ]
116 + if ! yesno "${PASSWD}"
117 then
118 echo "root:${PASSWORD}" | chpasswd > /dev/null 2>&1
119 else
120 /etc/init.d/pwgen start
121 fi
122 - if [ "${SSHD}" = "yes" ]
123 + if yesno "${SSHD}"
124 then
125 # If we have passwd= on the command line, we do not run pwgen and we
126 # set the root password to PASSWORD.
127 - if [ "${PASSWD}" = "yes" ]
128 + if yesno "${PASSWD}"
129 then
130 ewarn "WARNING: You are starting sshd with a scrambled root password!!!"
131 ewarn "WARNING: You need to set a root password to be able to login remotely."
132 @@ -588,7 +586,7 @@ start() {
133 ewarn "No Network device auto detected ..."
134 fi
135
136 - if [ "${ALSA}" = "yes" ]
137 + if yesno "${ALSA}"
138 then
139 if [ -n "${SOUND_FULLNAME}" -o -n "${SOUND_DRIVER}" ]
140 then
141 @@ -655,7 +653,8 @@ start() {
142
143 [ -n "${XDESC}" ] && einfo "VideoCard: ${HILITE}${XDESC}${NORMAL}"
144
145 - if [ "${X11}" = "no" ]
146 + if ! yesno "${X11}"
147 + then
148 touch /etc/.noxdm
149 fi