[oe-commits] [openembedded-core] 32/43: useradd-staticids.bbclass: trigger reparsing when table files change

git at git.openembedded.org git at git.openembedded.org
Mon Aug 1 10:49:56 UTC 2016


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

commit 799c93592a9aac571d6dc05529437c0eec7b08b8
Author: Patrick Ohly <patrick.ohly at intel.com>
AuthorDate: Thu Jul 28 11:43:02 2016 +0200

    useradd-staticids.bbclass: trigger reparsing when table files change
    
    This addresses (among others) the following problem:
    - USERADD_ERROR_DYNAMIC=error causes a recipe to get skipped
      because a static ID entry is missing
    - the entry gets added to the file
    - using the recipe still fails with the same error as before
      because the recipe gets loaded from the cache instead
      of re-parsing it with the new table content
    
    Signed-off-by: Patrick Ohly <patrick.ohly at intel.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/classes/useradd-staticids.bbclass | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/meta/classes/useradd-staticids.bbclass b/meta/classes/useradd-staticids.bbclass
index 149245b..46d4a4b 100644
--- a/meta/classes/useradd-staticids.bbclass
+++ b/meta/classes/useradd-staticids.bbclass
@@ -285,6 +285,19 @@ def update_useradd_static_config(d):
 
         return ";".join(newparams).strip()
 
+    # The parsing of the current recipe depends on the content of
+    # the files listed in USERADD_UID/GID_TABLES. We need to tell bitbake
+    # about that explicitly to trigger re-parsing and thus re-execution of
+    # this code when the files change.
+    bbpath = d.getVar('BBPATH', True)
+    for varname, default in (('USERADD_UID_TABLES', 'files/passwd'),
+                             ('USERADD_GID_TABLES', 'files/group')):
+        tables = d.getVar(varname, True)
+        if not tables:
+            tables = default
+        for conf_file in tables.split():
+            bb.parse.mark_dependency(d, bb.utils.which(bbpath, conf_file))
+
     # Load and process the users and groups, rewriting the adduser/addgroup params
     useradd_packages = d.getVar('USERADD_PACKAGES', True)
 

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


More information about the Openembedded-commits mailing list