#! /bin/bash declare -a IGNORED_CONFIGS_RE=( "CONFIG_GCC_VERSION" "CONFIG_LD_VERSION" "CONFIG_CC_VERSION_TEXT" "CONFIG_CC_HAS_" "CONFIG_CC_HAVE_" "CONFIG_CC_CAN_" "CONFIG_HAVE_[A-Z]*_COMPILER" "CONFIG_TOOLS_SUPPORT_" ) declare -a SED_ARGS=() for CONFIG in "${IGNORED_CONFIGS_RE[@]}"; do SED_ARGS+=(-e "/$CONFIG/ d") done SED_ARGS+=( -e '/^# .* is not set$/p' -e '/^$\|^#/d' ) # lines 4 contains a timestamp... differences="$( diff -bU0 <(sed "${SED_ARGS[@]}" "$1" | sort) \ <(sed "${SED_ARGS[@]}" "$2" | sort) \ | grep '^[-+][^-+]' )" || true if [ -n "$differences" ]; then echo echo "Changes after running \`make oldconfig':" echo "$differences" echo if echo "$differences" | grep -q '^+' ; then exit 1 fi fi