treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / tools / testing / selftests / rcutorture / bin / config_override.sh
blob90016c359e8393e0d1ad54f1dd76ee2b7966c5dd
1 #!/bin/bash
2 # SPDX-License-Identifier: GPL-2.0+
4 # config_override.sh base override
6 # Combines base and override, removing any Kconfig options from base
7 # that conflict with any in override, concatenating what remains and
8 # sending the result to standard output.
10 # Copyright (C) IBM Corporation, 2017
12 # Authors: Paul E. McKenney <paulmck@linux.ibm.com>
14 base=$1
15 if test -r $base
16 then
18 else
19 echo Base file $base unreadable!!!
20 exit 1
23 override=$2
24 if test -r $override
25 then
27 else
28 echo Override file $override unreadable!!!
29 exit 1
32 T=${TMPDIR-/tmp}/config_override.sh.$$
33 trap 'rm -rf $T' 0
34 mkdir $T
36 sed < $override -e 's/^/grep -v "/' -e 's/=.*$/="/' |
37 awk '
39 if (last)
40 print last " |";
41 last = $0;
43 END {
44 if (last)
45 print last;
46 }' > $T/script
47 sh $T/script < $base
48 cat $override