Skip to contentSkip to conversation

Buildhistory sorting fixes v2

PATCH Applied Paul Eggleton 3 participants 5 messages Feb 7, 2012 – Feb 8, 2012

lore
Share & tools
lore
#0 lore raw

cover Buildhistory sorting fixes v2

v2 fixes incorrect variable name and removes the erroneous sorting of PACKAGES (for which the original order *is* significant).

The following changes since commit 18d9fcfc4bc4b01f73e89f3b988c9d3d543c7705:

libzypp: add missing runtime dependences on gzip and gnupg (2012-02-03 17:23:28 +0000)

are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib paule/buildhistory-fix3
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/buildhistory-fix3

Paul Eggleton (2):
classes/buildhistory: sort image file list classes/buildhistory: sort list fields in package info

 meta/classes/buildhistory.bbclass |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)
Signature · 1 line
1.7.5.4
#1 lore raw

PATCH 1/2 classes/buildhistory: sort image file list

Sort the contents of files-in-image.txt to avoid unnecessary changes showing up in the history due to reordering.

---
 meta/classes/buildhistory.bbclass |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
meta/classes/buildhistory.bbclass +1 -1
index 69a9d02..3964247 100644
@@ -310,7 +310,7 @@ buildhistory_get_image_installed() {
 buildhistory_get_imageinfo() {
 	# List the files in the image, but exclude date/time etc.
 	# This awk script is somewhat messy, but handles where the size is not printed for device files under pseudo
-	( cd ${IMAGE_ROOTFS} && find . -ls | awk '{ if ( $7 ~ /[0-9]/ ) printf "%s %10-s %10-s %10s %s %s %s\n", $3, $5, $6, $7, $11, $12, $13 ; else printf "%s %10-s %10-s %10s %s %s %s\n", $3, $5, $6, 0, $10, $11, $12 }' > ${BUILDHISTORY_DIR_IMAGE}/files-in-image.txt )
+	( cd ${IMAGE_ROOTFS} && find . -ls | awk '{ if ( $7 ~ /[0-9]/ ) printf "%s %10-s %10-s %10s %s %s %s\n", $3, $5, $6, $7, $11, $12, $13 ; else printf "%s %10-s %10-s %10s %s %s %s\n", $3, $5, $6, 0, $10, $11, $12 }' | sort -k5 > ${BUILDHISTORY_DIR_IMAGE}/files-in-image.txt )
 
 	# Record some machine-readable meta-information about the image
 	echo -n > ${BUILDHISTORY_DIR_IMAGE}/image-info.txt
Signature · 1 line
1.7.5.4
#2 lore raw

PATCH 2/2 classes/buildhistory: sort list fields in package info

In reply to Paul Eggleton

Sort DEPENDS, RDEPENDS, and RRECOMMENDS in package info files so that any changes in order (which are not important) are smoothed out in the change history.

Fixes [YOCTO #1961]

---
 meta/classes/buildhistory.bbclass |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)
meta/classes/buildhistory.bbclass +14 -3
index 3964247..1b6b249 100644
@@ -126,6 +126,17 @@ python buildhistory_emit_pkghistory() {
 	def squashspaces(string):
 		return re.sub("\s+", " ", string)
 
+	def sortpkglist(string):
+		pkgiter = re.finditer(r'[a-zA-Z0-9.-]+( \([><=]+ [^ )]+\))?', string, 0)
+		pkglist = [p.group(0) for p in pkgiter]
+		pkglist.sort()
+		return ' '.join(pkglist)
+
+	def sortlist(string):
+		items = string.split(' ')
+		items.sort()
+		return ' '.join(items)
+
 	pn = d.getVar('PN', True)
 	pe = d.getVar('PE', True) or "0"
 	pv = d.getVar('PV', True)
@@ -136,7 +147,7 @@ python buildhistory_emit_pkghistory() {
 	rcpinfo.pe = pe
 	rcpinfo.pv = pv
 	rcpinfo.pr = pr
-	rcpinfo.depends = squashspaces(d.getVar('DEPENDS', True) or "")
+	rcpinfo.depends = sortlist(squashspaces(d.getVar('DEPENDS', True) or ""))
 	rcpinfo.packages = packages
 	write_recipehistory(rcpinfo, d)
 	write_latestlink(None, pe, pv, pr, d)
@@ -164,8 +175,8 @@ python buildhistory_emit_pkghistory() {
 		pkginfo.pe = pe
 		pkginfo.pv = pv
 		pkginfo.pr = pr
-		pkginfo.rdepends = squashspaces(getpkgvar(pkg, 'RDEPENDS') or "")
-		pkginfo.rrecommends = squashspaces(getpkgvar(pkg, 'RRECOMMENDS') or "")
+		pkginfo.rdepends = sortpkglist(squashspaces(getpkgvar(pkg, 'RDEPENDS') or ""))
+		pkginfo.rrecommends = sortpkglist(squashspaces(getpkgvar(pkg, 'RRECOMMENDS') or ""))
 		pkginfo.files = squashspaces(getpkgvar(pkg, 'FILES') or "")
 
 		# Gather information about packaged files
Signature · 1 line
1.7.5.4
#3 lore raw
In reply to Paul Eggleton

Op 7 feb. 2012, om 19:14 heeft Paul Eggleton het volgende geschreven:

Quoted 7 lines

v2 fixes incorrect variable name and removes the erroneous sorting of PACKAGES (for which the original order *is* significant).

The following changes since commit 18d9fcfc4bc4b01f73e89f3b988c9d3d543c7705:

libzypp: add missing runtime dependences on gzip and gnupg (2012-02-03 17:23:28 +0000)

Quoted 7 lines

are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib paule/buildhistory-fix3
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/buildhistory-fix3

Paul Eggleton (2):
classes/buildhistory: sort image file list classes/buildhistory: sort list fields in package info

Those work beautifully: https://github.com/Angstrom-distribution/buildhistory/commit/6f5de74027b6c28458c5767b8a30b64a271c5b90

regards,

Koen

#4 lore raw
In reply to Paul Eggleton
Quoted 7 lines · Paul Eggleton

v2 fixes incorrect variable name and removes the erroneous sorting of PACKAGES (for which the original order *is* significant).

The following changes since commit 18d9fcfc4bc4b01f73e89f3b988c9d3d543c7705:

libzypp: add missing runtime dependences on gzip and gnupg (2012-02-03 17:23:28 +0000)

Quoted 7 lines

are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib paule/buildhistory-fix3
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/buildhistory-fix3

Paul Eggleton (2):
classes/buildhistory: sort image file list classes/buildhistory: sort list fields in package info

Merged to master, thanks.

Richard