summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2018-03-14 23:30:30 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2018-03-14 23:33:30 -0500
commitf672cb58a56638c9df5695015742aa3b2c37f2e8 (patch)
treea146c7c1937fd53e8c044a9f6d4e7904b2ff7765
parentupdate make.conf with some nice defaults for emerge (diff)
downloadlivecd-tools-f672cb58a56638c9df5695015742aa3b2c37f2e8.tar.gz
livecd-tools-f672cb58a56638c9df5695015742aa3b2c37f2e8.tar.bz2
livecd-tools-f672cb58a56638c9df5695015742aa3b2c37f2e8.zip
autoconfig: fix the indentation
-rw-r--r--init.d/autoconfig23
1 files changed, 12 insertions, 11 deletions
diff --git a/init.d/autoconfig b/init.d/autoconfig
index 715350e..848a102 100644
--- a/init.d/autoconfig
+++ b/init.d/autoconfig
@@ -386,22 +386,23 @@ start() {
ebegin "Starting autoconfig"
echo "0" > /proc/sys/kernel/printk
get_config
+
local numcpu="$(grep -c '^processor[[:space:]]\+:' /proc/cpuinfo)"
eindent
ebegin "Setting sane defaults in /etc/portage/make.conf"
- if [ -f "/etc/portage/make.conf" ] && checkpath -W /etc/portage/make.conf; then
- if ! grep -q 'EMERGE_DEFAULT_OPTS=.*--jobs' /etc/portage/make.conf; then
- printf "EMERGE_DEFAULT_OPTS=\"\${EMERGE_DEFAULT_OPTS} --jobs=${numcpu} --load-average=${numcpu}\"\n" >> /etc/portage/make.conf
- fi
- elif [ ! -f "/etc/portage/make.conf" ] && [ ! -d "/etc/portage/make.conf" ] && checkpath -W /etc/portage; then
+ if [ -f "/etc/portage/make.conf" ] && checkpath -W /etc/portage/make.conf; then
+ if ! grep -q 'EMERGE_DEFAULT_OPTS=.*--jobs' /etc/portage/make.conf; then
printf "EMERGE_DEFAULT_OPTS=\"\${EMERGE_DEFAULT_OPTS} --jobs=${numcpu} --load-average=${numcpu}\"\n" >> /etc/portage/make.conf
- elif [ -d "/etc/portage/make.conf" ]; then
- if [ ! -f "/etc/portage/make.conf/livecd-tools-autoconfig" ] && checkpath -W /etc/portage/make.conf/livecd-tools-autoconfig; then
- printf "EMERGE_DEFAULT_OPTS=\"\${EMERGE_DEFAULT_OPTS} --jobs=${numcpu} --load-average=${numcpu}\"\n" >> /etc/portage/make.conf/livecd-tools-autoconfig
- fi
- else
- false
fi
+ elif [ ! -f "/etc/portage/make.conf" ] && [ ! -d "/etc/portage/make.conf" ] && checkpath -W /etc/portage; then
+ printf "EMERGE_DEFAULT_OPTS=\"\${EMERGE_DEFAULT_OPTS} --jobs=${numcpu} --load-average=${numcpu}\"\n" >> /etc/portage/make.conf
+ elif [ -d "/etc/portage/make.conf" ]; then
+ if [ ! -f "/etc/portage/make.conf/livecd-tools-autoconfig" ] && checkpath -W /etc/portage/make.conf/livecd-tools-autoconfig; then
+ printf "EMERGE_DEFAULT_OPTS=\"\${EMERGE_DEFAULT_OPTS} --jobs=${numcpu} --load-average=${numcpu}\"\n" >> /etc/portage/make.conf/livecd-tools-autoconfig
+ fi
+ else
+ false
+ fi
eend $? "Unable to write to /etc/portage/make.conf"
eoutdent