summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2018-07-11 16:56:50 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-18 10:18:41 +0100
commit2e8787593f92965544159bdaa3232d4f8b29004f (patch)
treee6a74bbd8424661b0753aa9e9b36d74dd1eff19c
parent0bbb80d3817ee3a21319b0a3b85ef8fb3763b873 (diff)
downloadpoky-2e8787593f92965544159bdaa3232d4f8b29004f.tar.gz
classes/buildhistory: handle packaged files with names containing spaces
The FILELIST field of the package info file in the buildhistory repository is a space-separated list of all of the files in the package. If a name of a file packaged by a recipe contains a space character then of course the result was that we didn't handle its name properly. To fix that, use quotes around any filename containing spaces and at the other end use these quotes to extract the proper entries. Fixes [YOCTO #12742]. (From OE-Core rev: 801b705957dc683030d11393f43407d0b3506b6a) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/buildhistory.bbclass3
-rw-r--r--meta/lib/oe/buildhistory_analysis.py16
2 files changed, 14 insertions, 5 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 63980f72a5..2e5213e66e 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -77,6 +77,7 @@ python buildhistory_emit_pkghistory() {
77 77
78 import re 78 import re
79 import json 79 import json
80 import shlex
80 import errno 81 import errno
81 82
82 pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE') 83 pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE')
@@ -287,7 +288,7 @@ python buildhistory_emit_pkghistory() {
287 dictval = json.loads(val) 288 dictval = json.loads(val)
288 filelist = list(dictval.keys()) 289 filelist = list(dictval.keys())
289 filelist.sort() 290 filelist.sort()
290 pkginfo.filelist = " ".join(filelist) 291 pkginfo.filelist = " ".join([shlex.quote(x) for x in filelist])
291 292
292 pkginfo.size = int(pkgdata['PKGSIZE']) 293 pkginfo.size = int(pkgdata['PKGSIZE'])
293 294
diff --git a/meta/lib/oe/buildhistory_analysis.py b/meta/lib/oe/buildhistory_analysis.py
index ff7815d7c9..ad7fceb8bb 100644
--- a/meta/lib/oe/buildhistory_analysis.py
+++ b/meta/lib/oe/buildhistory_analysis.py
@@ -13,6 +13,7 @@ import os.path
13import difflib 13import difflib
14import git 14import git
15import re 15import re
16import shlex
16import hashlib 17import hashlib
17import collections 18import collections
18import bb.utils 19import bb.utils
@@ -115,10 +116,13 @@ class ChangeRecord:
115 aitems = pkglist_combine(depvera) 116 aitems = pkglist_combine(depvera)
116 bitems = pkglist_combine(depverb) 117 bitems = pkglist_combine(depverb)
117 else: 118 else:
118 aitems = self.oldvalue.split()
119 bitems = self.newvalue.split()
120 if self.fieldname == 'FILELIST': 119 if self.fieldname == 'FILELIST':
120 aitems = shlex.split(self.oldvalue)
121 bitems = shlex.split(self.newvalue)
121 renamed_dirs, aitems, bitems = detect_renamed_dirs(aitems, bitems) 122 renamed_dirs, aitems, bitems = detect_renamed_dirs(aitems, bitems)
123 else:
124 aitems = self.oldvalue.split()
125 bitems = self.newvalue.split()
122 126
123 removed = list(set(aitems) - set(bitems)) 127 removed = list(set(aitems) - set(bitems))
124 added = list(set(bitems) - set(aitems)) 128 added = list(set(bitems) - set(aitems))
@@ -409,9 +413,13 @@ def compare_dict_blobs(path, ablob, bblob, report_all, report_ver):
409 (depvera, depverb) = compare_pkg_lists(astr, bstr) 413 (depvera, depverb) = compare_pkg_lists(astr, bstr)
410 if depvera == depverb: 414 if depvera == depverb:
411 continue 415 continue
412 alist = astr.split() 416 if key == 'FILELIST':
417 alist = shlex.split(astr)
418 blist = shlex.split(bstr)
419 else:
420 alist = astr.split()
421 blist = bstr.split()
413 alist.sort() 422 alist.sort()
414 blist = bstr.split()
415 blist.sort() 423 blist.sort()
416 # We don't care about the removal of self-dependencies 424 # We don't care about the removal of self-dependencies
417 if pkgname in alist and not pkgname in blist: 425 if pkgname in alist and not pkgname in blist: