summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorJoshua Lock <joshua.g.lock@intel.com>2016-06-03 09:17:47 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-03 13:13:30 +0100
commit14b758b5703739dfb1373852be5cb11bf594b140 (patch)
tree22303cddd0510ed5fdbafbd300ea7e46695972c8 /meta/lib
parenta8cf2ce41a93889f32681a084c74afcaa6da209f (diff)
downloadpoky-14b758b5703739dfb1373852be5cb11bf594b140.tar.gz
lib/oe/buildhistory_analysis: fix for Python 3
The read method of the data_stream File object now returns bytes, not a str, so we must decode it. (From OE-Core rev: cfae302c4996c49a8754497ea9f13f8331d6975d) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/buildhistory_analysis.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/meta/lib/oe/buildhistory_analysis.py b/meta/lib/oe/buildhistory_analysis.py
index 16491a96e1..4353381080 100644
--- a/meta/lib/oe/buildhistory_analysis.py
+++ b/meta/lib/oe/buildhistory_analysis.py
@@ -190,7 +190,7 @@ class FileChange:
190 190
191 191
192def blob_to_dict(blob): 192def blob_to_dict(blob):
193 alines = [line.decode() for line in blob.data_stream.read().splitlines()] 193 alines = [line for line in blob.data_stream.read().decode('utf-8').splitlines()]
194 adict = {} 194 adict = {}
195 for line in alines: 195 for line in alines:
196 splitv = [i.strip() for i in line.split('=',1)] 196 splitv = [i.strip() for i in line.split('=',1)]
@@ -378,34 +378,34 @@ def process_changes(repopath, revision1, revision2='HEAD', report_all=False, rep
378 if filename == 'latest': 378 if filename == 'latest':
379 changes.extend(compare_dict_blobs(path, d.a_blob, d.b_blob, report_all, report_ver)) 379 changes.extend(compare_dict_blobs(path, d.a_blob, d.b_blob, report_all, report_ver))
380 elif filename.startswith('latest.'): 380 elif filename.startswith('latest.'):
381 chg = ChangeRecord(path, filename, d.a_blob.data_stream.read(), d.b_blob.data_stream.read(), True) 381 chg = ChangeRecord(path, filename, d.a_blob.data_stream.read().decode('utf-8'), d.b_blob.data_stream.read().decode('utf-8'), True)
382 changes.append(chg) 382 changes.append(chg)
383 elif path.startswith('images/'): 383 elif path.startswith('images/'):
384 filename = os.path.basename(d.a_blob.path) 384 filename = os.path.basename(d.a_blob.path)
385 if filename in img_monitor_files: 385 if filename in img_monitor_files:
386 if filename == 'files-in-image.txt': 386 if filename == 'files-in-image.txt':
387 alines = d.a_blob.data_stream.read().splitlines() 387 alines = d.a_blob.data_stream.read().decode('utf-8').splitlines()
388 blines = d.b_blob.data_stream.read().splitlines() 388 blines = d.b_blob.data_stream.read().decode('utf-8').splitlines()
389 filechanges = compare_file_lists(alines,blines) 389 filechanges = compare_file_lists(alines,blines)
390 if filechanges: 390 if filechanges:
391 chg = ChangeRecord(path, filename, None, None, True) 391 chg = ChangeRecord(path, filename, None, None, True)
392 chg.filechanges = filechanges 392 chg.filechanges = filechanges
393 changes.append(chg) 393 changes.append(chg)
394 elif filename == 'installed-package-names.txt': 394 elif filename == 'installed-package-names.txt':
395 alines = d.a_blob.data_stream.read().splitlines() 395 alines = d.a_blob.data_stream.read().decode('utf-8').splitlines()
396 blines = d.b_blob.data_stream.read().splitlines() 396 blines = d.b_blob.data_stream.read().decode('utf-8').splitlines()
397 filechanges = compare_lists(alines,blines) 397 filechanges = compare_lists(alines,blines)
398 if filechanges: 398 if filechanges:
399 chg = ChangeRecord(path, filename, None, None, True) 399 chg = ChangeRecord(path, filename, None, None, True)
400 chg.filechanges = filechanges 400 chg.filechanges = filechanges
401 changes.append(chg) 401 changes.append(chg)
402 else: 402 else:
403 chg = ChangeRecord(path, filename, d.a_blob.data_stream.read(), d.b_blob.data_stream.read(), True) 403 chg = ChangeRecord(path, filename, d.a_blob.data_stream.read().decode('utf-8'), d.b_blob.data_stream.read().decode('utf-8'), True)
404 changes.append(chg) 404 changes.append(chg)
405 elif filename == 'image-info.txt': 405 elif filename == 'image-info.txt':
406 changes.extend(compare_dict_blobs(path, d.a_blob, d.b_blob, report_all, report_ver)) 406 changes.extend(compare_dict_blobs(path, d.a_blob, d.b_blob, report_all, report_ver))
407 elif '/image-files/' in path: 407 elif '/image-files/' in path:
408 chg = ChangeRecord(path, filename, d.a_blob.data_stream.read(), d.b_blob.data_stream.read(), True) 408 chg = ChangeRecord(path, filename, d.a_blob.data_stream.read().decode('utf-8'), d.b_blob.data_stream.read().decode('utf-8'), True)
409 changes.append(chg) 409 changes.append(chg)
410 410
411 # Look for added preinst/postinst/prerm/postrm 411 # Look for added preinst/postinst/prerm/postrm
@@ -419,7 +419,7 @@ def process_changes(repopath, revision1, revision2='HEAD', report_all=False, rep
419 if filename == 'latest': 419 if filename == 'latest':
420 addedpkgs.append(path) 420 addedpkgs.append(path)
421 elif filename.startswith('latest.'): 421 elif filename.startswith('latest.'):
422 chg = ChangeRecord(path, filename[7:], '', d.b_blob.data_stream.read(), True) 422 chg = ChangeRecord(path, filename[7:], '', d.b_blob.data_stream.read().decode('utf-8'), True)
423 addedchanges.append(chg) 423 addedchanges.append(chg)
424 for chg in addedchanges: 424 for chg in addedchanges:
425 found = False 425 found = False
@@ -436,7 +436,7 @@ def process_changes(repopath, revision1, revision2='HEAD', report_all=False, rep
436 if path.startswith('packages/'): 436 if path.startswith('packages/'):
437 filename = os.path.basename(d.a_blob.path) 437 filename = os.path.basename(d.a_blob.path)
438 if filename != 'latest' and filename.startswith('latest.'): 438 if filename != 'latest' and filename.startswith('latest.'):
439 chg = ChangeRecord(path, filename[7:], d.a_blob.data_stream.read(), '', True) 439 chg = ChangeRecord(path, filename[7:], d.a_blob.data_stream.read().decode('utf-8'), '', True)
440 changes.append(chg) 440 changes.append(chg)
441 441
442 # Link related changes 442 # Link related changes