[elbe-devel] [PATCH v3 42/52] Fix style in "efilesystem.py"

Torben Hohn torben.hohn at linutronix.de
Fri Jul 5 13:29:15 CEST 2019


On Thu, Jun 27, 2019 at 02:44:56PM +0200, dion at linutronix.de wrote:
> From: Olivier Dion <dion at linutronix.de>
> 
> Signed-off-by: Olivier Dion <dion at linutronix.de>

Reviewed-by: Torben Hohn <torben.hohn at linutronix.de>

> ---
>  elbepack/efilesystem.py | 27 +++++++++++----------------
>  1 file changed, 11 insertions(+), 16 deletions(-)
> 
> diff --git a/elbepack/efilesystem.py b/elbepack/efilesystem.py
> index d10fc6ab..c39a80e2 100644
> --- a/elbepack/efilesystem.py
> +++ b/elbepack/efilesystem.py
> @@ -110,13 +110,11 @@ def extract_target(src, xml, dst, cache):
>                  ui = "/usr/bin/" + str(xml.defs["userinterpr"])
>              do('cp %s %s' % (ui, dst.fname("usr/bin")))
>  
> -        chroot(dst.path, "/usr/bin/dpkg --clear-selections")
> -        chroot(
> -            dst.path,
> -            "/usr/bin/dpkg --set-selections < %s " %
> -            dst.fname(psel))
> -        chroot(dst.path, "/usr/bin/dpkg --purge -a")
> -
> +        cmds = ["--clear-selections",
> +                "--set-selections < %s" % dst.fname(psel),
> +                "--purge -a"]
> +        for cmd in cmds:
> +            chroot(dst.path, "/usr/bin/dpkg %s" % cmd)
>  
>  class ElbeFilesystem(Filesystem):
>      def __init__(self, path, clean=False):
> @@ -144,8 +142,8 @@ class ElbeFilesystem(Filesystem):
>                  with io.open(os.path.join(d, "copyright"), "rb") as lic:
>                      lic_text = lic.read()
>              except IOError as e:
> -                logging.error("Error while processing license file %s: '%s'" %
> -                              (os.path.join(d, "copyright"), e.strerror))
> +                logging.exception("Error while processing license file %s",
> +                                  os.path.join(d, "copyright"))
>                  lic_text = "Error while processing license file %s: '%s'" % (
>                      os.path.join(d, "copyright"), e.strerror)
>  
> @@ -341,10 +339,8 @@ class TargetFs(ChRootFilesystem):
>              cpio_name = self.xml.text("target/package/cpio/name")
>              os.chdir(self.fname(''))
>              try:
> -                do(
> -                    "find . -print | cpio -ov -H newc >%s" %
> -                    os.path.join(
> -                        targetdir, cpio_name))
> +                do("find . -print | cpio -ov -H newc >%s" %
> +                   os.path.join(targetdir, cpio_name))
>                  # only append filename if creating cpio was successful
>                  self.images.append(cpio_name)
>              except CommandError:
> @@ -356,9 +352,8 @@ class TargetFs(ChRootFilesystem):
>              sfs_name = self.xml.text("target/package/squashfs/name")
>              os.chdir(self.fname(''))
>              try:
> -                do(
> -                    "mksquashfs %s %s/%s -noappend -no-progress" %
> -                    (self.fname(''), targetdir, sfs_name))
> +                do("mksquashfs %s %s/%s -noappend -no-progress" %
> +                   (self.fname(''), targetdir, sfs_name))
>                  # only append filename if creating mksquashfs was successful
>                  self.images.append(sfs_name)
>              except CommandError as e:
> -- 
> 2.11.0
> 
> 
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel

-- 
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Hinweise zum Datenschutz finden Sie hier (Informations on data privacy 
can be found here): https://linutronix.de/kontakt/Datenschutz.php

Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen | 
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700 
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner



More information about the elbe-devel mailing list