]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
gentpl.py: Fix issue where sometimes marker files have CPP defines
authorGlenn Washburn <development@efficientek.com>
Thu, 13 Jan 2022 03:40:20 +0000 (21:40 -0600)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 8 Feb 2022 15:06:49 +0000 (16:06 +0100)
When generating video.lst, modules whose marker file contains the string
VIDEO_LIST_MARKER are selected. But when the marker file contains the CPP
defines, one of the defines is VIDEO_LIST_MARKER and is present in all
marker files, so they are all selected. By removing the defines, the correct
modules are selected.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
gentpl.py

index c86550d4f9e502fb7a0ce62f5a2ece6ee054c417..05ab13fa0f0ce11687ff0b021f1cf7b39c0ccae1 100644 (file)
--- a/gentpl.py
+++ b/gentpl.py
@@ -700,7 +700,7 @@ def module(defn, platform):
     output("""
 """ + name + """.marker: $(""" + cname(defn) + """_SOURCES) $(nodist_""" + cname(defn) + """_SOURCES)
        $(TARGET_CPP) -DGRUB_LST_GENERATOR $(CPPFLAGS_MARKER) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(""" + cname(defn) + """_CPPFLAGS) $(CPPFLAGS) $^ > $@.new || (rm -f $@; exit 1)
-       grep 'MARKER' $@.new > $@; rm -f $@.new
+       grep 'MARKER' $@.new | grep -v '^#' > $@; rm -f $@.new
 """)
 
 def kernel(defn, platform):