#!/usr/bin/perl use FileHandle; my $KDIR=shift; my $ARCH=shift; sub open_kconfig($$) { my ($dir,$file)=@_; my $in = new FileHandle; print "opening $file\n"; open $in,"$file"; while (<$in>) { if (m;^\s*source[\s\"]+drivers/media/(video|dvb)/Kconfig;) { next; } if (m|^\s*source[\s\"]+([^\n\s\"]+)[\n\s\"]|) { open_kconfig($dir,"$dir/$1"); next; } s/^main(menu\s\"[^\"]+)/\1 - DON'T CHANGE IT!/; print OUT $_; } close $in; } open OUT,">Kconfig.kern"; open_kconfig($KDIR,"$KDIR/arch/$ARCH/Kconfig"); print OUT "endmenu\n"; close OUT; open OUT,">Kconfig"; print OUT "mainmenu \"V4L/DVB menu\"\n"; open_kconfig ("../linux","../linux/drivers/media/video/Kconfig"); open_kconfig ("../linux","../linux/drivers/media/dvb/Kconfig"); print OUT "source Kconfig.kern\n"; close OUT;