]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
lib/configfragments: Restrict fragment file checking
authorJoshua Watt <jpewhacker@gmail.com>
Fri, 20 Dec 2024 20:41:44 +0000 (13:41 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 8 Jan 2025 12:36:45 +0000 (12:36 +0000)
The current implementation of the config fragments is too aggressive in
checking files; any file in the fragment directory is checked, including
hidden files or files with weird extensions. In particular, if an editor
is creating temporary backup files when editing, these will be checked
and will almost assuredly fail, which prevents the tool from running.

Add a filter so that only non-hidden files that end with .conf are
checked.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/bbconfigbuild/configfragments.py

index 30cc5ece079c755e01753abf56736ad23609f63f..a0c3883399038d11645f2df7b6ef558d8f1c0af2 100644 (file)
@@ -43,6 +43,8 @@ class ConfigFragmentsPlugin(LayerPlugin):
              for topdir, dirs, files in os.walk(os.path.join(layerdir, fragments_path_prefix)):
                  fragmentdir = os.path.relpath(topdir, os.path.join(layerdir, fragments_path_prefix))
                  for fragmentfile in sorted(files):
+                     if fragmentfile.startswith(".") or not fragmentfile.endswith(".conf"):
+                         continue
                      fragmentname = os.path.normpath("/".join((layername, fragmentdir, fragmentfile.split('.')[0])))
                      fragmentpath = os.path.join(topdir, fragmentfile)
                      fragmentsummary, fragmentdesc = self.get_fragment_info(fragmentpath, fragmentname)