[oe-commits] [openembedded-core] 82/122: recipetool: ignore incidental kernel module source

git at git.openembedded.org git at git.openembedded.org
Mon Dec 4 17:26:00 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch rocko
in repository openembedded-core.

commit 5c89bd0db1b327483f674802740ff21b909e0876
Author: Paul Eggleton <paul.eggleton at linux.intel.com>
AuthorDate: Wed Sep 20 16:43:33 2017 +1200

    recipetool: ignore incidental kernel module source
    
    If the source tree happens to contain a kernel module as an example, a
    test or under a "contrib" directory then we shouldn't be picking it up
    and making the determination that the entire thing is a kernel module.
    
    An example that triggered this is zstd, which ships a kernel module
    under contrib/linux-kernel:
    
      https://github.com/facebook/zstd
    
    Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
    Signed-off-by: Armin Kuster <akuster at mvista.com>
---
 scripts/lib/recipetool/create.py      | 6 ++++--
 scripts/lib/recipetool/create_kmod.py | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 1532735..055bdef 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -156,10 +156,12 @@ class RecipeHandler(object):
                         RecipeHandler.recipebinmap[prog] = pn
 
     @staticmethod
-    def checkfiles(path, speclist, recursive=False):
+    def checkfiles(path, speclist, recursive=False, excludedirs=None):
         results = []
         if recursive:
-            for root, _, files in os.walk(path):
+            for root, dirs, files in os.walk(path, topdown=True):
+                if excludedirs:
+                    dirs[:] = [d for d in dirs if d not in excludedirs]
                 for fn in files:
                     for spec in speclist:
                         if fnmatch.fnmatch(fn, spec):
diff --git a/scripts/lib/recipetool/create_kmod.py b/scripts/lib/recipetool/create_kmod.py
index 7cf188d..4569b53 100644
--- a/scripts/lib/recipetool/create_kmod.py
+++ b/scripts/lib/recipetool/create_kmod.py
@@ -40,7 +40,7 @@ class KernelModuleRecipeHandler(RecipeHandler):
 
         makefiles = []
 
-        files = RecipeHandler.checkfiles(srctree, ['*.c', '*.h'], recursive=True)
+        files = RecipeHandler.checkfiles(srctree, ['*.c', '*.h'], recursive=True, excludedirs=['contrib', 'test', 'examples'])
         if files:
             for cfile in files:
                 # Look in same dir or parent for Makefile

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list