[elbe-devel] [PATCH 23/32] Nuke ASCIIDocLog from packers
dion at linutronix.de
dion at linutronix.de
Fri Jun 14 22:13:37 CEST 2019
From: Olivier Dion <dion at linutronix.de>
Signed-off-by: Olivier Dion <dion at linutronix.de>
---
elbepack/efilesystem.py | 2 +-
elbepack/packers.py | 22 +++++++++++-----------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/elbepack/efilesystem.py b/elbepack/efilesystem.py
index 3d2e3d6d..39335057 100644
--- a/elbepack/efilesystem.py
+++ b/elbepack/efilesystem.py
@@ -368,7 +368,7 @@ class TargetFs(ChRootFilesystem):
def pack_images(self, builddir):
for img, packer in self.image_packers.items():
self.images.remove(img)
- packed = packer.pack_file(self.log, builddir, img)
+ packed = packer.pack_file(builddir, img)
if packed:
self.images.append(packed)
diff --git a/elbepack/packers.py b/elbepack/packers.py
index 38bf95b8..894f94c1 100644
--- a/elbepack/packers.py
+++ b/elbepack/packers.py
@@ -4,18 +4,18 @@
# SPDX-License-Identifier: GPL-3.0-or-later
import os
-from elbepack.shellhelper import CommandError
+from elbepack.shellhelper import CommandError, do
class Packer(object):
# pylint: disable=too-few-public-methods
- def pack_file(self, _log, _builddir, _fname):
+ def pack_file(self, _builddir, _fname):
raise NotImplementedError('abstract method called')
class NoPacker(Packer):
# pylint: disable=too-few-public-methods
- def pack_file(self, _log, _builddir, fname):
+ def pack_file(self, _builddir, fname):
return fname
@@ -26,10 +26,10 @@ class InPlacePacker(Packer):
self.cmd = cmd
self.suffix = suffix
- def pack_file(self, log, builddir, fname):
+ def pack_file(self, builddir, fname):
try:
fpath = os.path.join(builddir, fname)
- log.do('%s "%s"' % (self.cmd, fpath))
+ do('%s "%s"' % (self.cmd, fpath))
except CommandError:
# in case of an error, we just return None
# which means, that the orig file does not
@@ -45,17 +45,17 @@ class TarArchiver(Packer):
self.flag = flag
self.suffix = suffix
- def pack_file(self, log, builddir, fname):
+ def pack_file(self, builddir, fname):
try:
fpath = os.path.join(builddir, fname)
dirname = os.path.dirname(fpath)
basename = os.path.basename(fpath)
archname = fpath + self.suffix
- log.do('tar cv%sf "%s" --sparse -C "%s" "%s"' % (self.flag,
- archname,
- dirname,
- basename))
- log.do('rm -f "%s"' % fpath)
+ do('tar cv%sf "%s" --sparse -C "%s" "%s"' % (self.flag,
+ archname,
+ dirname,
+ basename))
+ do('rm -f "%s"' % fpath)
except CommandError:
# in case of an error, we just return None
# which means, that the orig file does not
--
2.11.0
More information about the elbe-devel
mailing list