[elbe-devel] [PATCH v4 41/41] Add 'logging' and missing 'do' to updatepkg.py

Torben Hohn torben.hohn at linutronix.de
Wed Aug 7 12:08:11 CEST 2019


On Mon, Jul 08, 2019 at 05:18:37PM +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/updatepkg.py | 25 +++++++++++--------------
>  1 file changed, 11 insertions(+), 14 deletions(-)
> 
> diff --git a/elbepack/updatepkg.py b/elbepack/updatepkg.py
> index 16570355..a5441068 100644
> --- a/elbepack/updatepkg.py
> +++ b/elbepack/updatepkg.py
> @@ -4,8 +4,6 @@
>  #
>  # SPDX-License-Identifier: GPL-3.0-or-later
>  
> -from __future__ import print_function
> -
>  import os
>  import logging
>  
> @@ -15,6 +13,7 @@ from elbepack.elbexml import ElbeXML
>  from elbepack.dump import dump_fullpkgs
>  from elbepack.ziparchives import create_zip_archive
>  from elbepack.repomanager import UpdateRepo
> +from elbepack.shellhelper import do
>  
>  
>  class MissingData(Exception):
> @@ -75,7 +74,7 @@ def gen_update_pkg(project, xml_filename, upd_filename,
>              xmlindex[name] = p
>  
>              if name not in instindex:
> -                print("package removed: %s" % name)
> +                logging.info("Package removed: %s", )
>                  continue
>  
>              ipkg = instindex[name]
> @@ -84,24 +83,23 @@ def gen_update_pkg(project, xml_filename, upd_filename,
>              pfname = ipkg.installed_deb
>  
>              if comp == 0:
> -                print("package ok: %s-%s" % (name, ipkg.installed_version))
> +                logging.info("Package ok: %s-%s", name, ipkg.installed_version)
>                  if debug:
>                      fnamelist.append(pfname)
>                  continue
>  
>              if comp > 0:
> -                print("package upgrade: %s" % pfname)
> +                logging.info("Package upgrade: %s", pfname)
>                  fnamelist.append(pfname)
>              else:
> -                print(
> -                    "package downgrade: %s-%s" %
> -                    (name, ipkg.installed_version))
> +                logging.info("Package downgrade: %s-%s",
> +                             name, ipkg.installed_version)
>  
>          for p in instpkgs:
>              if p.name in xmlindex:
>                  continue
>  
> -            print("package %s newly installed" % p.name)
> +            logging.info("Package %s newly installed", p.name)
>              pfname = p.installed_deb
>              fnamelist.append(pfname)
>  
> @@ -156,8 +154,7 @@ def gen_update_pkg(project, xml_filename, upd_filename,
>  
>      if project.postbuild_file:
>          logging.info("Postbuild script")
> -        do(project.postbuild_file + ' "%s %s %s"' % (
> -            upd_filename,
> -            project.xml.text("project/version"),
> -            project.xml.text("project/name")),
> -           allow_fail=True)
> +        cmd = ' "%s %s %s"' % (upd_filename,
> +                               project.xml.text("project/version"),
> +                               project.xml.text("project/name"))
> +        do(project.postbuild_file + cmd, allow_fail=True)
> -- 
> 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