All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V3 0/1] utils.py: Add option for explode_dep_versions2 to return unsorted
@ 2018-03-05 19:11 Amanda Brindle
  2018-03-05 19:11 ` [PATCH V3 1/1] " Amanda Brindle
  0 siblings, 1 reply; 2+ messages in thread
From: Amanda Brindle @ 2018-03-05 19:11 UTC (permalink / raw)
  To: bitbake-devel; +Cc: stephano.cetola

Changes since V2:

Changed variable name in explode_dep_versions2 from unsorted to sort in order to avoid double negative logic.

Also made the variable a keyword-only argument for readability.

The following changes since commit 44ea6ded0e8e73f5258ce55bd1b851e24243b76a:

  bitbake: bitbake-user-manual: Commented out Placeholder Paragraph (2018-02-06 18:10:35 +0000)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib abrindle/buildhistory-diff4
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=abrindle/buildhistory-diff4

Amanda Brindle (1):
  utils.py: Add option for explode_dep_versions2 to return unsorted

 lib/bb/utils.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

-- 
2.7.4



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH V3 1/1] utils.py: Add option for explode_dep_versions2 to return unsorted
  2018-03-05 19:11 [PATCH V3 0/1] utils.py: Add option for explode_dep_versions2 to return unsorted Amanda Brindle
@ 2018-03-05 19:11 ` Amanda Brindle
  0 siblings, 0 replies; 2+ messages in thread
From: Amanda Brindle @ 2018-03-05 19:11 UTC (permalink / raw)
  To: bitbake-devel; +Cc: stephano.cetola

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.

Signed-off-by: Amanda Brindle <amanda.r.brindle@intel.com>
---
 lib/bb/utils.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/bb/utils.py b/lib/bb/utils.py
index c540b49..0275f05 100644
--- a/lib/bb/utils.py
+++ b/lib/bb/utils.py
@@ -187,7 +187,7 @@ def explode_deps(s):
             #r[-1] += ' ' + ' '.join(j)
     return r
 
-def explode_dep_versions2(s):
+def explode_dep_versions2(s, *, sort = True):
     """
     Take an RDEPENDS style string of format:
     "DEPEND1 (optional version) DEPEND2 (optional version) ..."
@@ -250,7 +250,8 @@ def explode_dep_versions2(s):
         if not (i in r and r[i]):
             r[lastdep] = []
 
-    r = collections.OrderedDict(sorted(r.items(), key=lambda x: x[0]))
+    if sort:
+        r = collections.OrderedDict(sorted(r.items(), key=lambda x: x[0]))
     return r
 
 def explode_dep_versions(s):
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-05 19:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-05 19:11 [PATCH V3 0/1] utils.py: Add option for explode_dep_versions2 to return unsorted Amanda Brindle
2018-03-05 19:11 ` [PATCH V3 1/1] " Amanda Brindle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.