From 58b0a65ada340fda3bc04fa9fcb648eb43246402 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 27 Jun 2025 10:12:06 +0100 Subject: bitbake: utils: Refactor filemode variable conversion to a function We have other places in the code where we need to take filemode/mask information from a bitbake variable and turn it into a real python number. Turn this internal code into public API in bb.utils and add some tests for it. (Bitbake rev: d89e30fb2fb15b09f2cb95c4e5aa9f749ca257ea) Signed-off-by: Richard Purdie --- bitbake/bin/bitbake-worker | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'bitbake/bin') diff --git a/bitbake/bin/bitbake-worker b/bitbake/bin/bitbake-worker index 35fa1ab62b..d2b146a6a9 100755 --- a/bitbake/bin/bitbake-worker +++ b/bitbake/bin/bitbake-worker @@ -182,11 +182,8 @@ def fork_off_task(cfg, data, databuilder, workerdata, extraconfigdata, runtask): elif workerdata["umask"]: umask = workerdata["umask"] if umask: - # umask might come in as a number or text string.. - try: - umask = int(umask, 8) - except TypeError: - pass + # Convert to a python numeric value as it could be a string + umask = bb.utils.to_filemode(umask) dry_run = cfg.dry_run or runtask['dry_run'] -- cgit v1.2.3-54-g00ecf