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

Reply via email to