From 51c4b44a3d1ce554d1755fe57dee9066b314d693 Mon Sep 17 00:00:00 2001 From: Andrey Mazo Date: Sat, 29 Apr 2017 21:24:02 +0300 Subject: [PATCH 1/1] kernel-2.eclass: create .tmp_gas_check under $(T) The eclass was erroneously creating $(T).tmp_gas_check file instead of .tmp_gas_check under $(T). A naive "$(T)/.tmp_gas_check" wouldn't work when $(T) is unset (like for manual `make` invocations), so use $(addsuffix) trick to append / only if $(T) is set. Also, deduplicate sed invocations and make the regexp more resilient to whitespace changes upstream. Bug #336732. --- eclass/kernel-2.eclass | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass index db4a3bf..26a20ba 100644 --- a/eclass/kernel-2.eclass +++ b/eclass/kernel-2.eclass @@ -1490,17 +1490,13 @@ kernel-2_src_unpack() { fi # fix a problem on ppc where TOUT writes to /usr/src/linux breaking sandbox - # only do this for kernel < 2.6.27 since this file does not exist in later - # kernels + local ppc_makefile="${S}"/arch/powerpc/Makefile if [[ -n ${KV_MINOR} && ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} < 2.6.27 ]] ; then - sed -i \ - -e 's|TOUT := .tmp_gas_check|TOUT := $(T).tmp_gas_check|' \ - "${S}"/arch/ppc/Makefile - else - sed -i \ - -e 's|TOUT := .tmp_gas_check|TOUT := $(T).tmp_gas_check|' \ - "${S}"/arch/powerpc/Makefile + ppc_makefile="${S}"/arch/ppc/Makefile fi + sed -i \ + -e 's|^\(TOUT.*:= \)\(\.tmp_gas_check\)|\1$(addsuffix /,$(T))\2|' \ + "${ppc_makefile}" } # @FUNCTION: kernel-2_src_prepare -- 2.10.2