From patchwork Sun Aug 10 22:23:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 68307 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3971CA0EC0 for ; Sun, 10 Aug 2025 22:24:01 +0000 (UTC) Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by mx.groups.io with SMTP id smtpd.web10.35538.1754864639623588885 for ; Sun, 10 Aug 2025 15:24:00 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=LST1BUtK; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.52, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-458bc3ce3beso22253265e9.1 for ; Sun, 10 Aug 2025 15:23:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1754864637; x=1755469437; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=+ge3xop/MrVua8gW4fIDPXW77s7+sMAuucXyprWMd1A=; b=LST1BUtKbDiyHcqkHG1/ETaNOqmq6kCj6rcPBgEoHxnza/1xYm8erClKXxLlmS3WRF oveoB+Kzhux4ryHdF84eCPQvU6F34vW8TBn3T/UX3IX1oVgw5rl6db9coeK5ALd//UKi YCxZrJzmgy1TYSeIxQ8ZszQuEwS99rufNuV7M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754864637; x=1755469437; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from: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oQLAQWCXkwVcYNOWd+sJkqS4Nslp2ZtU5A== X-Received: by 2002:a05:600c:450e:b0:456:161c:3d77 with SMTP id 5b1f17b1804b1-459f4f12658mr93108865e9.16.1754864637323; Sun, 10 Aug 2025 15:23:57 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:2db4:de3e:1e1f:36bf]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-459e0cd2c90sm274039325e9.17.2025.08.10.15.23.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Aug 2025 15:23:56 -0700 (PDT) From: Richard Purdie To: bitbake-devel@lists.openembedded.org Cc: Joshua Watt Subject: [PATCH 1/3] lib/bb: Add filter support Date: Sun, 10 Aug 2025 23:23:52 +0100 Message-ID: <20250810222355.2486772-1-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 10 Aug 2025 22:24:01 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/17850 From: Joshua Watt Add the python API for applying filters to a string and being able to register functions as filters. Filter functions are pure functions where an input is translated into an output and there are no external data accesses. This means translations can be cached as they won't change. Signed-off-by: Joshua Watt Signed-off-by: Richard Purdie --- bin/bitbake-selftest | 1 + lib/bb/filter.py | 142 +++++++++++++++++++++++++++++++++++++++++ lib/bb/tests/filter.py | 88 +++++++++++++++++++++++++ 3 files changed, 231 insertions(+) create mode 100644 lib/bb/filter.py create mode 100644 lib/bb/tests/filter.py diff --git a/bin/bitbake-selftest b/bin/bitbake-selftest index 8c1e6d3e7e7..fb7c57dd837 100755 --- a/bin/bitbake-selftest +++ b/bin/bitbake-selftest @@ -33,6 +33,7 @@ tests = ["bb.tests.codeparser", "bb.tests.siggen", "bb.tests.utils", "bb.tests.compression", + "bb.tests.filter", "hashserv.tests", "prserv.tests", "layerindexlib.tests.layerindexobj", diff --git a/lib/bb/filter.py b/lib/bb/filter.py new file mode 100644 index 00000000000..0b5b5d92cac --- /dev/null +++ b/lib/bb/filter.py @@ -0,0 +1,142 @@ +# +# Copyright (C) 2025 Garmin Ltd. or its subsidiaries +# +# SPDX-License-Identifier: GPL-2.0-only +# + +import builtins + +# Purposely blank out __builtins__ which prevents users from +# calling any normal builtin python functions +FILTERS = { + "__builtins__": {}, +} + +CACHE = {} + + +def apply_filters(val, expressions): + g = FILTERS.copy() + + for e in expressions: + e = e.strip() + if not e: + continue + + k = (val, e) + if k not in CACHE: + # Set val as a local so it can be cleared out while keeping the + # globals + l = {"val": val} + + CACHE[k] = eval(e, g, l) + + val = CACHE[k] + + return val + + +class Namespace(object): + """ + Helper class to simulate a python namespace. The object properties can be + set as if it were a dictionary. Properties cannot be changed or deleted + through the object interface + """ + + def __getitem__(self, name): + return self.__dict__[name] + + def __setitem__(self, name, value): + self.__dict__[name] = value + + def __contains__(self, name): + return name in self.__dict__ + + def __setattr__(self, name, value): + raise AttributeError(f"Attribute {name!r} cannot be changed") + + def __delattr__(self, name): + raise AttributeError(f"Attribute {name!r} cannot be deleted") + + +def filter_proc(*, name=None): + """ + Decorator to mark a function that can be called in `apply_filters`, either + directly in a filter expression, or indirectly. The `name` argument can be + used to specify an alternate name for the function if the actual name is + not desired. The `name` can be a fully qualified namespace if desired. + + All functions must be "pure" in that they do not depend on global state and + have no global side effects (e.g. the output only depends on the input + arguments); the results of filter expressions are cached to optimize + repeated calls. + """ + + def inner(func): + global FILTERS + nonlocal name + + if name is None: + name = func.__name__ + + ns = name.split(".") + o = FILTERS + for n in ns[:-1]: + if not n in o: + o[n] = Namespace() + o = o[n] + + o[ns[-1]] = func + + return func + + return inner + + +# A select set of builtins that are supported in filter expressions +filter_proc()(all) +filter_proc()(all) +filter_proc()(any) +filter_proc()(bin) +filter_proc()(bool) +filter_proc()(chr) +filter_proc()(enumerate) +filter_proc()(float) +filter_proc()(format) +filter_proc()(hex) +filter_proc()(int) +filter_proc()(len) +filter_proc()(map) +filter_proc()(max) +filter_proc()(min) +filter_proc()(oct) +filter_proc()(ord) +filter_proc()(pow) +filter_proc()(str) +filter_proc()(sum) + + +@filter_proc() +def suffix(val, suffix): + return " ".join(v + suffix for v in val.split()) + + +@filter_proc() +def prefix(val, prefix): + return " ".join(prefix + v for v in val.split()) + + +@filter_proc() +def sort(val): + return " ".join(sorted(val.split())) + + +@filter_proc() +def remove(val, remove, sep=None): + if isinstance(remove, str): + remove = remove.split(sep) + new = [i for i in val.split(sep) if not i in remove] + + if not sep: + return " ".join(new) + return sep.join(new) diff --git a/lib/bb/tests/filter.py b/lib/bb/tests/filter.py new file mode 100644 index 00000000000..245df7b22bc --- /dev/null +++ b/lib/bb/tests/filter.py @@ -0,0 +1,88 @@ +# +# Copyright (C) 2025 Garmin Ltd. or its subsidiaries +# +# SPDX-License-Identifier: GPL-2.0-only +# + +import unittest +import bb.filter + + +class BuiltinFilterTest(unittest.TestCase): + def test_disallowed_builtins(self): + with self.assertRaises(NameError): + val = bb.filter.apply_filters("1", ["open('foo.txt', 'rb')"]) + + def test_prefix(self): + val = bb.filter.apply_filters("1 2 3", ["prefix(val, 'a')"]) + self.assertEqual(val, "a1 a2 a3") + + val = bb.filter.apply_filters("", ["prefix(val, 'a')"]) + self.assertEqual(val, "") + + def test_suffix(self): + val = bb.filter.apply_filters("1 2 3", ["suffix(val, 'b')"]) + self.assertEqual(val, "1b 2b 3b") + + val = bb.filter.apply_filters("", ["suffix(val, 'b')"]) + self.assertEqual(val, "") + + def test_sort(self): + val = bb.filter.apply_filters("z y x", ["sort(val)"]) + self.assertEqual(val, "x y z") + + val = bb.filter.apply_filters("", ["sort(val)"]) + self.assertEqual(val, "") + + def test_identity(self): + val = bb.filter.apply_filters("1 2 3", ["val"]) + self.assertEqual(val, "1 2 3") + + val = bb.filter.apply_filters("123", ["val"]) + self.assertEqual(val, "123") + + def test_empty(self): + val = bb.filter.apply_filters("1 2 3", ["", "prefix(val, 'a')", ""]) + self.assertEqual(val, "a1 a2 a3") + + def test_nested(self): + val = bb.filter.apply_filters("1 2 3", ["prefix(prefix(val, 'a'), 'b')"]) + self.assertEqual(val, "ba1 ba2 ba3") + + val = bb.filter.apply_filters("1 2 3", ["prefix(prefix(val, 'b'), 'a')"]) + self.assertEqual(val, "ab1 ab2 ab3") + + def test_filter_order(self): + val = bb.filter.apply_filters("1 2 3", ["prefix(val, 'a')", "prefix(val, 'b')"]) + self.assertEqual(val, "ba1 ba2 ba3") + + val = bb.filter.apply_filters("1 2 3", ["prefix(val, 'b')", "prefix(val, 'a')"]) + self.assertEqual(val, "ab1 ab2 ab3") + + val = bb.filter.apply_filters("1 2 3", ["prefix(val, 'a')", "suffix(val, 'b')"]) + self.assertEqual(val, "a1b a2b a3b") + + val = bb.filter.apply_filters("1 2 3", ["suffix(val, 'b')", "prefix(val, 'a')"]) + self.assertEqual(val, "a1b a2b a3b") + + def test_remove(self): + val = bb.filter.apply_filters("1 2 3", ["remove(val, ['2'])"]) + self.assertEqual(val, "1 3") + + val = bb.filter.apply_filters("1,2,3", ["remove(val, ['2'], ',')"]) + self.assertEqual(val, "1,3") + + val = bb.filter.apply_filters("1 2 3", ["remove(val, ['4'])"]) + self.assertEqual(val, "1 2 3") + + val = bb.filter.apply_filters("1 2 3", ["remove(val, ['1', '2'])"]) + self.assertEqual(val, "3") + + val = bb.filter.apply_filters("1 2 3", ["remove(val, '2')"]) + self.assertEqual(val, "1 3") + + val = bb.filter.apply_filters("1 2 3", ["remove(val, '4')"]) + self.assertEqual(val, "1 2 3") + + val = bb.filter.apply_filters("1 2 3", ["remove(val, '1 2')"]) + self.assertEqual(val, "3") From patchwork Sun Aug 10 22:23:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 68306 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2974C87FCF for ; Sun, 10 Aug 2025 22:24:01 +0000 (UTC) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by mx.groups.io with SMTP id smtpd.web11.35347.1754864640786928402 for ; Sun, 10 Aug 2025 15:24:01 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=h/ERACUI; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.51, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-3b783d851e6so3293767f8f.0 for ; Sun, 10 Aug 2025 15:24:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1754864638; x=1755469438; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=t/4sFs4InRIAyoXviRoYGlJw5vq69gwsdIb6aPOmTFY=; b=h/ERACUIyQcBE3bhjhVu5p/K6VeslfLb/GRLcSE+Qm62/PtoCrqKYtFAozTu78D68n YRYjv2agmmEWDsH6F7fSbboXS37iOLxm7BRJkROnWMk6BKeAAD1i3xm4yhtfMi+1dIQg d5A04ySN9gnmpco/7X5Ytk+caDIQ7Gb1MFYaQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754864638; x=1755469438; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=t/4sFs4InRIAyoXviRoYGlJw5vq69gwsdIb6aPOmTFY=; b=nHGl5lvlCr6m/bsWMTCvAb8g9VquT1GGAo+bqJsY+9AN4AfCrVix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ug 2025 15:23:58 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:2db4:de3e:1e1f:36bf]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-459e0cd2c90sm274039325e9.17.2025.08.10.15.23.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Aug 2025 15:23:57 -0700 (PDT) From: Richard Purdie To: bitbake-devel@lists.openembedded.org Cc: Joshua Watt Subject: [PATCH 2/3] data_smart: Add setVarFilter function to implement variabl filtering Date: Sun, 10 Aug 2025 23:23:53 +0100 Message-ID: <20250810222355.2486772-2-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250810222355.2486772-1-richard.purdie@linuxfoundation.org> References: <20250810222355.2486772-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 10 Aug 2025 22:24:01 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/17851 Adds a new setVarFilter() API to the data store allowing filters to be applied to variables. Note that filters are applied to the non-override part of the variable name so a filter set against RDEPENDS would apply against RDEPENDS:${PN} and friends. The filter function is applied before returning the final variable value. Signed-off-by: Joshua Watt Signed-off-by: Richard Purdie --- lib/bb/data_smart.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py index 8e7dd983841..2e0d3085882 100644 --- a/lib/bb/data_smart.py +++ b/lib/bb/data_smart.py @@ -24,6 +24,7 @@ from collections.abc import MutableMapping import logging import hashlib import bb, bb.codeparser +import bb.filter from bb import utils from bb.COW import COWDictBase @@ -427,6 +428,7 @@ class DataSmart(MutableMapping): self.inchistory = IncludeHistory() self.varhistory = VariableHistory(self) + self.filters = {} self._tracking = False self._var_renames = {} self._var_renames.update(bitbake_renamed_vars) @@ -678,6 +680,7 @@ class DataSmart(MutableMapping): srcflags = self.getVarFlags(key, False, True) or {} for i in srcflags: + if i not in (__setvar_keyword__): continue src = srcflags[i] @@ -895,6 +898,12 @@ class DataSmart(MutableMapping): if expand: value = parser.value + if value and expand and flag == "_content": + basevar = var.split(":")[0] + if basevar in self.filters: + value = bb.filter.apply_filters(value, [self.filters[basevar],]) + parser.value = value + if parser: self.expand_cache[cachename] = parser @@ -1000,6 +1009,7 @@ class DataSmart(MutableMapping): data.varhistory = self.varhistory.copy() data.varhistory.dataroot = data data.inchistory = self.inchistory.copy() + data.filters = self.filters.copy() data._tracking = self._tracking data._var_renames = self._var_renames @@ -1028,6 +1038,15 @@ class DataSmart(MutableMapping): if referrervalue and isinstance(referrervalue, str) and ref in referrervalue: self.setVar(key, referrervalue.replace(ref, value)) + def setVarFilter(self, var, filter): + if filter: + self.filters[var] = filter + else: + try: + del self.filters[var] + except KeyError: + pass + def localkeys(self): for key in self.dict: if key not in ['_data']: From patchwork Sun Aug 10 22:23:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 68308 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D951C87FCF for ; Sun, 10 Aug 2025 22:24:11 +0000 (UTC) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by mx.groups.io with SMTP id smtpd.web11.35348.1754864642047359813 for ; Sun, 10 Aug 2025 15:24:02 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=Do2qfLDU; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.51, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-458bf6d69e4so34793435e9.2 for ; Sun, 10 Aug 2025 15:24:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1754864640; x=1755469440; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rCSxXBAKiZQO8EZ+yRWYbGvC2AKfZ8vuyRVAn3XwNfA=; b=Do2qfLDUW+jURX/ocKUgQNg1Ql37KIK2tYaJ7QTOyo+Ky9MKT6yRr7KNqb1B5G7h0I rl6/CmgZizc7oWGdEMGQV3rOhtSwhzrNxfs01vfmzxY96siTgnIU0oYxoT8FYLTNG3VL 2L/xmX8CUiKeHDMaO7Fz2/XpKpxsejYdg7oKY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754864640; x=1755469440; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rCSxXBAKiZQO8EZ+yRWYbGvC2AKfZ8vuyRVAn3XwNfA=; b=AE+Db36dFETPtibtsnANfTd1zVlumepwkN5QKjnaxiEQUPga96omG4goi5tlYcmnLi urNVtv4onhPHRstOk+2Euk9rPuoA/mVGxqDoWAOdkBXuyIIS4z8/JlhEt8qzWnaNGMw0 wM/9u4mJ1QlpS0aDBdoQzeNSZOv203DC9OOqrG0alZM60mmO7YQXsdRGX0jcsKjUtbE+ lyyNf2pUYifbSTPrtTH6b9Iva7c0h4hlv2euf2mUTVpZaltEv1tkw7O/tXOzbF70kBYj QBlpbfdGLM1p6wGb6xd3XZrH37CLKPw2Kx8v4fg99vLAwpkVgwNykdMueXOqr44diaye Nesg== X-Gm-Message-State: AOJu0YwCkortiaitWvxBGdeJIOi0uX37R2rV13kOtlRCMNOe6H5h2dcm eWlkiLe215pBL6AM3FJTssK9s9HJE+lRjMfPzvw1T1APQadCaxa+ssRBBxI/wTgVkFFaNTYlSwb B2ydG X-Gm-Gg: ASbGnct9mMxqDyb+88ZUVTMU1cSVrN2JEnSg1lEjRL/5ckm6oBhZT9/T144ZrmRnac4 wDolr+JnBDenugd+VOz3Sd8JLc/Dmihk4IE8Uo5AIkoj/gvrPWGvzDAASjKg3HJXhWs5ZvusZ12 dIssenS3xKyo8W+YvFXAwtmTUhkzxS9rg2wLKM0W5zeXTf7p1ebSmyNYAO9KnnWYXwjuG+TT5Bg AhpsP2EC17wLzSc4NimHBgS/YpVFtQ7ysxVBb5CT/bJQQdkHDx1eAAt17unkMOU3ZTUYWRGDFoi paYzbT+FJr9YYNOBvK/qAzgg2zppNpXT1d9foias7TAndRQ+g9c4gw3X/B+FF6woh91flmJE9nO k4ghns/g7JRnIJTIblVAtig6QwGplLv/iiKkNACqGcnyZ7x/V7iBFSm2FvpZPFw== X-Google-Smtp-Source: AGHT+IFjiD794YHQAvAiS57IOStv3QRu9aiuoY76rt1T46LXSa2bZCHeJKjoq8/i6lUiMMubHdyNXw== X-Received: by 2002:a05:600c:609b:b0:456:19be:5cc with SMTP id 5b1f17b1804b1-459f5935436mr109140845e9.14.1754864639828; Sun, 10 Aug 2025 15:23:59 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:2db4:de3e:1e1f:36bf]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-459e0cd2c90sm274039325e9.17.2025.08.10.15.23.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Aug 2025 15:23:58 -0700 (PDT) From: Richard Purdie To: bitbake-devel@lists.openembedded.org Cc: Joshua Watt Subject: [PATCH 3/3] Add bb.utils.explode_deps as a filter function Date: Sun, 10 Aug 2025 23:23:54 +0100 Message-ID: <20250810222355.2486772-3-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250810222355.2486772-1-richard.purdie@linuxfoundation.org> References: <20250810222355.2486772-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 10 Aug 2025 22:24:11 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/17852 From: Joshua Watt Marks bb.utils.explode_deps as callable from filter functions Signed-off-by: Joshua Watt Signed-off-by: Richard Purdie --- lib/bb/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/bb/utils.py b/lib/bb/utils.py index 0cf3b1814c4..366836bfc9a 100644 --- a/lib/bb/utils.py +++ b/lib/bb/utils.py @@ -34,6 +34,7 @@ from contextlib import contextmanager from ctypes import cdll import bb import bb.msg +import bb.filter logger = logging.getLogger("BitBake.Util") python_extensions = importlib.machinery.all_suffixes() @@ -184,6 +185,7 @@ def vercmp_string_op(a, b, op): else: raise VersionStringException('Unsupported comparison operator "%s"' % op) +@bb.filter.filter_proc(name="bb.utils.explode_deps") def explode_deps(s): """ Takes an RDEPENDS style string of format::