Skip to contentSkip to conversation

lib/bb/utils.py: return sorted OrderedDict in explode_dep_versions2

PATCH New Robert Yang 1 participant 2 messages Jul 18, 2016

lore
Share & tools
lore
#0 lore raw

cover lib/bb/utils.py: return sorted OrderedDict in explode_dep_versions2

Hi RP,

The binary pkg(rpm, ipk and deb) maybe different when rebuild without this fix.

// Robert

The following changes since commit 627d01997fcf6a0581d88047735769ffb2592b82:

useradd-staticids: use map() instead of imap() (2016-07-12 23:12:00 +0100)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib rbt/sort
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=rbt/sort

Robert Yang (1):
lib/bb/utils.py: return sorted OrderedDict in explode_dep_versions2

 bitbake/lib/bb/utils.py | 1 +
 1 file changed, 1 insertion(+)
Signature · 1 line
2.9.0
#1 lore raw

PATCH 1/1 lib/bb/utils.py: return sorted OrderedDict in explode_dep_versions2

The OrderedDict's item is sorted by insertion order, there might be a problem when build the same recipe again, for example:
- First build of acl:
Depends: libattr1 (>= 2.4.47), libc6 (>= 2.24)
- Second build of acl:
Depends: libc6 (>= 2.24), libattr1 (>= 2.4.47)

They are exactly the same depends, but tools like "diff" doesn't think so. Return sorted OrderedDict will fix the problem.

---
 bitbake/lib/bb/utils.py | 1 +
 1 file changed, 1 insertion(+)
bitbake/lib/bb/utils.py +1 -0
index 0a1bf68..12f2aef 100644
@@ -250,6 +250,7 @@ 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]))
     return r
 
 def explode_dep_versions(s):
Signature · 1 line
2.9.0