From patchwork Sat Aug 24 13:22:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152610 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="XjHdb1M5"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46FzZh5YH4z9s7T for ; Sat, 24 Aug 2019 23:27:08 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 4274FC21DB5; Sat, 24 Aug 2019 13:27:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 5C4E0C21C3F; Sat, 24 Aug 2019 13:27:01 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D35B4C21C3F; Sat, 24 Aug 2019 13:26:59 +0000 (UTC) Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) by lists.denx.de (Postfix) with ESMTPS id 43521C21C38 for ; Sat, 24 Aug 2019 13:26:59 +0000 (UTC) Received: by mail-io1-f52.google.com with SMTP id 18so26618479ioe.10 for ; Sat, 24 Aug 2019 06:26:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7DtfXC455ScZfj3ge/ID0VPA+iZE/nX4m3x0YLDBpYU=; b=XjHdb1M5KOW17rRlCaWLosbKeVNGuWYsz2z9GJ95dMrkRpo2eURPfTMeZlp7F3DA37 KdWNb2h//qiVLorzNyBjZwc4RianPg3vHUmhjs/utUcxqysag7jT910iwh/vPZIDr6gR hp4Bnaar6i55IdoF4KKh1gIS3LVAr3S0IpoG8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7DtfXC455ScZfj3ge/ID0VPA+iZE/nX4m3x0YLDBpYU=; b=rTep3GccI7mApMJCw3MJhclbyC7nEX4zFxqxXURf4anR51gAZliK6bUS9OkxKuWHnV v9Pu4AkjSPsxpK3l0fP01R3m74oBQoFvWP2/XXzSCg8Kf2Llq0HUQYcPcXP6E4DM+1pj S94SFZvWk5VTcYSU/bPNDaSw2PYod9Vdg6KEx+0wemdoOMmNFlDA68klFZYhq1B6gu9L s3/oct0kJ20PL89t7YdOpwQoXyYRvTQqr/Zq3Wuk51DRe17lCrHSor35kOQHnOrhp6Wb MOkQbOBsHPgARd32W+yZEkeiaUVlJKuqbGZbu78Fo8bs+zLbCbpB5JHTr+w4Rw+283Yq BCoA== X-Gm-Message-State: APjAAAWl2qnw37mhjjOfJCGthlBnRT0dKVVyvvjDxT+H+hGKwvSOrI6e BZORHKSKyC5Pix1PXaE0FTLY28F4fcs= X-Google-Smtp-Source: APXvYqza1ctkngiSDpzoop34sRXGDQbya2+5TLJgqqV3xZIRlmxMW8pIr4lS4IgeCfehdDYMsVBgsQ== X-Received: by 2002:a02:b713:: with SMTP id g19mr9666622jam.77.1566653218029; Sat, 24 Aug 2019 06:26:58 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.26.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:26:57 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:22:41 -0600 Message-Id: <20190824132315.53130-2-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 01/34] patman: Drop binary parameter X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Since cros_subprocess use bytestrings now, this feature not needed. Drop it. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/patman/cros_subprocess.py | 3 +-- tools/patman/tools.py | 15 +++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/tools/patman/cros_subprocess.py b/tools/patman/cros_subprocess.py index 06be64cc2c..0f0d60dfb7 100644 --- a/tools/patman/cros_subprocess.py +++ b/tools/patman/cros_subprocess.py @@ -54,7 +54,7 @@ class Popen(subprocess.Popen): """ def __init__(self, args, stdin=None, stdout=PIPE_PTY, stderr=PIPE_PTY, - shell=False, cwd=None, env=None, binary=False, **kwargs): + shell=False, cwd=None, env=None, **kwargs): """Cut-down constructor Args: @@ -72,7 +72,6 @@ class Popen(subprocess.Popen): """ stdout_pty = None stderr_pty = None - self.binary = binary if stdout == PIPE_PTY: stdout_pty = pty.openpty() diff --git a/tools/patman/tools.py b/tools/patman/tools.py index 0d4705db76..97441ca796 100644 --- a/tools/patman/tools.py +++ b/tools/patman/tools.py @@ -186,7 +186,7 @@ def PathHasFile(path_spec, fname): return True return False -def Run(name, *args, **kwargs): +def Run(name, *args): """Run a tool with some arguments This runs a 'tool', which is a program used by binman to process files and @@ -196,7 +196,6 @@ def Run(name, *args, **kwargs): Args: name: Command name to run args: Arguments to the tool - kwargs: Options to pass to command.run() Returns: CommandResult object @@ -206,8 +205,8 @@ def Run(name, *args, **kwargs): if tool_search_paths: env = dict(os.environ) env['PATH'] = ':'.join(tool_search_paths) + ':' + env['PATH'] - return command.Run(name, *args, capture=True, - capture_stderr=True, env=env, **kwargs) + return command.Run(name, *args, capture=True, capture_stderr=True, + env=env) except: if env and not PathHasFile(env['PATH'], name): msg = "Please install tool '%s'" % name @@ -401,14 +400,14 @@ def Compress(indata, algo, with_header=True): fname = GetOutputFilename('%s.comp.tmp' % algo) WriteFile(fname, indata) if algo == 'lz4': - data = Run('lz4', '--no-frame-crc', '-c', fname, binary=True) + data = Run('lz4', '--no-frame-crc', '-c', fname) # cbfstool uses a very old version of lzma elif algo == 'lzma': outfname = GetOutputFilename('%s.comp.otmp' % algo) Run('lzma_alone', 'e', fname, outfname, '-lc1', '-lp0', '-pb0', '-d8') data = ReadFile(outfname) elif algo == 'gzip': - data = Run('gzip', '-c', fname, binary=True) + data = Run('gzip', '-c', fname) else: raise ValueError("Unknown algorithm '%s'" % algo) if with_header: @@ -441,13 +440,13 @@ def Decompress(indata, algo, with_header=True): with open(fname, 'wb') as fd: fd.write(indata) if algo == 'lz4': - data = Run('lz4', '-dc', fname, binary=True) + data = Run('lz4', '-dc', fname) elif algo == 'lzma': outfname = GetOutputFilename('%s.decomp.otmp' % algo) Run('lzma_alone', 'd', fname, outfname) data = ReadFile(outfname) elif algo == 'gzip': - data = Run('gzip', '-cd', fname, binary=True) + data = Run('gzip', '-cd', fname) else: raise ValueError("Unknown algorithm '%s'" % algo) return data