From: Ross Burton <ross.burton@intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 2/2] package-manager: pylint fixes
Date: Fri, 14 Dec 2018 01:08:48 +0000 [thread overview]
Message-ID: <20181214010848.24170-2-ross.burton@intel.com> (raw)
In-Reply-To: <20181214010848.24170-1-ross.burton@intel.com>
mark_packages() is implicitly abstract in OpkgDpkgPM so implement it for
clarity.
Also trivial whitespace, semicolons, unused variables, and regex strings.
Signed-off-by: Ross Burton <ross.burton@intel.com>
---
meta/lib/oe/package_manager.py | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index f0d98dd0ffc..564b74ae7b5 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -29,7 +29,7 @@ def opkg_query(cmd_output):
a dictionary with the information of the packages. This is used
when the packages are in deb or ipk format.
"""
- verregex = re.compile(' \([=<>]* [^ )]*\)')
+ verregex = re.compile(r" \([=<>]* [^ )]*\)")
output = dict()
pkg = ""
arch = ""
@@ -237,9 +237,9 @@ class DpkgIndexer(Indexer):
bb.utils.mkdirhier(os.path.join(self.apt_conf_dir, "apt.conf.d"))
bb.utils.mkdirhier(os.path.join(self.apt_conf_dir, "preferences.d"))
- with open(os.path.join(self.apt_conf_dir, "preferences"), "w") as prefs_file:
+ with open(os.path.join(self.apt_conf_dir, "preferences"), "w"):
pass
- with open(os.path.join(self.apt_conf_dir, "sources.list"), "w+") as sources_file:
+ with open(os.path.join(self.apt_conf_dir, "sources.list"), "w+"):
pass
with open(self.apt_conf_file, "w") as apt_conf:
@@ -1118,6 +1118,10 @@ class OpkgDpkgPM(PackageManager):
return tmp_dir
+ @abstractmethod
+ def mark_packages(self, status_tag, packages=None):
+ pass
+
def _handle_intercept_failure(self, registered_pkgs):
self.mark_packages("unpacked", registered_pkgs.split())
@@ -1633,13 +1637,13 @@ class DpkgPM(OpkgDpkgPM):
# rename *.dpkg-new files/dirs
for root, dirs, files in os.walk(self.target_rootfs):
for dir in dirs:
- new_dir = re.sub("\.dpkg-new", "", dir)
+ new_dir = re.sub(r"\.dpkg-new", "", dir)
if dir != new_dir:
os.rename(os.path.join(root, dir),
os.path.join(root, new_dir))
for file in files:
- new_file = re.sub("\.dpkg-new", "", file)
+ new_file = re.sub(r"\.dpkg-new", "", file)
if file != new_file:
os.rename(os.path.join(root, file),
os.path.join(root, new_file))
@@ -1744,11 +1748,10 @@ class DpkgPM(OpkgDpkgPM):
os.path.join(self.deploy_dir, arch))
base_arch_list = base_archs.split()
- multilib_variants = self.d.getVar("MULTILIB_VARIANTS");
+ multilib_variants = self.d.getVar("MULTILIB_VARIANTS")
for variant in multilib_variants.split():
localdata = bb.data.createCopy(self.d)
variant_tune = localdata.getVar("DEFAULTTUNE_virtclass-multilib-" + variant, False)
- orig_arch = localdata.getVar("DPKG_ARCH")
localdata.setVar("DEFAULTTUNE", variant_tune)
variant_arch = localdata.getVar("DPKG_ARCH")
if variant_arch not in base_arch_list:
@@ -1762,7 +1765,7 @@ class DpkgPM(OpkgDpkgPM):
if match_arch:
for base_arch in base_arch_list:
architectures += "\"%s\";" % base_arch
- apt_conf.write(" Architectures {%s};\n" % architectures);
+ apt_conf.write(" Architectures {%s};\n" % architectures)
apt_conf.write(" Architecture \"%s\";\n" % base_archs)
else:
line = re.sub("#ROOTFS#", self.target_rootfs, line)
--
2.11.0
next prev parent reply other threads:[~2018-12-14 1:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-14 1:08 [PATCH 1/2] package_manager: don't search for binaries in $PATH explicitly Ross Burton
2018-12-14 1:08 ` Ross Burton [this message]
2018-12-14 1:35 ` ✗ patchtest: failure for "package_manager: don't search ..." and 1 more Patchwork
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=20181214010848.24170-2-ross.burton@intel.com \
--to=ross.burton@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox