summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2012-02-07 15:01:43 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-02-08 10:57:09 +0000
commit1a35ed4f5d6ae398fc2ca5481871a09b085ed457 (patch)
tree2e273278d2a69f2f0653ec9d941d4e75a47025d2 /meta
parent8653bf474e6f5a6b7fa1670d1e2e7f925c924f29 (diff)
downloadpoky-1a35ed4f5d6ae398fc2ca5481871a09b085ed457.tar.gz
classes/buildhistory: sort list fields in package info
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] (From OE-Core rev: 06b740d4ca077fb4c89ee6d1065fabb02da45ec6) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/buildhistory.bbclass17
1 files changed, 14 insertions, 3 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 3964247445..1b6b2493e4 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -126,6 +126,17 @@ python buildhistory_emit_pkghistory() {
126 def squashspaces(string): 126 def squashspaces(string):
127 return re.sub("\s+", " ", string) 127 return re.sub("\s+", " ", string)
128 128
129 def sortpkglist(string):
130 pkgiter = re.finditer(r'[a-zA-Z0-9.-]+( \([><=]+ [^ )]+\))?', string, 0)
131 pkglist = [p.group(0) for p in pkgiter]
132 pkglist.sort()
133 return ' '.join(pkglist)
134
135 def sortlist(string):
136 items = string.split(' ')
137 items.sort()
138 return ' '.join(items)
139
129 pn = d.getVar('PN', True) 140 pn = d.getVar('PN', True)
130 pe = d.getVar('PE', True) or "0" 141 pe = d.getVar('PE', True) or "0"
131 pv = d.getVar('PV', True) 142 pv = d.getVar('PV', True)
@@ -136,7 +147,7 @@ python buildhistory_emit_pkghistory() {
136 rcpinfo.pe = pe 147 rcpinfo.pe = pe
137 rcpinfo.pv = pv 148 rcpinfo.pv = pv
138 rcpinfo.pr = pr 149 rcpinfo.pr = pr
139 rcpinfo.depends = squashspaces(d.getVar('DEPENDS', True) or "") 150 rcpinfo.depends = sortlist(squashspaces(d.getVar('DEPENDS', True) or ""))
140 rcpinfo.packages = packages 151 rcpinfo.packages = packages
141 write_recipehistory(rcpinfo, d) 152 write_recipehistory(rcpinfo, d)
142 write_latestlink(None, pe, pv, pr, d) 153 write_latestlink(None, pe, pv, pr, d)
@@ -164,8 +175,8 @@ python buildhistory_emit_pkghistory() {
164 pkginfo.pe = pe 175 pkginfo.pe = pe
165 pkginfo.pv = pv 176 pkginfo.pv = pv
166 pkginfo.pr = pr 177 pkginfo.pr = pr
167 pkginfo.rdepends = squashspaces(getpkgvar(pkg, 'RDEPENDS') or "") 178 pkginfo.rdepends = sortpkglist(squashspaces(getpkgvar(pkg, 'RDEPENDS') or ""))
168 pkginfo.rrecommends = squashspaces(getpkgvar(pkg, 'RRECOMMENDS') or "") 179 pkginfo.rrecommends = sortpkglist(squashspaces(getpkgvar(pkg, 'RRECOMMENDS') or ""))
169 pkginfo.files = squashspaces(getpkgvar(pkg, 'FILES') or "") 180 pkginfo.files = squashspaces(getpkgvar(pkg, 'FILES') or "")
170 181
171 # Gather information about packaged files 182 # Gather information about packaged files