]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blame - debian/scripts/misc/tristate.sh
UBUNTU: [Debian] Added tristate.sh
[mirror_ubuntu-zesty-kernel.git] / debian / scripts / misc / tristate.sh
CommitLineData
1f2f120f
TG
1#!/bin/bash
2
3#
4# Find config variables that might be able to transition from =y to =m
5#
6# Example: debian/scripts/misc/tristate.sh debian.master/config/config.common.ubuntu
7#
8
9KC=Kconfig.tmp
10rm -f ${KC}
11find .|grep Kconfig | while read f
12do
13 cat $f >> ${KC}
14done
15
16grep =y $1 | sed -e 's/CONFIG_//' -e 's/=y//' | while read c
17do
18 cat <<EOF > tristate.awk
19BEGIN { tristate=0; }
20/^config ${c}\$/ { tristate=1; next; }
21/tristate/ { if (tristate == 1) printf("CONFIG_%s=m\n","${c}"); next; }
22{ if (tristate == 1) exit; }
23EOF
24
25 gawk -f tristate.awk ${KC}
26done