Patchwork package.bbclass: sort dynamically generated packages

login
register
mail settings
Submitter Andreas Oberritter
Date March 9, 2012, 9:34 p.m.
Message ID <1331328880-18256-1-git-send-email-obi@opendreambox.org>
Download mbox | patch
Permalink /patch/22989/
State Accepted
Commit 76f46391239d3e123cfde900c52ca12ac73fd84f
Headers show

Comments

Andreas Oberritter - March 9, 2012, 9:34 p.m.
* do_split_packages and package_do_split_locales dynamically add
  packages in order of appearance of os.walk() or os.listdir().
  This order varies between multiple build hosts (and probably
  also between successive builds).
* Sort the list of dynamically added packages, to get a consistent
  and reproducible order.
* This reduces the diffs in buildhistory and improves
  comparability between builds.

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/classes/package.bbclass |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index e8c4497..2337c0d 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -116,7 +116,7 @@  def do_split_packages(d, root, file_regex, output_pattern, description, postinst
 			mainpkg = mainpkg.replace('-dev', '')
 		extra_depends = mainpkg
 
-	for o in objs:
+	for o in sorted(objs):
 		import re, stat
 		if match_path:
 			m = re.match(file_regex, o)
@@ -415,7 +415,7 @@  python package_do_split_locales() {
 	summary = d.getVar('SUMMARY', True) or pn
 	description = d.getVar('DESCRIPTION', True) or "" 
         locale_section = d.getVar('LOCALE_SECTION', True)
-	for l in locales:
+	for l in sorted(locales):
 		ln = legitimize_package_name(l)
 		pkg = pn + '-locale-' + ln
 		packages.append(pkg)