commit:     742fa9e975964c8b9fce47b1372eeae003e62dec
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 13 22:40:51 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sat Dec 14 00:08:48 2019 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=742fa9e9

gkbuild.sh: gkconf(): Update config.{guess,sub} with /usr/share/gnuconfig when 
possible

This will help to avoid build failures.

Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 worker_modules/gkbuild.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/worker_modules/gkbuild.sh b/worker_modules/gkbuild.sh
index 2c23386..601d052 100644
--- a/worker_modules/gkbuild.sh
+++ b/worker_modules/gkbuild.sh
@@ -642,6 +642,21 @@ gkconf() {
        : ${GKCONF_SOURCE:=.}
        if [ -x "${GKCONF_SOURCE}/configure" ]
        then
+               local pid=${BASHPID}
+               local x
+
+               if [ -e "/usr/share/gnuconfig/" ]
+               then
+                       find "${WORKDIR}" -type f '(' \
+                       -name config.guess -o -name config.sub ')' -print0 | \
+                       while read -r -d $'\0' x ; do
+                               print_info 3 "$(get_indent 2)${P}: >> Updating 
${x/${WORKDIR}\/} with /usr/share/gnuconfig/${x##*/} ..."
+                               # Make sure we do this atomically incase we're 
run in parallel. #487478
+                               cp -f /usr/share/gnuconfig/"${x##*/}" 
"${x}.${pid}"
+                               mv -f "${x}.${pid}" "${x}"
+                       done
+               fi
+
                local -a conf_args=()
                local conf_help=$("${GKCONF_SOURCE}/configure" --help 
2>/dev/null)
 

Reply via email to