From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6657041487194226688 X-Received: by 2002:a1c:2088:: with SMTP id g130mr333063wmg.6.1549990629551; Tue, 12 Feb 2019 08:57:09 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:4b0e:: with SMTP id y14ls480536wma.6.canary-gmail; Tue, 12 Feb 2019 08:57:08 -0800 (PST) X-Google-Smtp-Source: AHgI3IbVxF5eRS3DBaxZs4VzYofuTZ1ue/zdZpJb8VSHHaI64QbLzy9czcyIn0+JRHs2d942hUwe X-Received: by 2002:a1c:e703:: with SMTP id e3mr362628wmh.1.1549990628357; Tue, 12 Feb 2019 08:57:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549990628; cv=none; d=google.com; s=arc-20160816; b=p2BPPnlSK+RXaJLsan9pv0ldtKVnb1UaAriDFjF5LQ5n/2YFi9r97ZubdDhyKGjtyy XLg/+J1BmXzqVWZJsIIKYKMzIhAxZJT9JGuDqPQr0I9Rl6dgn47MO8CQ5xTPK1i4Bh9N pV5FfOOseAlLIhh8Ip9aTv5uXt/tjGEU9hNqHRA1j172Ohwe564BXVvSSvTGrvg+jj2e wrtn5l2J0aRJ/JxJzb3e3K7vJJUCYjCrcTTSdCnGNRyMivgzlpn1RF7OwSD5A8iQ1CvS F8CSpIBZSBCCtqR8BTFSRb7r/+WIHutwsCRiwXK5FJMTbtO3L8bCDrcVXU/Sht+TR6t0 ekHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from; bh=ppqq66w3IvgKQ7NQWEzJ6AuhOA8uCtjMJJzHKnHNUo4=; b=vLafp/mRA92TyaoTivuURN+U2ifmlEz9gXP56xEbPlh/JGJBxugDJq70TIOmQwPIGv hivC1x7Z8aYlVuPd58GMs0kix+mPHx6tGKWEPKBoTpNqDcHEHib3WGrwwPP7wSLtTKBo ItiqDZZ75zok7pBocMc7WLS9jQz5woIMgcwxHMj8bPX2FHNMVFHd+hOl3L2xtr3nUwaH fFuWK82GMko/vC9pnI9ypUy6POkcFFb3IGhkdZtEoiIaoRX3BuJB7mr9WJaPQIfPgzJs XCucpxI0r/Vopair10mqtI0O6g4Up4HZZoinRLaToJBELWSwQcbRRrXLuE5WeUPK9DQi Hsjg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of hws@denx.de) smtp.mailfrom=hws@denx.de Return-Path: Received: from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.9]) by gmr-mx.google.com with ESMTPS id y6si157849wmd.1.2019.02.12.08.57.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Feb 2019 08:57:08 -0800 (PST) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of hws@denx.de) client-ip=212.18.0.9; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of hws@denx.de) smtp.mailfrom=hws@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 43zTN41Dghz1rV0J for ; Tue, 12 Feb 2019 17:57:08 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 43zTN418k2z1r2H2 for ; Tue, 12 Feb 2019 17:57:08 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id dE_7W-GE3tJn for ; Tue, 12 Feb 2019 17:57:07 +0100 (CET) X-Auth-Info: /h6MdqB19nNRazoQt/6FWJM0i9ApbeXUtHVUHxu8+w0= Received: from sandvich.fritz.box (p578a821c.dip0.t-ipconnect.de [87.138.130.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA for ; Tue, 12 Feb 2019 17:57:06 +0100 (CET) From: Harald Seiler To: isar-users@googlegroups.com Subject: [PATCH v2 0/5] Python refactoring Date: Tue, 12 Feb 2019 17:56:32 +0100 Message-Id: <20190212165637.19970-1-hws@denx.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: 2iZ8nOfrvjts This series contains a number of improvements to python code in isar: * All instancess of subprocess.{call,Popen,check_call}() have been changed to never use `shell=True`. This will hopefully prevent bugs in the future. * The use of the % formatter was replaced by other methods, as % was deprecated because it can behave weirdly. Unfortunately, as we have to support python back to 3.5, we can not yet make use of f-Strings, so other options had to be used. I decided to use string concatenation for simple cases where the use of .format() would have been too verbose. * A recursive call in get_image_name was removed in favor of an imperative code style. This should make the respective function easier to read. Changes in v2: * Remove redundant encoding parameter * Fix formatting * Refactor a task that I previously missed * Add a commit for general style fixes Harald Seiler (5): Remove all uses of subprocess.call(shell=True) Use modern python formatting image: Remove recursion in get_image_name wic: Refactor fakeroot script Fix python style .../example-module/example-module.bb | 8 ++- meta/classes/base.bbclass | 70 ++++++++++++++-------- meta/classes/image.bbclass | 22 +++++-- meta/classes/isar-bootstrap-helper.bbclass | 8 +-- meta/classes/isar-events.bbclass | 14 ++--- meta/classes/patch.bbclass | 13 ++-- meta/classes/wic-img.bbclass | 21 +++++-- .../isar-bootstrap/isar-bootstrap-host.bb | 9 ++- .../isar-bootstrap/isar-bootstrap-target.bb | 5 +- .../recipes-core/isar-bootstrap/isar-bootstrap.inc | 12 ++-- scripts/wic_fakeroot | 9 +-- 11 files changed, 120 insertions(+), 71 deletions(-) -- 2.14.1