From patchwork Sun Mar 1 21:18:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Titouan Christophe X-Patchwork-Id: 1247370 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=railnova.eu Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=railnova-eu.20150623.gappssmtp.com header.i=@railnova-eu.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=VvcQ1I2D; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48Vx3q0S49z9sRY for ; Mon, 2 Mar 2020 08:19:18 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 50C2A87762; Sun, 1 Mar 2020 21:19:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iCyZY90bgopp; Sun, 1 Mar 2020 21:19:12 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 54C6F8774C; Sun, 1 Mar 2020 21:19:12 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 29C1D1BF3CC for ; Sun, 1 Mar 2020 21:19:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 2694985721 for ; Sun, 1 Mar 2020 21:19:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8Ui6mEner7td for ; Sun, 1 Mar 2020 21:19:09 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by whitealder.osuosl.org (Postfix) with ESMTPS id 5AA71856F4 for ; Sun, 1 Mar 2020 21:19:09 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id a25so1124271wmm.0 for ; Sun, 01 Mar 2020 13:19:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=railnova-eu.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=7E3qXiPgP9bsCPEE6pWH3SXTQCrX4jSsIvPFMd2cBZM=; b=VvcQ1I2DMahpbICrOP+ARB4oY/EoDAwJP+7XVB3jHvf219sEW192cs21n+kWdAf3uo v+KglwzDcoetCDNdKbyP/GhsAxAo/nJ5mlLt3QDxrBUnNbUXt7M3XAkGbt3BxEWm5/GU 6kyGCuWrDFx20CwCjSikGHsxJVr7ylh/QUa0MWQRxYwi5ZIqNt5j03dyuOVrgSkFbVzN t+OGj4ajDFhzmFpcb3qRF09WtvJIvt3CJuWSzYdYQlYBVlAaLdaGBn1RFiXMjDmmB2Ly qSvYBZVBkcIjrx0Y0qRnakNZjqtET7g9kAw6hedt7qZmf+XpLWXrcn1URHZaRASwyXfJ Bk0g== 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:mime-version :content-transfer-encoding; bh=7E3qXiPgP9bsCPEE6pWH3SXTQCrX4jSsIvPFMd2cBZM=; b=kcXGte1bYvTBdQsFvZp22w9HnUOJuhry2+RzWkfNTYAermtv8uU6VV1prm/ifoQlNB oSJ1g6Qa4tYYh1MKKv9tHOkHNYg1sm2nBBX0pGcH3NCQ9MziF2j3FyDNo6pvV5Z8L47G EzGRQKGw81a9AWVLM7uvecX02wbUABj0ExJorNHT1LP2gE8w9KuhNzvhFmyCHC1bx9Ea pp/+5lLYHVEXKQYs2hMfO0TH0yZsBFaXU7lZocF962ajEz0d0yPbPPGjvRqVUOf8SW9x wJwciCcrybuLJ5dPsa8xGr4NCNNw8CgbTj0jvXO6dzRvYFf6zoE9BaGcZy6EC1h9Q8A5 guSQ== X-Gm-Message-State: APjAAAXtPKe0HnIC0gcKmIUM7Xro1gO0sBaQs7Ho33DlRtoRHjzNBFGQ WMn4L6xhmn2/dvFDrazfqcx9qkNI6YQ= X-Google-Smtp-Source: APXvYqwqeDHrhoaNNWA+eSW5jY88sgfWDXyNJSHJFB250QHk2U78JTWaS+MwRDxoGcW+Jghgs1H8Ag== X-Received: by 2002:a7b:cb46:: with SMTP id v6mr16790765wmj.117.1583097547328; Sun, 01 Mar 2020 13:19:07 -0800 (PST) Received: from localhost.localdomain ([185.224.57.162]) by smtp.gmail.com with ESMTPSA id f15sm5849933wru.83.2020.03.01.13.19.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Mar 2020 13:19:06 -0800 (PST) From: Titouan Christophe To: buildroot@buildroot.org Date: Sun, 1 Mar 2020 22:18:48 +0100 Message-Id: <20200301211848.13659-1-titouan.christophe@railnova.eu> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] support/scripts/pkg-stats: decode subprocess output for python3 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas De Schampheleire , Thomas Petazzoni , Titouan Christophe Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" In Python 3, the functions from the subprocess module return bytes (and no longer strings as in Python 2), which must be decoded for further text operations. Now, pkg-stats can be run in Python 3. Signed-off-by: Titouan Christophe --- support/scripts/pkg-stats | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/support/scripts/pkg-stats b/support/scripts/pkg-stats index 7721d98459..e414ec50f2 100755 --- a/support/scripts/pkg-stats +++ b/support/scripts/pkg-stats @@ -157,7 +157,7 @@ class Package: o = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[1] lines = o.splitlines() for line in lines: - m = re.match("^([0-9]*) warnings generated", line) + m = re.match("^([0-9]*) warnings generated", line.decode()) if m: self.warnings = int(m.group(1)) return @@ -351,7 +351,7 @@ def package_init_make_info(): # Fetch all variables at once variables = subprocess.check_output(["make", "BR2_HAVE_DOT_CONFIG=y", "-s", "printvars", "VARS=%_LICENSE %_LICENSE_FILES %_VERSION %_IGNORE_CVES"]) - variable_list = variables.splitlines() + variable_list = variables.decode().splitlines() # We process first the host package VERSION, and then the target # package VERSION. This means that if a package exists in both @@ -886,7 +886,7 @@ def __main__(): package_list = None date = datetime.datetime.utcnow() commit = subprocess.check_output(['git', 'rev-parse', - 'HEAD']).splitlines()[0] + 'HEAD']).splitlines()[0].decode() print("Build package list ...") packages = get_pkglist(args.npackages, package_list) print("Getting package make info ...")