From 10afc14b52dcf30f7cddeed8f2388f9202835b28 Mon Sep 17 00:00:00 2001 From: Bertrand Jacquin Date: Sat, 20 Feb 2021 21:57:22 +0000 Subject: eclass/linux-build: ignore non matching lines in diff output --- eclass/linux-build.eclass | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'eclass') diff --git a/eclass/linux-build.eclass b/eclass/linux-build.eclass index fb19a8b1..b6dff6fc 100644 --- a/eclass/linux-build.eclass +++ b/eclass/linux-build.eclass @@ -448,16 +448,26 @@ _linux-build_src_prepare_build() { emake olddefconfig "${myopt[@]}" fi - if ! diff -q \ - --ignore-matching-lines '^$' \ - --ignore-matching-lines '^#' \ - --ignore-matching-lines '^CONFIG_PLUGIN_HOSTCC=' \ - --ignore-matching-lines '^CONFIG_GCC_VERSION=' \ - --ignore-matching-lines '^CONFIG_CLANG_VERSION=' \ - "${BUILDDIR}/.config.old" "${BUILDDIR}/.config" ; then + local -a _diff_opts=( + # Empty lines and comments + --ignore-matching-lines '^$' + --ignore-matching-lines '^#' + + # GCC vs Clang + --ignore-matching-lines '^CONFIG_CC_IS_GCC=' + --ignore-matching-lines '^CONFIG_CC_IS_CLANG=' + --ignore-matching-lines '^CONFIG_GCC_VERSION=' + --ignore-matching-lines '^CONFIG_CLANG_VERSION=' + --ignore-matching-lines '^CONFIG_PLUGIN_HOSTCC=' + --ignore-matching-lines '^CONFIG_CC_HAS_' + + # GCC only + --ignore-matching-lines '^CONFIG_KASAN_STACK=' + ) + if ! diff -q "${_diff_opts[@]}" "${BUILDDIR}/.config.old" "${BUILDDIR}/.config" ; then eerror "You configuration is not up to date" - diff -Nu "${BUILDDIR}/.config.old" "${BUILDDIR}/.config" + diff -Nu "${_diff_opts[@]}" "${BUILDDIR}/.config.old" "${BUILDDIR}/.config" die "Bad configuration" fi -- cgit v1.2.3