From ef11beb172ea96caa2378f6210bcc913b3fd92306f7851a397c8c961d2d5e3e8 Mon Sep 17 00:00:00 2001 From: Michal Marek Date: Tue, 4 Oct 2011 05:01:22 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/Kernel:HEAD/kernel-source?expand=0&rev=7062 --- configtool.pl | 60 --------------------------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 configtool.pl diff --git a/configtool.pl b/configtool.pl deleted file mode 100644 index 736c4b59..00000000 --- a/configtool.pl +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/perl -# -# Merge two kernel configs, eliminating duplicated assignments. -# TODO: -# support for #include-style directives in config files, to make the -# kernel configs more maintainable - -use strict; -use warnings; - -# ( { source => name => ... value => ...}, { comment => ...}, ... ) -my @lines; -# references into the @lines array -my %variables; - -sub store_var { - my ($file, $line, $name, $value) = @_; - - if (exists($variables{$name})) { - if ($variables{$name}->{source} eq $file) { - print STDERR "$file:$line: warning: $name redefined\n"; - } - } else { - my $new = {}; - push(@lines, $new); - $variables{$name} = $new; - } - $variables{$name}->{source} = $file; - $variables{$name}->{name} = $name; - $variables{$name}->{value} = $value; -} - -sub store_comment { - my ($comment) = @_; - - push(@lines, { comment => $comment }); -} - -while (<>) { - chomp; - if (/^CONFIG_(\w+)=(.*)/) { - store_var($ARGV, $., $1, $2); - } elsif (/^# CONFIG_(\w+) is not set/) { - store_var($ARGV, $., $1, 'n'); - } elsif (/^$|^#/) { - store_comment($_); - } else { - print STDERR "$ARGV:$.: warning: ignoring unknown line\n"; - } -} - -for my $line (@lines) { - if (exists($line->{comment})) { - print "$line->{comment}\n"; - } elsif ($line->{value} eq 'n') { - print "# CONFIG_$line->{name} is not set\n"; - } else { - print "CONFIG_$line->{name}=$line->{value}\n"; - } -}