diff options
author | Joshua Watt <JPEWhacker@gmail.com> | 2022-02-01 17:31:11 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-02-07 10:07:38 +0000 |
commit | 8280b857c510646cd10167dd2ea9a0c2d5f1e800 (patch) | |
tree | 46da54ca1451a6946e3ce4c4fa97f87a0a591239 /meta/lib/oe | |
parent | 2338a33b690b0bbe279cde3f73764911b239cb50 (diff) | |
download | openembedded-core-contrib-8280b857c510646cd10167dd2ea9a0c2d5f1e800.tar.gz |
spdx: Add set helper for list properties
This adds the set helper for list properties to allow list members to be
replaced with a new list. This is necessary as it is (currently) the
only way to replace the default value for a list member.
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r-- | meta/lib/oe/spdx.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/meta/lib/oe/spdx.py b/meta/lib/oe/spdx.py index 9e7ced5a15..14ca706895 100644 --- a/meta/lib/oe/spdx.py +++ b/meta/lib/oe/spdx.py @@ -105,10 +105,13 @@ class _ListProperty(_Property): obj._spdx[name] = [] return obj._spdx[name] + def set_helper(obj, value): + obj._spdx[name] = list(value) + def del_helper(obj): del obj._spdx[name] - attrs[name] = property(get_helper, None, del_helper) + attrs[name] = property(get_helper, set_helper, del_helper) def init(self, source): return [self.prop.init(o) for o in source] |