From patchwork Sun May 8 12:09:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leo-Andres Hofmann X-Patchwork-Id: 5593 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4Kx35y2h0nz3xqn for ; Sun, 8 May 2022 12:10:14 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Kx35t71X8z5mr; Sun, 8 May 2022 12:10:10 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Kx35t53HGz302b; Sun, 8 May 2022 12:10:10 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4Kx35s3Gcbz2xZP for ; Sun, 8 May 2022 12:10:09 +0000 (UTC) Received: from arche.uberspace.de (arche.uberspace.de [185.26.156.147]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPS id 4Kx35m2BKgz1Qw for ; Sun, 8 May 2022 12:10:04 +0000 (UTC) Received: (qmail 30325 invoked by uid 990); 8 May 2022 12:10:03 -0000 From: Leo-Andres Hofmann To: development@lists.ipfire.org Subject: [PATCH 3/7] pakfire.cgi: Show error and log messages earlier Date: Sun, 8 May 2022 14:09:48 +0200 Message-Id: <20220508120952.52-3-hofmann@leo-andres.de> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20220508120952.52-1-hofmann@leo-andres.de> References: <20220508120952.52-1-hofmann@leo-andres.de> MIME-Version: 1.0 X-Rspamd-Bar: - X-Rspamd-Report: R_MISSING_CHARSET(0.5) MID_CONTAINS_FROM(1) MIME_HTML_ONLY(0.2) BAYES_HAM(-3) X-Rspamd-Score: -1.3 Received: from unknown (HELO unkown) (::1) by arche.uberspace.de (Haraka/2.8.28) with ESMTPSA; Sun, 08 May 2022 14:10:03 +0200 ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1652011804; a=rsa-sha256; cv=none; b=YwFTW2naP9YH5Wam/fRMna8WV6K3UQjOfH68X6nbm217OHKeYGABeeSJQeySihR8lRj/Va Rk6ORNGwQBUoJT28EOUsRHqkSMCTSS8bJBI//uEepz18TLMq8aBcJZYOJr4WaKdb0HqmEx j5Ih2LXjf9lz+nZyQ3EBFq8t8TTb/lMbpt8zeCRlH9aVxwHPgWG31fmDlUJ4v2wn3r1bM2 Gx1WU2faZGM8quIqsVciSxLdOMRa8I+Cm+s5zFXbyYCQLch3zs4lNX350KfS91Jwg4CDyl v/ZUQIQpE9uCFwTu2DFPXX/yivLs9lJG4YFlIyTpFbswBwYi9hCedEQ6N21l+g== ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=none; spf=pass (mail01.ipfire.org: domain of hofmann@leo-andres.de designates 185.26.156.147 as permitted sender) smtp.mailfrom=hofmann@leo-andres.de; dmarc=pass (policy=quarantine) header.from=leo-andres.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1652011804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FNnanan/mIjLeBPH75/BpjRRoTgoDNbN+1pTQrnoS/M=; b=rHQXalBs0LZQ3d21kX9X1t/EBUQT80h4lEdegXNUiuYCyMAxzCH9H5OiDErdLtDjo+LV9Q DLAh8iVHziLDqqS8aIbchehcSvOMr4LKxW+WNCAmawyWGWMmfKGW0Wmpn6i7u8fSNt6EuN acImxhNo7GNmPAb9yKusheivr70dZNNmopf+rRhvKovTswjqyETGmJOw3ToV3N0eClf9D6 NDOElmcrfzl+ZyneRCHpmJSjL8suDrmcrdDcK4qDl+4LScCsmAOe6OUEmBClNRkfX5xNd7 pf6o0vXjWHwlJg6XMShV03anx/gEsEvwUGVSKLBnd6GXKVoHThzhYlnH5uxScw== X-Rspamd-Queue-Id: 4Kx35m2BKgz1Qw X-Rspamd-Server: mail01.haj.ipfire.org X-Spamd-Result: default: False [-3.23 / 11.00]; BAYES_HAM(-2.95)[99.77%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM(-1.00)[-1.000]; SPF_REPUTATION_HAM(-0.77)[-0.77342682734463]; DMARC_POLICY_ALLOW(-0.50)[leo-andres.de,quarantine]; R_MISSING_CHARSET(0.50)[]; MX_INVALID(0.50)[]; R_SPF_ALLOW(-0.20)[+mx:c]; MIME_HTML_ONLY(0.20)[]; IP_REPUTATION_HAM(-0.01)[asn: 205766(0.00), country: DE(-0.01), ip: 185.26.156.147(0.00)]; RCVD_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:~]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:205766, ipnet:185.26.156.0/24, country:DE]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[185.26.156.147:from]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1]; ARC_NA(0.00)[] Authentication-Results: mail01.ipfire.org; dkim=none; spf=pass (mail01.ipfire.org: domain of hofmann@leo-andres.de designates 185.26.156.147 as permitted sender) smtp.mailfrom=hofmann@leo-andres.de; dmarc=pass (policy=quarantine) header.from=leo-andres.de X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" The main page cannot be used while an installation is running. Therefore it makes more sense to generate the log output first. Signed-off-by: Leo-Andres Hofmann Acked-by: Peter Müller --- html/cgi-bin/pakfire.cgi | 79 ++++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi index 535168547..daa82e34c 100644 --- a/html/cgi-bin/pakfire.cgi +++ b/html/cgi-bin/pakfire.cgi @@ -212,7 +212,45 @@ END &Header::openpage($Lang::tr{'pakfire configuration'}, 1, $extraHead); &Header::openbigbox('100%', 'left', '', $errormessage); -# Process Pakfire commands +# Show error message +if ($errormessage) { + &Header::openbox('100%', 'left', $Lang::tr{'error messages'}); + print "$errormessage \n"; + &Header::closebox(); +} + +# Show log output while Pakfire is running +if(&_is_pakfire_busy()) { + &Header::openbox("100%", "center", "Pakfire"); + + print < +
$Lang::tr{'active'}
+
+ $Lang::tr{'pakfire working'}
+
+ +
+
$Lang::tr{'refresh'}
+ + + +

+
+
+END
+;
+
+	&Header::closebox();
+	&Header::closebigbox();
+	&Header::closepage();
+	exit;
+}
+
+# Show Pakfire install/remove dependencies and confirm form
 if (($cgiparams{'ACTION'} eq 'install') && (! &_is_pakfire_busy())) {
 	&Header::openbox("100%", "center", $Lang::tr{'request'});
 
@@ -290,6 +328,7 @@ END
 	exit;
 }
 
+# Show Pakfire main page
 my %selected=();
 my %checked=();
 
@@ -299,44 +338,6 @@ $selected{"TREE"}{"testing"} = "";
 $selected{"TREE"}{"unstable"} = "";
 $selected{"TREE"}{$pakfiresettings{"TREE"}} = "selected";
 
-# DPC move error message to top so it is seen!
-if ($errormessage) {
-	&Header::openbox('100%', 'left', $Lang::tr{'error messages'});
-	print "$errormessage \n";
-	&Header::closebox();
-}
-
-# Show log output while Pakfire is running
-if(&_is_pakfire_busy()) {
-	&Header::openbox("100%", "center", "Pakfire");
-
-	print <
-	
$Lang::tr{'active'}
-
- $Lang::tr{'pakfire working'}
-
- -
-
$Lang::tr{'refresh'}
- - - -

-
-
-END
-;
-
-	&Header::closebox();
-	&Header::closebigbox();
-	&Header::closepage();
-	exit;
-}
-
 my $core_release = `cat /opt/pakfire/db/core/mine 2>/dev/null`;
 chomp($core_release);
 my $core_update_age = &General::age("/opt/pakfire/db/core/mine");