From patchwork Tue Feb 5 21:21:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas De Schampheleire X-Patchwork-Id: 1037210 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="LLqQwtmJ"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43vHZy6TbQz9s7T for ; Wed, 6 Feb 2019 08:22:02 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 1530886EA1; Tue, 5 Feb 2019 21:22:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9RZJskBe4iny; Tue, 5 Feb 2019 21:21:52 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0E6C986E59; Tue, 5 Feb 2019 21:21:50 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id CB09F1BF398 for ; Tue, 5 Feb 2019 21:21:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B9BC981E71 for ; Tue, 5 Feb 2019 21:21:48 +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 O96CTLjweyl6 for ; Tue, 5 Feb 2019 21:21:47 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by hemlock.osuosl.org (Postfix) with ESMTPS id 772C688596 for ; Tue, 5 Feb 2019 21:21:47 +0000 (UTC) Received: by mail-ed1-f67.google.com with SMTP id b17so6685eds.2 for ; Tue, 05 Feb 2019 13:21:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mOysCt+Ab1GILlDHsGYTCsQiYBcx3tF+hJPzQ4g3D5E=; b=LLqQwtmJlu6K8L+lqViF4aDonqED8W+PrOBfUsrk6wsG5jYf0ImdZqDzOXY2ArsQgl ICYrKFfqUFZ4vVk9LL6FpIlY7WAxxP9Q63JyqwhbCF5kLdx8DNRTvDq6Rv74s+1M62gd S9Np+xy+8GAoQFBjlGOdW3gioZtNxsEvdmRrvcdXytiWlPaYtf99X+8hhEPbU8LmEI4+ p297V2C/Ss4KEwH3388fDDeHK8MiGMLyp7SHHFhlAQ9BmeGKbiM7RifzCErv+9Y4aZab +THF2lKfIhJ3EvlSiKGUOR0pBVOxaM2q7aTYxvu5uqq407c/4O16I0TSzMXVYYyqacNs Zkvw== 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=mOysCt+Ab1GILlDHsGYTCsQiYBcx3tF+hJPzQ4g3D5E=; b=uBe51n3WARcMbfneElnfQNeoOTKy8XpvHyHWia2zBXpxpB/RPOvH/MMLs1+nUU4qNF 8XCIJwbUsXHjkNo7EA1oSaJ5Y4WeNbib8dfn8OH+sBtNYgU21M/bU6SJRmDECJhvAR6c JciK78MfeEE2r3yt/iGbiO1HcuKy7sM+TyAIGyC+G1eUvDzjhEF7xGs/HSiRyxay/wNM xdo4a1g/eXwv82dnh1kM3ZZGZfbz51ZBgZyuZc6sWXy4W2VpHbH8R/ZZFQnKWnSo/wbD VZ2+Q4zXFdpSk0ga99RHK0Z7w2vWZ1EeAJX2YdAnNfEBBHFhBW2KAT09dracqBlU9NVR DGvQ== X-Gm-Message-State: AHQUAuZwobR7ZPAsnw4sq8gUEW7Mpeo0Lp7caQ0G10uUXAGsiLhffSA1 CuQV3c2gtS5phETw02jM/iTezaaD2+4= X-Google-Smtp-Source: AHgI3IYJtcxD2065o4cofdN6sKeVM+nKmL/7aHcI//THVFPbg2PMeP0Cawrx2enNISfL14jPvDlktA== X-Received: by 2002:a17:906:8144:: with SMTP id z4mr4960873ejw.205.1549401705564; Tue, 05 Feb 2019 13:21:45 -0800 (PST) Received: from localhost.localdomain (ptr-5ltycmajy3605r3p7a.18120a2.ip6.access.telenet.be. [2a02:1810:530:b600:aa50:f99f:a32c:5156]) by smtp.gmail.com with ESMTPSA id u18sm3270021ejl.5.2019.02.05.13.21.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Feb 2019 13:21:44 -0800 (PST) From: Thomas De Schampheleire To: buildroot@buildroot.org Date: Tue, 5 Feb 2019 22:21:42 +0100 Message-Id: <20190205212142.2244-2-patrickdepinguin@gmail.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190205212142.2244-1-patrickdepinguin@gmail.com> References: <20190205212142.2244-1-patrickdepinguin@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCHv3 2/2] utils/test-pkg: clean output dir for successful builds 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 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Thomas De Schampheleire test-pkg will use gigabytes of space when testing all toolchains. Nevertheless, you are normally only interested in the actual build / host tree when there is a build failure. Do a 'make clean' for successful builds to save disk space, unless the new option '-k/--keep' is set. Note that the logfile and configuration is always retained for inspection. Signed-off-by: Thomas De Schampheleire Acked-by: Yann E. MORIN --- utils/test-pkg | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) v3: add missing help entry for --keep v2: make the feature optional via '--keep' (feedback Arnout and Peter) diff --git a/utils/test-pkg b/utils/test-pkg index 087f9ddca9..c2aec0784d 100755 --- a/utils/test-pkg +++ b/utils/test-pkg @@ -6,16 +6,17 @@ TOOLCHAINS_CSV='support/config-fragments/autobuild/toolchain-configs.csv' main() { local o O opts local cfg dir pkg random toolchains_csv toolchain all number mode - local ret nb nb_skip nb_fail nb_legal nb_tc build_dir + local ret nb nb_skip nb_fail nb_legal nb_tc build_dir keep local -a toolchains - o='hac:d:n:p:r:t:' - O='help,all,config-snippet:,build-dir:,number:,package:,random:,toolchains-csv:' + o='hakc:d:n:p:r:t:' + O='help,all,keep,config-snippet:,build-dir:,number:,package:,random:,toolchains-csv:' opts="$(getopt -n "${my_name}" -o "${o}" -l "${O}" -- "${@}")" eval set -- "${opts}" random=0 all=0 + keep=0 number=0 mode=0 toolchains_csv="${TOOLCHAINS_CSV}" @@ -27,6 +28,9 @@ main() { (-a|--all) all=1; shift 1 ;; + (-k|--keep) + keep=1; shift 1 + ;; (-c|--config-snippet) cfg="${2}"; shift 2 ;; @@ -161,6 +165,12 @@ build_one() { if ! make O="${dir}" legal-info >> "${dir}/logfile" 2>&1; then return 3 fi + + # If we get here, the build was successful. Clean up the build/host + # directories to save disk space, unless 'keep' was set. + if [ ${keep} -ne 1 ]; then + make O="${dir}" clean >> "${dir}/logfile" 2>&1 + fi } help() { @@ -221,6 +231,11 @@ Options: try. If not specified, the toolchains in ${TOOLCHAINS_CSV} will be used. + -k, --keep + Keep the build directories even if the build succeeds. + Note: the logfile and configuration is always retained, even without + this option. + Example: Testing libcec would require a config snippet that contains: