From 1fc840ffc0267ecf3a15c4a59ab44869ef1d6339 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 9 May 2013 16:31:22 +0000 Subject: meta: python3 megapatch This needs splutting into smaller units, WIP atm. (From OE-Core rev: 21529228a7dca96a6a1b44ed9380c523efdeeb3e) Signed-off-by: Richard Purdie --- meta/lib/oe/rootfs.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'meta/lib/oe/rootfs.py') diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py index 95fd3ab7f1..528f50c0df 100644 --- a/meta/lib/oe/rootfs.py +++ b/meta/lib/oe/rootfs.py @@ -10,11 +10,10 @@ import subprocess import re -class Rootfs(object): +class Rootfs(object, metaclass=ABCMeta): """ This is an abstract class. Do not instantiate this directly. """ - __metaclass__ = ABCMeta def __init__(self, d): self.d = d @@ -51,8 +50,8 @@ class Rootfs(object): m = r.search(line) if m: bb.warn('[log_check] %s: found a warning message in the logfile (keyword \'%s\'):\n[log_check] %s' - % (self.d.getVar('PN', True), m.group(), line)) - + % (self.d.getVar('PN', True), m.group(), line)) + def _log_check_error(self): r = re.compile(self.log_check_regex) log_path = self.d.expand("${T}/log.do_rootfs") @@ -77,7 +76,7 @@ class Rootfs(object): found_error = 1 bb.warn('[log_check] In line: [%s]' % line) bb.warn('[log_check] %s: found an error message in the logfile (keyword \'%s\'):\n[log_check] %s' - % (self.d.getVar('PN', True), m.group(), line)) + % (self.d.getVar('PN', True), m.group(), line)) if found_error >= 1 and found_error <= 5: message += line + '\n' @@ -485,7 +484,7 @@ class RpmRootfs(Rootfs): continue # sh -x may emit code which isn't actually executed if line.startswith('+'): - continue + continue m = r.search(line) if m: @@ -565,7 +564,7 @@ class DpkgOpkgRootfs(Rootfs): pkg_depends = m_depends.group(1) # remove package dependencies not in postinsts - pkg_names = pkgs.keys() + pkg_names = list(pkgs.keys()) for pkg_name in pkg_names: deps = pkgs[pkg_name][:] @@ -598,7 +597,7 @@ class DpkgOpkgRootfs(Rootfs): pkgs = self._get_pkgs_postinsts(status_file) if pkgs: root = "__packagegroup_postinst__" - pkgs[root] = pkgs.keys() + pkgs[root] = list(pkgs.keys()) _dep_resolve(pkgs, root, pkg_list, []) pkg_list.remove(root) -- cgit v1.2.3-54-g00ecf