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:08:59 +0000 |
commit | d366a1a2234421dc988d20ee30f8b7ccc87b21e3 (patch) | |
tree | 8d39920cdff5b3550e877d466f41e54816fa782a | |
parent | 555f9166bf9b538bdefd7c580a1a143537a45cc2 (diff) | |
download | poky-d366a1a2234421dc988d20ee30f8b7ccc87b21e3.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.
(From OE-Core rev: 8280b857c510646cd10167dd2ea9a0c2d5f1e800)
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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): | |||
105 | obj._spdx[name] = [] | 105 | obj._spdx[name] = [] |
106 | return obj._spdx[name] | 106 | return obj._spdx[name] |
107 | 107 | ||
108 | def set_helper(obj, value): | ||
109 | obj._spdx[name] = list(value) | ||
110 | |||
108 | def del_helper(obj): | 111 | def del_helper(obj): |
109 | del obj._spdx[name] | 112 | del obj._spdx[name] |
110 | 113 | ||
111 | attrs[name] = property(get_helper, None, del_helper) | 114 | attrs[name] = property(get_helper, set_helper, del_helper) |
112 | 115 | ||
113 | def init(self, source): | 116 | def init(self, source): |
114 | return [self.prop.init(o) for o in source] | 117 | return [self.prop.init(o) for o in source] |