]> git.pld-linux.org Git - packages/kernel.git/blobdiff - kernel-track-config-change.awk
- up to 4.20.13
[packages/kernel.git] / kernel-track-config-change.awk
index dbe6ec804d6de2ace2667ed0456cd53fa107d292..6b3fe5002accf2c9beec04f328c5921787398835 100644 (file)
@@ -1,30 +1,34 @@
 # $Id$
 
 BEGIN {
-       if ( ! infile ) {
+       if (!infile) {
                print "infile= must be specified" > "/dev/stderr"
                exit 1
        }
 
        file = ""
-       while ( getline < infile ) {
+       while ((rc = getline < infile) > 0) {
                name = ""
-               if ( match( $0, /^# CONFIG_[A-Za-z0-9_]+ is not set$/ ) ) {
+               if ( match($0, /^# CONFIG_[A-Za-z0-9_]+ is not set$/)) {
                        name = $2
                        value = "n"
-               } else if ( match( $0, /^CONFIG_[A-Za-z0-9_]+=/ ) ) {
+               } else if (match($0, /^CONFIG_[A-Za-z0-9_]+=/)) {
                        name = value = $1
 
-                       sub( /=.*$/, "", name )
-                       sub( /^[^=]*=/, "", value )
-               } else if ( match( $0, /^# file:/ ) ) {
+                       sub(/=.*$/, "", name)
+                       sub(/^[^=]*=/, "", value)
+               } else if (match($0, /^# file:/)) {
                        file = $3
                }
-               if ( length( name ) ) {
-                       optionArray[ name ] = value
-                       optionFile[ name ] = file
+               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
 }
This page took 0.042931 seconds and 4 git commands to generate.