Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1#!/bin/bash
2#
3# config_override.sh base override
4#
5# Combines base and override, removing any Kconfig options from base
6# that conflict with any in override, concatenating what remains and
7# sending the result to standard output.
8#
9# This program is free software; you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation; either version 2 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program; if not, you can access it online at
21# http://www.gnu.org/licenses/gpl-2.0.html.
22#
23# Copyright (C) IBM Corporation, 2017
24#
25# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
26
27base=$1
28if test -r $base
29then
30 :
31else
32 echo Base file $base unreadable!!!
33 exit 1
34fi
35
36override=$2
37if test -r $override
38then
39 :
40else
41 echo Override file $override unreadable!!!
42 exit 1
43fi
44
45T=/tmp/config_override.sh.$$
46trap 'rm -rf $T' 0
47mkdir $T
48
49sed < $override -e 's/^/grep -v "/' -e 's/=.*$/="/' |
50 awk '
51 {
52 if (last)
53 print last " |";
54 last = $0;
55 }
56 END {
57 if (last)
58 print last;
59 }' > $T/script
60sh $T/script < $base
61cat $override