From patchwork Sun Jul 7 05:28:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atharva Lele X-Patchwork-Id: 1128575 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.133; helo=hemlock.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="X/f1LWP2"; 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 45hHGW3Wmwz9sCJ for ; Sun, 7 Jul 2019 15:30:11 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 23AFC8653F; Sun, 7 Jul 2019 05:30:09 +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 rQrecSkh5xE5; Sun, 7 Jul 2019 05:30:08 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 1252E83DD9; Sun, 7 Jul 2019 05:30:08 +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 648B81BF5DD for ; Sun, 7 Jul 2019 05:30:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 61BB820414 for ; Sun, 7 Jul 2019 05:30:02 +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 HDqRzp0sJbAx for ; Sun, 7 Jul 2019 05:29:57 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by silver.osuosl.org (Postfix) with ESMTPS id D9766204E7 for ; Sun, 7 Jul 2019 05:29:56 +0000 (UTC) Received: by mail-pl1-f172.google.com with SMTP id m9so2856894pls.8 for ; Sat, 06 Jul 2019 22:29:56 -0700 (PDT) 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=Zk2FiuLaLs/di/XgoD6jTxFuScCyTPRxSsKeZt9wdRg=; b=X/f1LWP28y5lmgQ02Y8DDZpjTdIFrGYuqZ2N+Cx1WRPEF6aJ+SoC12F2FRspSfooD5 URu5D3dfdUICgHVlLBO08qkUxDM8RbRl2hElFIabsWo1wyNNXNYfdLU7m8Eg/WQuaQUo btNasDk8s7PIFd6kKPe8D5msxVlMs0Ph3H/x6FoWBb2xnZ9sOmYTZcg5FfbjXYBHUniL ltBNp6Z52hZvPOkt1kt9KLS3DXtNbtBZtrTz2YRyrcF3CZfiHK0fyoZz7eLo9CS32fh5 85mFgLNjM8PApbAzYYSR7tl3pzXFVZOkSsaJrQ0ClarWS4dNcdYS/GWjc8YVN7GuyiJP hLig== 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=Zk2FiuLaLs/di/XgoD6jTxFuScCyTPRxSsKeZt9wdRg=; b=ZTdiYSZdIxbNZP4WAumy4DwCFBrGc5G2TtQnk6TGdRIPE8/YD+35F+4l5Nf1wDV0EH +wzTWNXVPFzYx9vA2KXQPKrXMV74mYq2DatRxL2xSLtTiwBpWx6AL8grCuXw2I54HZ5D pIuVF34aPvjtLshxY3gEW8VpzhbVCIbmu0ghiH+E48g2qnItr/GQ86uQuj8hefE2Kcap C//LhH2VSKGRvPl8N37xsyPFPdW2+6cCmEf2A+Jbp+xp2wIXOyl0QV8FUaK9X8G7q7N/ S4Qa2ckpjJgY80+FB5cvu50f3v8/PVT3kahJ6v+nchAWlU7cz10TK2/CNCBXTrFR1qmR 5CzA== X-Gm-Message-State: APjAAAWA3rizbLhoVqIskjeVtAqaf6I3vAOkpaJlWwdwGzoDSBHd9ZgV s4tuF+akVG+CU4s1kgrwjycxUQi0t/fMLw== X-Google-Smtp-Source: APXvYqznPPMMSY/xbQG07/5SiKK2czgJZWeQC4E8TK7o7tFynqA7cq4ZimXXia+z5VPgZh09l3KKbQ== X-Received: by 2002:a17:902:2aab:: with SMTP id j40mr14367148plb.76.1562477396162; Sat, 06 Jul 2019 22:29:56 -0700 (PDT) Received: from localhost.localdomain ([123.201.194.71]) by smtp.gmail.com with ESMTPSA id j24sm18039214pgg.86.2019.07.06.22.29.53 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 06 Jul 2019 22:29:55 -0700 (PDT) From: Atharva Lele To: buildroot@buildroot.org Date: Sun, 7 Jul 2019 10:58:26 +0530 Message-Id: <20190707052831.9469-26-itsatharva@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190707052831.9469-1-itsatharva@gmail.com> References: <20190707052831.9469-1-itsatharva@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3 26/31] web/import.inc.php: support reading failure reason from reason file 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: Atharva Lele , yann.morin.1998@free.fr, thomas.petazzoni@bootlin.com Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Atharva Lele --- NOTE: This patch is untested. Changes from reason-file-v2 series: - Move to builder-class series --- web/import.inc.php | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/web/import.inc.php b/web/import.inc.php index a9b368f..6f878e0 100644 --- a/web/import.inc.php +++ b/web/import.inc.php @@ -230,17 +230,21 @@ function import_result($buildid, $filename) if ($status == 0) $reason = "none"; else { - $tmp = Array(); - exec("tail -3 " . $thisbuildfinaldir . "build-end.log | grep -v '\[_all\]' | grep 'make.*: \*\*\*' | sed 's,.*\[\([^\]*\)\] Error.*,\\1,' | sed 's,.*/build/\([^/]*\)/.*,\\1,'", $tmp); - if (trim($tmp[0])) - $reason = $tmp[0]; - else { - exec("tail -1 " . $thisbuildfinaldir . "build-time.log | grep :start: | cut -d':' -f4", $tmp); - if (trim($tmp[0])) - $reason = trim($tmp[0]); - else - $reason = "unknown"; - } + if (file_exists($thisbuildfinaldir . "reason")) + $reason = trim(file_get_contents($thisbuildfinaldir . "reason", "r")); + else { + $tmp = Array(); + exec("tail -3 " . $thisbuildfinaldir . "build-end.log | grep -v '\[_all\]' | grep 'make.*: \*\*\*' | sed 's,.*\[\([^\]*\)\] Error.*,\\1,' | sed 's,.*/build/\([^/]*\)/.*,\\1,'", $tmp); + if (trim($tmp[0])) + $reason = $tmp[0]; + else { + exec("tail -1 " . $thisbuildfinaldir . "build-time.log | grep :start: | cut -d':' -f4", $tmp); + if (trim($tmp[0])) + $reason = trim($tmp[0]); + else + $reason = "unknown"; + } + } } /* Compress files that are typically too large and infrequently