1 #!/usr/bin/env perl !! 1 #!/usr/bin/perl 2 # SPDX-License-Identifier: GPL-2.0 << 3 2 4 open (IN,"ktest.pl"); 3 open (IN,"ktest.pl"); 5 while (<IN>) { 4 while (<IN>) { 6 # hashes are now used 5 # hashes are now used 7 if (/\$opt\{"?([A-Z].*?)(\[.*\])?"?\}/ || 6 if (/\$opt\{"?([A-Z].*?)(\[.*\])?"?\}/ || 8 /^\s*"?([A-Z].*?)"?\s*=>\s*/ || 7 /^\s*"?([A-Z].*?)"?\s*=>\s*/ || 9 /set_test_option\("(.*?)"/) { 8 /set_test_option\("(.*?)"/) { 10 $opt{$1} = 1; 9 $opt{$1} = 1; 11 } 10 } 12 } 11 } 13 close IN; 12 close IN; 14 13 15 open (IN, "sample.conf"); 14 open (IN, "sample.conf"); 16 while (<IN>) { 15 while (<IN>) { 17 if (/^\s*#?\s*([A-Z]\S*)\s*=/) { 16 if (/^\s*#?\s*([A-Z]\S*)\s*=/) { 18 $samp{$1} = 1; 17 $samp{$1} = 1; 19 } 18 } 20 } 19 } 21 close IN; 20 close IN; 22 21 23 foreach $opt (keys %opt) { 22 foreach $opt (keys %opt) { 24 if (!defined($samp{$opt})) { 23 if (!defined($samp{$opt})) { 25 print "opt = $opt\n"; 24 print "opt = $opt\n"; 26 } 25 } 27 } 26 } 28 27 29 foreach $samp (keys %samp) { 28 foreach $samp (keys %samp) { 30 if (!defined($opt{$samp})) { 29 if (!defined($opt{$samp})) { 31 print "samp = $samp\n"; 30 print "samp = $samp\n"; 32 } 31 } 33 } 32 }
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.