All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 2/2] classes/buildhistory: sort list fields in package info
Date: Tue,  7 Feb 2012 18:14:35 +0000	[thread overview]
Message-ID: <81226ba91817ef351eb62a6e3359deb8c2631a02.1328638222.git.paul.eggleton@linux.intel.com> (raw)
In-Reply-To: <cover.1328638222.git.paul.eggleton@linux.intel.com>
In-Reply-To: <cover.1328638222.git.paul.eggleton@linux.intel.com>

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]

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/classes/buildhistory.bbclass |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 3964247..1b6b249 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -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
-- 
1.7.5.4




  parent reply	other threads:[~2012-02-07 19:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-07 18:14 [PATCH 0/2] Buildhistory sorting fixes v2 Paul Eggleton
2012-02-07 18:14 ` [PATCH 1/2] classes/buildhistory: sort image file list Paul Eggleton
2012-02-07 18:14 ` Paul Eggleton [this message]
2012-02-08  8:41 ` [PATCH 0/2] Buildhistory sorting fixes v2 Koen Kooi
2012-02-08 10:56 ` Richard Purdie
  -- strict thread matches above, loose matches on Subject: below --
2012-02-07 16:24 [PATCH 0/2] Buildhistory sorting fixes Paul Eggleton
2012-02-07 16:25 ` [PATCH 2/2] classes/buildhistory: sort list fields in package info Paul Eggleton
2012-02-07 17:50   ` Koen Kooi
2012-02-07 17:52     ` Otavio Salvador
2012-02-07 17:52     ` Koen Kooi
2012-02-07 17:59       ` Paul Eggleton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=81226ba91817ef351eb62a6e3359deb8c2631a02.1328638222.git.paul.eggleton@linux.intel.com \
    --to=paul.eggleton@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.