48 lines · bash
1#!/bin/bash2# SPDX-License-Identifier: GPL-2.0+3#4# config_override.sh base override5#6# Combines base and override, removing any Kconfig options from base7# that conflict with any in override, concatenating what remains and8# sending the result to standard output.9#10# Copyright (C) IBM Corporation, 201711#12# Authors: Paul E. McKenney <paulmck@linux.ibm.com>13 14base=$115if test -r $base16then17 :18else19 echo Base file $base unreadable!!!20 exit 121fi22 23override=$224if test -r $override25then26 :27else28 echo Override file $override unreadable!!!29 exit 130fi31 32T="`mktemp -d ${TMPDIR-/tmp}/config_override.sh.XXXXXX`"33trap 'rm -rf $T' 034 35sed < $override -e 's/^/grep -v "/' -e 's/=.*$/="/' |36 awk '37 {38 if (last)39 print last " |";40 last = $0;41 }42 END {43 if (last)44 print last;45 }' > $T/script46sh $T/script < $base47cat $override48