From patchwork Sun Nov 12 02:17:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Yurovsky X-Patchwork-Id: 837109 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) 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; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gifSyDsa"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yZHVM5Wmgz9t0F for ; Sun, 12 Nov 2017 13:17:46 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 059388855F; Sun, 12 Nov 2017 02:17:42 +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 5MNPjMdNePnw; Sun, 12 Nov 2017 02:17:39 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id A229088572; Sun, 12 Nov 2017 02:17:39 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 201951C25D9 for ; Sun, 12 Nov 2017 02:17:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 13C852D9F3 for ; Sun, 12 Nov 2017 02:17:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ASIVE7FR0opm for ; Sun, 12 Nov 2017 02:17:37 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pf0-f181.google.com (mail-pf0-f181.google.com [209.85.192.181]) by silver.osuosl.org (Postfix) with ESMTPS id 751AA25046 for ; Sun, 12 Nov 2017 02:17:37 +0000 (UTC) Received: by mail-pf0-f181.google.com with SMTP id b6so9153683pff.10 for ; Sat, 11 Nov 2017 18:17:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=lGWtrZPZRa1gJ++4vLJ0KNLbpkk91N+cwiP77o19yfc=; b=gifSyDsaQmE6skh/n/QdTpeTWlQE49MwXg5oshX7c2Au/PjeMnpsIe/aT2sYqjs7Po VT8nXAILA4fV0cAaQjCqIzFVRoxB8HYSN40x9GBA2Ezo8o1W5hCbnyWNVzaIByeUZSoL 5gsuJ8ciTAWhtQ06vh62MA4HQaZ8N4laQ9rGfhD5rR+AvSKr+zPvSmuek5x6E8Nnk6XW 8SGigpvSbHLBaLp9PmBMYxtXKjbRHPGGbxXgBJeUFgnLVUPVQK2LPD16qKtM66cy3bGM ueDoSNxPggeCbA0DtT/735cZJSv04VvoAUTUooiDTrRZ2vkHw61U0CHbUQQ/H0oLtRgy H0Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=lGWtrZPZRa1gJ++4vLJ0KNLbpkk91N+cwiP77o19yfc=; b=fEy2jyOpBUZl00IMEh5i8uSZjLVAsOTpuGK3EMgjd2+WddNT73zDeEo3bk84rSvu4R DGYgaJeA5SaA8rFhQcsLyC5t3eci8cOtxF4/sLdPU8WySapOJ4qpE5wpp0XMjBICicmW D+QyRRyAM582Q+0b9xKQtIrA/hs7X1vU+aaZNPLHmErRzzQVJb2y14th2H7WDbbUmP9B jhm+Y//njQhuYUaHSQY5/R0vGrkQUj73TnEAtwsqkqctY3iVvfDepfEuITbuFMBH/2dk GrNJefYWK2+r2s1nHsDlyIqw0aCMtmwQS9yR3iCvukzJe1g7yn3YVRpc5nT9WKgi6fhD xqKA== X-Gm-Message-State: AJaThX7dgF7fNIIoGmN/qxLxo1Yd+6NMN5MQj8BWZz8PdKf4Yn0NZvAG ns3SwVpxu3DOlhmYKvEn+S4fepkTOOxD6p9DJFFzOE4Q X-Google-Smtp-Source: AGs4zMZe76L0DVKIY0H1MRSQ760xi11Gp6GdilVmmsf0gXG4CW0NbgVCjSCtXwoI3Rbi6WYpy9jh8hKE3hS82ZIfjd8= X-Received: by 10.99.157.3 with SMTP id i3mr4727204pgd.165.1510453056526; Sat, 11 Nov 2017 18:17:36 -0800 (PST) MIME-Version: 1.0 Received: by 10.100.140.22 with HTTP; Sat, 11 Nov 2017 18:17:36 -0800 (PST) From: Andrey Yurovsky Date: Sat, 11 Nov 2017 18:17:36 -0800 Message-ID: To: buildroot@buildroot.org Subject: [Buildroot] potential divide by zero in support/scripts/size-stats X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" I see a divide by zero exception in support/scripts/size-stats when I use the graph-size target, the package of size zero causing this is skeleton-init-systemd which I worked out by catching the exception. Is this package erroneously of size zero or should that be OK? --- support/scripts/size-stats | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/support/scripts/size-stats b/support/scripts/size-stats index af45000..3cd6838 100755 --- a/support/scripts/size-stats +++ b/support/scripts/size-stats @@ -178,9 +178,12 @@ def gen_files_csv(filesdict, pkgsizes, outputf): "File size in system (%)"]) for f, (pkgname, filesize) in filesdict.items(): pkgsize = pkgsizes[pkgname] - wr.writerow([f, pkgname, filesize, pkgsize, - "%.1f" % (float(filesize) / pkgsize * 100), - "%.1f" % (float(filesize) / total * 100)]) + try: + wr.writerow([f, pkgname, filesize, pkgsize, + "%.1f" % (float(filesize) / pkgsize * 100), + "%.1f" % (float(filesize) / total * 100)]) + except ZeroDivisionError: + print('WARNING: \"%s\" is size 0!' % pkgname) #