kconfig: improve error messages for bad source statements
authorSam Ravnborg <sam@ravnborg.org>
Sat, 27 Dec 2008 20:51:59 +0000 (21:51 +0100)
committerSam Ravnborg <sam@ravnborg.org>
Fri, 2 Jan 2009 19:43:22 +0000 (20:43 +0100)
We now say where we detect the second source of a file,
and where we detect a recursively source of the same file.
This makes it easier to fix such errors.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
scripts/kconfig/lex.zconf.c_shipped
scripts/kconfig/zconf.l

index 7342ce0a77801ff031e81e88f6ff1de3d48e7f4e..dc3e81807d13a41c18df6d20ce8c466e566e9853 100644 (file)
@@ -2370,11 +2370,14 @@ void zconf_nextfile(const char *name)
        current_buf = buf;
 
        if (file->flags & FILE_BUSY) {
-               printf("recursive scan (%s)?\n", name);
+               printf("%s:%d: do not source '%s' from itself\n",
+                      zconf_curname(), zconf_lineno(), name);
                exit(1);
        }
        if (file->flags & FILE_SCANNED) {
-               printf("file %s already scanned?\n", name);
+               printf("%s:%d: file '%s' is already sourced from '%s'\n",
+                      zconf_curname(), zconf_lineno(), name,
+                      file->parent->name);
                exit(1);
        }
        file->flags |= FILE_BUSY;
index 5164ef7ce499db39f1dc40b1ff5be6165083ed2e..21ff69c9ad4e846b3c409216a86434e587b22989 100644 (file)
@@ -314,11 +314,14 @@ void zconf_nextfile(const char *name)
        current_buf = buf;
 
        if (file->flags & FILE_BUSY) {
-               printf("recursive scan (%s)?\n", name);
+               printf("%s:%d: do not source '%s' from itself\n",
+                      zconf_curname(), zconf_lineno(), name);
                exit(1);
        }
        if (file->flags & FILE_SCANNED) {
-               printf("file %s already scanned?\n", name);
+               printf("%s:%d: file '%s' is already sourced from '%s'\n",
+                      zconf_curname(), zconf_lineno(), name,
+                      file->parent->name);
                exit(1);
        }
        file->flags |= FILE_BUSY;