aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig.pl
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-01-29 02:35:24 +0000
committerFelix Fietkau <nbd@openwrt.org>2011-01-29 02:35:24 +0000
commitc7c7837117e718279904064cc4a1a15bdfd2563f (patch)
treec99a3b28e94b37dd51da08d2c243f0a84c5b09a2 /scripts/kconfig.pl
parent73ea5d23f2c7218b73f1455da207eac3ab90604c (diff)
downloadupstream-c7c7837117e718279904064cc4a1a15bdfd2563f.tar.gz
upstream-c7c7837117e718279904064cc4a1a15bdfd2563f.tar.bz2
upstream-c7c7837117e718279904064cc4a1a15bdfd2563f.zip
scripts/kconfig.pl: add a mode to generate a config diff that ignores added undefined config values
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@25232 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'scripts/kconfig.pl')
-rwxr-xr-xscripts/kconfig.pl10
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/kconfig.pl b/scripts/kconfig.pl
index 7073e3b1ae..8113273538 100755
--- a/scripts/kconfig.pl
+++ b/scripts/kconfig.pl
@@ -80,13 +80,15 @@ sub config_add($$$) {
return \%config;
}
-sub config_diff($$) {
+sub config_diff($$$) {
my $cfg1 = shift;
my $cfg2 = shift;
+ my $new_only = shift;
my %config;
foreach my $config (keys %$cfg2) {
if (!defined($cfg1->{$config}) or $cfg1->{$config} ne $cfg2->{$config}) {
+ next if $new_only and !defined($cfg1->{$config}) and $cfg2->{$config} eq '#undef';
$config{$config} = $cfg2->{$config};
}
}
@@ -146,7 +148,11 @@ sub parse_expr {
} elsif ($arg eq '>') {
my $arg1 = parse_expr($pos);
my $arg2 = parse_expr($pos);
- return config_diff($arg1, $arg2);
+ return config_diff($arg1, $arg2, 0);
+ } elsif ($arg eq '>+') {
+ my $arg1 = parse_expr($pos);
+ my $arg2 = parse_expr($pos);
+ return config_diff($arg1, $arg2, 1);
} elsif ($arg eq '-') {
my $arg1 = parse_expr($pos);
my $arg2 = parse_expr($pos);