diff options
author | Amanda Brindle <amanda.r.brindle@intel.com> | 2018-03-05 11:11:52 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-03-15 03:39:42 -0700 |
commit | 58b5f8a221a4f56909234a39fbce886c1e723aa5 (patch) | |
tree | d086ba5e92ecf821c7de40479c22e739b2ea4711 /bitbake/lib/bb/utils.py | |
parent | 04575dfdbc6997666c23336ef170a597517f4266 (diff) | |
download | poky-58b5f8a221a4f56909234a39fbce886c1e723aa5.tar.gz |
bitbake: utils.py: Add option for explode_dep_versions2 to return unsorted
Before, explode_dep_versions2 would sort the OrderedDict before
returning. This function will still sort the OrderedDict by default, but
will now have the option to return the OrderedDict unsorted. This option will
allow us to check if the order of the package list has changed.
(Bitbake rev: 39d6a30a28f66c599e18beddbd847f40dcff623c)
Signed-off-by: Amanda Brindle <amanda.r.brindle@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/utils.py')
-rw-r--r-- | bitbake/lib/bb/utils.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index c540b49cf6..8b739d7849 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
@@ -187,7 +187,7 @@ def explode_deps(s): | |||
187 | #r[-1] += ' ' + ' '.join(j) | 187 | #r[-1] += ' ' + ' '.join(j) |
188 | return r | 188 | return r |
189 | 189 | ||
190 | def explode_dep_versions2(s): | 190 | def explode_dep_versions2(s, *, sort=True): |
191 | """ | 191 | """ |
192 | Take an RDEPENDS style string of format: | 192 | Take an RDEPENDS style string of format: |
193 | "DEPEND1 (optional version) DEPEND2 (optional version) ..." | 193 | "DEPEND1 (optional version) DEPEND2 (optional version) ..." |
@@ -250,7 +250,8 @@ def explode_dep_versions2(s): | |||
250 | if not (i in r and r[i]): | 250 | if not (i in r and r[i]): |
251 | r[lastdep] = [] | 251 | r[lastdep] = [] |
252 | 252 | ||
253 | r = collections.OrderedDict(sorted(r.items(), key=lambda x: x[0])) | 253 | if sort: |
254 | r = collections.OrderedDict(sorted(r.items(), key=lambda x: x[0])) | ||
254 | return r | 255 | return r |
255 | 256 | ||
256 | def explode_dep_versions(s): | 257 | def explode_dep_versions(s): |