]> git.pld-linux.org Git - packages/kernel.git/blobdiff - kernel-track-config-change.awk
- 4.19.40
[packages/kernel.git] / kernel-track-config-change.awk
index b7ee300fecb325591b0f45a654b55a4077ed79e2..6b3fe5002accf2c9beec04f328c5921787398835 100644 (file)
@@ -1,24 +1,34 @@
 # $Id$
 
 BEGIN {
-       if ( ! infile ) {
+       if (!infile) {
                print "infile= must be specified" > "/dev/stderr"
                exit 1
        }
 
-       while ( getline < infile ) {
-               if ( match( $0, /^# CONFIG_[A-Za-z0-9_]+ is not set$/ ) ) {
-                       optionArray[ $2 ] = "n";
-               } else if ( match( $0, /^CONFIG_[A-Za-z0-9_]+=/ ) ) {
+       file = ""
+       while ((rc = getline < infile) > 0) {
+               name = ""
+               if ( match($0, /^# CONFIG_[A-Za-z0-9_]+ is not set$/)) {
+                       name = $2
+                       value = "n"
+               } else if (match($0, /^CONFIG_[A-Za-z0-9_]+=/)) {
                        name = value = $1
 
-                       sub( /=.*$/, "", name )
-                       sub( /^[^=]*=/, "", value )
-
-                       optionArray[ name ] = value;
-                       continue
+                       sub(/=.*$/, "", name)
+                       sub(/^[^=]*=/, "", value)
+               } else if (match($0, /^# file:/)) {
+                       file = $3
+               }
+               if (length(name)) {
+                       optionArray[name] = value
+                       optionFile[name] = file
                }
        }
+       if (rc == -1) {
+               printf("Error reading infile='%s'\n", infile) > "/dev/stderr"
+               exit 1
+       }
 
        foundErrors = 0
 }
@@ -49,7 +59,8 @@ BEGIN {
                #print "Warning: new option " name " with value " value
        } else {
                if ( value != orig ) {
-                       print "ERROR: option " name " redefined from " orig " to " value
+                       print "ERROR (" optionFile[ name ] "): " name \
+                             " redefined from `" orig "' to `" value "'" > "/dev/stderr"
                        foundErrors++
                }
        }
@@ -57,7 +68,7 @@ BEGIN {
 
 END {
        if ( foundErrors ) {
-               print "There were " foundErrors " errors"
+               print "There were " foundErrors " errors" > "/dev/stderr"
                if ( dieOnError )
                        exit 1
        }
This page took 0.420935 seconds and 4 git commands to generate.