From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 835FE1382C5 for ; Thu, 15 Mar 2018 18:49:53 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 50E89E0897; Thu, 15 Mar 2018 18:49:52 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 278D7E0897 for ; Thu, 15 Mar 2018 18:49:51 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 882E7335C7B for ; Thu, 15 Mar 2018 18:49:50 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0CBA215A for ; Thu, 15 Mar 2018 18:49:48 +0000 (UTC) From: "Richard Farina" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Richard Farina" Message-ID: <1521139744.4afe3e67f65cd7e1cf910b02c25fb0bb6dbc0a1a.zerochaos@gentoo> Subject: [gentoo-commits] proj/livecd-tools:master commit in: init.d/ X-VCS-Repository: proj/livecd-tools X-VCS-Files: init.d/autoconfig X-VCS-Directories: init.d/ X-VCS-Committer: zerochaos X-VCS-Committer-Name: Richard Farina X-VCS-Revision: 4afe3e67f65cd7e1cf910b02c25fb0bb6dbc0a1a X-VCS-Branch: master Date: Thu, 15 Mar 2018 18:49:48 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 87ddabdc-eeb9-4271-b4c9-50c5f8079892 X-Archives-Hash: 4630a5471de197bf4a212826faa99f18 commit: 4afe3e67f65cd7e1cf910b02c25fb0bb6dbc0a1a Author: Rick Farina (Zero_Chaos) gentoo org> AuthorDate: Thu Mar 15 18:49:04 2018 +0000 Commit: Richard Farina gentoo org> CommitDate: Thu Mar 15 18:49:04 2018 +0000 URL: https://gitweb.gentoo.org/proj/livecd-tools.git/commit/?id=4afe3e67 add some comments when writing make.conf decrease ambiguity with some comments init.d/autoconfig | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/init.d/autoconfig b/init.d/autoconfig index 848a102..fd68011 100644 --- a/init.d/autoconfig +++ b/init.d/autoconfig @@ -382,6 +382,12 @@ detect_netdevices() { return 0 } +write_emerge_default_opts() { + printf "\n# EMERGE_DEFAULT_OPTS is set automatically by livecd-tools autoconfig during first live boot.\n" >> $1 + printf "# This should be equal to number of processors, see \"man emerge\" for details.\n" >> $1 + printf "EMERGE_DEFAULT_OPTS=\"\${EMERGE_DEFAULT_OPTS} --jobs=${numcpu} --load-average=${numcpu}\"\n" >> $1 +} + start() { ebegin "Starting autoconfig" echo "0" > /proc/sys/kernel/printk @@ -392,13 +398,13 @@ start() { 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 + write_emerge_default_opts /etc/portage/make.conf 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 + write_emerge_default_opts /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 + write_emerge_default_opts /etc/portage/make.conf/livecd-tools-autoconfig fi else false