From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1065740-garchives=archives.gentoo.org@lists.gentoo.org>
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 866BD138335
	for <garchives@archives.gentoo.org>; Mon,  7 Jan 2019 16:20:23 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 97E32E089B;
	Mon,  7 Jan 2019 16:20:22 +0000 (UTC)
Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(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 6D663E089B
	for <gentoo-commits@lists.gentoo.org>; Mon,  7 Jan 2019 16:20:22 +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 23A68335D06
	for <gentoo-commits@lists.gentoo.org>; Mon,  7 Jan 2019 16:20:20 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 84C1D2A7
	for <gentoo-commits@lists.gentoo.org>; Mon,  7 Jan 2019 16:20:18 +0000 (UTC)
From: "Michael Haubenwallner" <haubi@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Michael Haubenwallner" <haubi@gentoo.org>
Message-ID: <1546878007.48d25efbdd1168a074338d7bf636a532aec81bd6.haubi@gentoo>
Subject: [gentoo-commits] repo/proj/prefix:master commit in: scripts/
X-VCS-Repository: repo/proj/prefix
X-VCS-Files: scripts/bootstrap-prefix.sh
X-VCS-Directories: scripts/
X-VCS-Committer: haubi
X-VCS-Committer-Name: Michael Haubenwallner
X-VCS-Revision: 48d25efbdd1168a074338d7bf636a532aec81bd6
X-VCS-Branch: master
Date: Mon,  7 Jan 2019 16:20:18 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: e1753f29-3565-43ee-9304-93ac06cb4a87
X-Archives-Hash: 56a3ca70d791285f9d147c4302e809e5

commit:     48d25efbdd1168a074338d7bf636a532aec81bd6
Author:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
AuthorDate: Mon Jan  7 14:55:54 2019 +0000
Commit:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
CommitDate: Mon Jan  7 16:20:07 2019 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=48d25efb

bootstrap-prefix.sh: really fake install-info too

sys-apps/groff really lacks a dependency on texinfo or should configure
--without-doc. As the INSTALL_INFO environment variable from stage3 is
not preserved for emerge -e system, the host system's real install-info
program does choke on empty info files generated by our fake makeinfo.
Also, have makeinfo touch only real output files from -o or --output.

Signed-off-by: Michael Haubenwallner <haubi <AT> gentoo.org>

 scripts/bootstrap-prefix.sh | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index e9cafdb11d..8ff6f94057 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -1705,20 +1705,30 @@ bootstrap_stage3() {
 	# GCC sometimes decides that it needs to run makeinfo to update some
 	# info pages from .texi files.  Obviously we don't care at this
 	# stage and rather have it continue instead of aborting the build
-	[[ -x "${ROOT}"/usr/bin/makeinfo ]] || cat > "${ROOT}"/usr/bin/makeinfo <<-EOF
+	if [[ ! -x "${ROOT}"/usr/bin/makeinfo ]]
+	then
+		cat > "${ROOT}"/usr/bin/makeinfo <<-EOF
 		#!${ROOT}/bin/bash
+		### bootstrap-prefix.sh will act on this line ###
 		echo "makeinfo GNU texinfo 4.13"
-		for a in \$@; do
+		f=
+		while (( \$# > 0 )); do
+		a=\$1
+		shift
 		case \$a in
-		--*) f=\$(echo "\$a" | sed -r 's,--.*=(.*),\1,') ;;
-		-*) continue ;;
-		*) f=\$a ;;
+		--output=) continue ;;
+		--output=*) f=\${a#--output=} ;;
+		-o) f=\$1; shift;;
 		esac
-		[[ -e \$f ]] || touch \$f
 		done
+		[[ -z \$f ]] || [[ -e \$f ]] || touch "\$f"
+		EOF
+		cat > "${ROOT}"/usr/bin/install-info <<-EOF
+		#!${ROOT}/bin/bash
+		:
 		EOF
-	chmod +x "${ROOT}"/usr/bin/makeinfo
-	export INSTALL_INFO="${ROOT}"/usr/bin/makeinfo
+		chmod +x "${ROOT}"/usr/bin/{makeinfo,install-info}
+	fi
 
 	if is-rap ; then
 		# Bug 655414. Copy portage global config from stage2