]>
git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - debian/scripts/misc/splitconfig.pl
6 print "Reading config's ...\n";
10 next if $config !~ /^config\..*/;
11 # Nothing that is disabled, or remnant
12 next if $config =~ /.*\.(default|disabled|stub)$/;
14 %{$allconfigs{$config}} = ();
16 print " processing $config ... ";
18 open(CONFIG
, "< $config");
22 /^#*\s*CONFIG_(\w+)[\s=](.*)$/ or next;
24 ${$allconfigs{$config}}{$1} = $2;
36 print "Merging lists ... \n";
38 # %options - pointer to flavour config inside the allconfigs array
39 for $config (keys(%allconfigs)) {
40 my %options = %{$allconfigs{$config}};
42 print " processing $config ... ";
44 for $key (keys(%common)) {
45 next if not defined $common{$key};
47 # If we don't have the common option, then it isn't
48 # common. If we do have that option, it must have the same
49 # value. EXCEPT where this file does not have a value at all
50 # which may safely be merged with any other value; the value
51 # will be elided during recombination of the parts.
52 if (!defined($options{$key})) {
53 # Its ok really ... let it merge
54 } elsif (not defined($options{$key})) {
56 } elsif ($common{$key} ne $options{$key}) {
66 print "Creating common config ... ";
68 open(COMMON
, "> config.common");
69 print COMMON
"#\n# Common config options automatically generated by splitconfig.pl\n#\n";
71 for $key (sort(keys(%common))) {
72 if (not defined $common{$key}) {
73 print COMMON
"# CONFIG_$key is UNMERGABLE\n";
74 } elsif ($common{$key} eq "is not set") {
75 print COMMON
"# CONFIG_$key is not set\n";
77 print COMMON
"CONFIG_$key=$common{$key}\n";
84 print "Creating stub configs ...\n";
86 for $config (keys(%allconfigs)) {
87 my %options = %{$allconfigs{$config}};
89 print " processing $config ... ";
91 open(STUB
, "> $config");
92 print STUB
"#\n# Config options for $config automatically generated by splitconfig.pl\n#\n";
94 for $key (sort(keys(%options))) {
95 next if defined $common{$key};
97 if ($options{$key} =~ /^is /) {
98 print STUB
"# CONFIG_$key $options{$key}\n";
100 print STUB
"CONFIG_$key=$options{$key}\n";