From patchwork Sun May 8 12:09:46 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: 5592 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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4Kx35x3jkJz3x1v for ; Sun, 8 May 2022 12:10:13 +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 4Kx35t4vGSz1Qw; 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 4Kx35t49q8z301d; 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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4Kx35s2vFkz2x9j 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 4Kx35l6GCgznj for ; Sun, 8 May 2022 12:10:03 +0000 (UTC) Received: (qmail 30295 invoked by uid 990); 8 May 2022 12:10:02 -0000 From: Leo-Andres Hofmann To: development@lists.ipfire.org Subject: [PATCH 1/7] pakfire.cgi: Separate command processing and HTML generation Date: Sun, 8 May 2022 14:09:46 +0200 Message-Id: <20220508120952.52-1-hofmann@leo-andres.de> X-Mailer: git-send-email 2.27.0.windows.1 MIME-Version: 1.0 X-Rspamd-Bar: - X-Rspamd-Report: R_MISSING_CHARSET(0.5) MIME_GOOD(-0.1) MID_CONTAINS_FROM(1) BAYES_HAM(-3) X-Rspamd-Score: -1.6 Received: from unknown (HELO unkown) (::1) by arche.uberspace.de (Haraka/2.8.28) with ESMTPSA; Sun, 08 May 2022 14:10:01 +0200 ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1652011804; a=rsa-sha256; cv=none; b=Tb1YFRJCdAnZiqiBa2QPNg+ONeCebnvRlyrnIAXB3AA9GD+RF1MFa/3Y1AeQ3IbG1z3yxk JTNpaMvYyXrr9ds7u18l4nswy5/em4BPeuXp0uJ4FmMkufgILVFoCXFKqEzoy2aCdXsjhX qjLgN5gneuswggcgcm/jZNugz0/QqzDnPF1XT8OKjQy3rUcT3Ecy6zVrqF909uN/bz3M5R xw2fcjTmo8o17Lg2xueya50XmqP9BoviX5WNA7FmfudOPweXPLKgC6d57eieWF/gzpw9B/ 2ACvscXN8ulzqDdLeo6VHQvP3nxwD/f/+RmjfGH44IJJvHNI049DmV7qWDT1hg== 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; bh=ZNRvAcAA9VQELXUF1ZtqEj5k7I5PVAxqJPxC5GX1MB4=; b=G38LYLkXxObkWv5DwOTnc28KFfkP2rtGG5nKXVkjMZoXThSScaGgGXlMADOeOMxQdUDqjS wlR1iQLU2Kvp5SQMmSvcaA+WoMhvQBdEJohxQKqeFxGgTKLEH0Xf/iQmj9Tgf/TpsnpCbx MI+b4s/R7QftStx2T+WSWqrsvqZ3vjHa6J8vwRzMPzyHdr6Dw1hnyl8JH75rVW1B6q0cej mPrrMxmVpTEWT4sSatdStJu5MtKR21hzVckBglOk6aHEiwB5RP0QAeMtlV7Ru/4w+SnbU8 126r0jps3k2j7+Yr5GZqxzQfoXxUPzGC/ORf7EVyFtaw+kLDk/2LsRvN6oA2Iw== X-Rspamd-Queue-Id: 4Kx35l6GCgznj X-Rspamd-Server: mail01.haj.ipfire.org X-Spamd-Result: default: False [-2.45 / 11.00]; BAYES_HAM(-1.87)[94.26%]; 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]; MIME_GOOD(-0.10)[text/plain]; IP_REPUTATION_HAM(-0.01)[asn: 205766(0.00), country: DE(-0.01), ip: 185.26.156.147(0.00)]; RCPT_COUNT_ONE(0.00)[1]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:205766, ipnet:185.26.156.0/24, country:DE]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1]; ARC_NA(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[185.26.156.147:from]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_NONE(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(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" Move most of the command execution away from the HTML output. This makes it easier to modify or extend individual commands. Also load Pakfire settings earlier to ensure that they are available during command execution. Signed-off-by: Leo-Andres Hofmann Acked-by: Peter Müller --- html/cgi-bin/pakfire.cgi | 61 +++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi index 65c67fb90..b908ec6a0 100644 --- a/html/cgi-bin/pakfire.cgi +++ b/html/cgi-bin/pakfire.cgi @@ -39,11 +39,12 @@ my %mainsettings = (); # Load general settings &General::readhash("${General::swroot}/main/settings", \%mainsettings); +&General::readhash("${General::swroot}/pakfire/settings", \%pakfiresettings); &General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color); # Get CGI request data $cgiparams{'ACTION'} = ''; -$cgiparams{'VALID'} = ''; +$cgiparams{'FORCE'} = ''; $cgiparams{'INSPAKS'} = ''; $cgiparams{'DELPAKS'} = ''; @@ -94,6 +95,35 @@ if($cgiparams{'ACTION'} eq 'json-getstatus') { exit; } +### Process Pakfire install/update commands ### +if(($cgiparams{'ACTION'} ne '') && (! &_is_pakfire_busy())) { + if(($cgiparams{'ACTION'} eq 'install') && ($cgiparams{'FORCE'} eq 'on')) { + my @pkgs = split(/\|/, $cgiparams{'INSPAKS'}); + &General::system_background("/usr/local/bin/pakfire", "install", "--non-interactive", "--no-colors", @pkgs); + } elsif(($cgiparams{'ACTION'} eq 'remove') && ($cgiparams{'FORCE'} eq 'on')) { + my @pkgs = split(/\|/, $cgiparams{'DELPAKS'}); + &General::system_background("/usr/local/bin/pakfire", "remove", "--non-interactive", "--no-colors", @pkgs); + } elsif($cgiparams{'ACTION'} eq 'update') { + &General::system_background("/usr/local/bin/pakfire", "update", "--force", "--no-colors"); + } elsif($cgiparams{'ACTION'} eq 'upgrade') { + &General::system_background("/usr/local/bin/pakfire", "upgrade", "-y", "--no-colors"); + } elsif($cgiparams{'ACTION'} eq $Lang::tr{'save'}) { + $pakfiresettings{"TREE"} = $cgiparams{"TREE"}; + + # Check for valid input + if ($pakfiresettings{"TREE"} !~ m/^(stable|testing|unstable)$/) { + $errormessage .= $Lang::tr{'pakfire invalid tree'}; + } + + unless ($errormessage) { + &General::writehash("${General::swroot}/pakfire/settings", \%pakfiresettings); + + # Update lists + &General::system_background("/usr/local/bin/pakfire", "update", "--force", "--no-colors"); + } + } +} + ### Start pakfire page ### &Header::showhttpheaders(); @@ -185,9 +215,6 @@ END # Process Pakfire commands if (($cgiparams{'ACTION'} eq 'install') && (! &_is_pakfire_busy())) { my @pkgs = split(/\|/, $cgiparams{'INSPAKS'}); - if ("$cgiparams{'FORCE'}" eq "on") { - &General::system_background("/usr/local/bin/pakfire", "install", "--non-interactive", "--no-colors", @pkgs); - } else { &Header::openbox("100%", "center", $Lang::tr{'request'}); my @output = &General::system_output("/usr/local/bin/pakfire", "resolvedeps", "--no-colors", @pkgs); print < X-Patchwork-Id: 5594 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 4Kx3602WlCz3x1v for ; Sun, 8 May 2022 12:10:16 +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 4Kx35v22tLz5n2; Sun, 8 May 2022 12:10:11 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Kx35t5Tn8z302h; 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 4Kx35s6sBSz2xZP 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 4Kx35m5r4mz2gW for ; Sun, 8 May 2022 12:10:04 +0000 (UTC) Received: (qmail 30312 invoked by uid 990); 8 May 2022 12:10:02 -0000 From: Leo-Andres Hofmann To: development@lists.ipfire.org Subject: [PATCH 2/7] pakfire.cgi: Fix indentation Date: Sun, 8 May 2022 14:09:47 +0200 Message-Id: <20220508120952.52-2-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:02 +0200 ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1652011804; a=rsa-sha256; cv=none; b=kptNw2hOq3SVEqJbphZof4SIjWGRpNodbqkibyBYHbRGcFM3Bf+I+YuzMgKbp8uNre9ndB mqZ7XVRo3mQ8OrjHFhLPTm8kTrDvVsIuY3xQXJRcIKfiQZOBI4lsinpGTCvgT97QfOemZ5 qbLuLy4ywlzx+2uUzhoVLwXx3wPFdxJSZCEuIcJPJfmn2gkqJ+1KwINGYbGIwVN/GTF1by nzZBagiMQMI2a9Cf1dAQ0rIF3Rov7hjf7pmDS6ebkrXkW0YeJQZq1EodOoD9XDoftGwHDG aDRkTk3WW/iZ8rbSLS1SFok/UEX4sV/ONSbKhfI0YoabUnojv54kAjlZHb0k4w== 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=2GmuPaCISIDwKJr1GayhCFTtxiT970DfFhwpx6D38PA=; b=tlHWVILEspJZELh/o5OaGzz8A5SjUmkLikVR5S+1qA2tl8EfqqI+X57Tp6k+ZRnNMel1L3 +hua9Q9GF++kXTxZAJ9Ya5BwWTjGRtiyx2Sdfej3YFaJCz7pKcn2t7v6P96xBScZQvP3d0 CfleeHt20+yV6kh089b+Pad5EWjMDLD8BMUi0r2orIxYaxPKyk66Z513PnADknHzxXLtX8 CX6/aqQ2gyZxciI0KR4Pvoz2RJfw0q4asDaq8B6Urs8RnsLBJpS6OOOzbbNbqoDNNFokGs oc0SCjKogRRJenix7WJSPXFRLBAEImygLKNwseNDCCiloGzelp+YHIrTEiaBEg== X-Rspamd-Queue-Id: 4Kx35m5r4mz2gW X-Rspamd-Server: mail01.haj.ipfire.org X-Spamd-Result: default: False [-3.28 / 11.00]; BAYES_HAM(-3.00)[99.98%]; 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" Signed-off-by: Leo-Andres Hofmann Acked-by: Peter Müller --- html/cgi-bin/pakfire.cgi | 111 ++++++++++++++++++++------------------- 1 file changed, 56 insertions(+), 55 deletions(-) diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi index b908ec6a0..535168547 100644 --- a/html/cgi-bin/pakfire.cgi +++ b/html/cgi-bin/pakfire.cgi @@ -214,79 +214,80 @@ END # Process Pakfire commands if (($cgiparams{'ACTION'} eq 'install') && (! &_is_pakfire_busy())) { + &Header::openbox("100%", "center", $Lang::tr{'request'}); + my @pkgs = split(/\|/, $cgiparams{'INSPAKS'}); - &Header::openbox("100%", "center", $Lang::tr{'request'}); - my @output = &General::system_output("/usr/local/bin/pakfire", "resolvedeps", "--no-colors", @pkgs); - print <$Lang::tr{'pakfire install package'} @pkgs $Lang::tr{'pakfire possible dependency'} + my @output = &General::system_output("/usr/local/bin/pakfire", "resolvedeps", "--no-colors", @pkgs); + print <$Lang::tr{'pakfire install package'} @pkgs $Lang::tr{'pakfire possible dependency'}
 END
-		foreach (@output) {
-		  $_ =~ s/\\[[0-1]\;[0-9]+m//g;
-			print "$_\n";
-		}
-		print <
 		$Lang::tr{'pakfire accept all'}
 		 
 		
- - - - -
- - -
- - -
- - - + + + + + + + +
+ + +
+ + + END - &Header::closebox(); - &Header::closebigbox(); - &Header::closepage(); - exit; + &Header::closebox(); + &Header::closebigbox(); + &Header::closepage(); + exit; } elsif (($cgiparams{'ACTION'} eq 'remove') && (! &_is_pakfire_busy())) { + &Header::openbox("100%", "center", $Lang::tr{'request'}); + my @pkgs = split(/\|/, $cgiparams{'DELPAKS'}); - &Header::openbox("100%", "center", $Lang::tr{'request'}); - my @output = &General::system_output("/usr/local/bin/pakfire", "resolvedeps", "--no-colors", @pkgs); - print <$Lang::tr{'pakfire uninstall package'} @pkgs $Lang::tr{'pakfire possible dependency'} + my @output = &General::system_output("/usr/local/bin/pakfire", "resolvedeps", "--no-colors", @pkgs); + print <$Lang::tr{'pakfire uninstall package'} @pkgs $Lang::tr{'pakfire possible dependency'}
 END
-		foreach (@output) {
-		  $_ =~ s/\\[[0-1]\;[0-9]+m//g;
-			print "$_\n";
-		}
-		print <
 		$Lang::tr{'pakfire uninstall all'}
 		 
 		
- - - - -
- - -
- - -
- - - + + + + + + + +
+ + +
+ + + END - &Header::closebox(); - &Header::closebigbox(); - &Header::closepage(); - exit; - + &Header::closebox(); + &Header::closebigbox(); + &Header::closepage(); + exit; } my %selected=(); 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");

From patchwork Sun May  8 12:09:49 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: 5595
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 4Kx3613qs4z3xqn
	for ; Sun,  8 May 2022 12:10:17 +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 4Kx35v2hg0z5nH;
	Sun,  8 May 2022 12:10:11 +0000 (UTC)
Received: from mail02.haj.ipfire.org (localhost [127.0.0.1])
	by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Kx35t5r4tz302q;
	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 4Kx35s6ydYz2xqv
 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 4Kx35m63t2z5S6
 for ; Sun,  8 May 2022 12:10:04 +0000 (UTC)
Received: (qmail 30335 invoked by uid 990); 8 May 2022 12:10:04 -0000
From: Leo-Andres Hofmann 
To: development@lists.ipfire.org
Subject: [PATCH 4/7] pakfire.cgi: Notify user if Pakfire is already performing
 a task
Date: Sun,  8 May 2022 14:09:49 +0200
Message-Id: <20220508120952.52-4-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: MIME_GOOD(-0.1) MID_CONTAINS_FROM(1) BAYES_HAM(-3)
X-Rspamd-Score: -2.1
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=BNLxsPln2rFfwP2yR210OUtFDQn14gCtFpVufCu0X27vDpz2n6SF04KfbWL8DdslB9Ssc2
 yVmTahxpt4txdi6Irsc64asud6H35bKxmrWIl14/PQXWPBY/C9aoJR6OwzzzuiMwbelIRJ
 V9rajSUZoS/h+JVqxdZhI7mx/orjs12zxIls9h0e+C3bWu1lYgbP92yDKQTpUGyYNnjE4p
 h2lKkwCiz2x/CFKwjPjySB7rY1W2DjXMpNWgoAN9HlRJz1r94wy8r4cGOLc56gea+enPiF
 I0vMwD/rMxQ80nBpUKJ9zX0vWsl1uMo1lnFdVcqBHmde7a9F0OnGIhe7tLLgXQ==
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-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=o3W8/U3rC/aLaZ4xFQom/RIOl4DRP3AGkLRNsOdxGNc=;
 b=RJ6mOGz99sLE0vtu3AYi5hoqe8uPoygC8HyxtMId2I8T3VH+VvFKOlEM8euarhHac3SzQJ
 yy2YQ3sIRjmogf2L+0CmU287KLE7tjH2g/c3HdN5kvgwfeHM23r3SQwX1b3DpCGoGnJ/pD
 3ZT/epXok4uMgQ4v7HfPnOqDxoDcTy3NHiLosnhCVSw4F5ypr7BIcN+FFpL+Tze0a9ZtC4
 6u74N3UWA3qEAxFUcAJV0XPkCkOfAbde91hdjKVszYrSv/NPW5ACpY6Ysujm/9QYoMkExU
 Zq6Rh9dwYbO7L9eoEIzGrTE4/GBdP8aajiRCB5XAU1upSzWHkrMY8UhNLCSQLQ==
X-Rspamd-Queue-Id: 4Kx35m63t2z5S6
X-Rspamd-Server: mail01.haj.ipfire.org
X-Spamd-Result: default: False [-4.08 / 11.00]; BAYES_HAM(-3.00)[99.99%];
 MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM(-1.00)[-1.000];
 SPF_REPUTATION_HAM(-0.77)[-0.77342682734463];
 MX_INVALID(0.50)[];
 DMARC_POLICY_ALLOW(-0.50)[leo-andres.de,quarantine];
 R_SPF_ALLOW(-0.20)[+mx:c]; MIME_GOOD(-0.10)[text/plain];
 IP_REPUTATION_HAM(-0.01)[asn: 205766(0.00), country: DE(-0.01), ip:
 185.26.156.147(0.00)];
 ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1];
 R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[];
 MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2];
 ASN(0.00)[asn:205766, ipnet:185.26.156.0/24, country:DE];
 TO_DN_NONE(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[];
 FROM_HAS_DN(0.00)[]; RCPT_COUNT_ONE(0.00)[1];
 RCVD_IN_DNSWL_NONE(0.00)[185.26.156.147:from];
 RCVD_TLS_ALL(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[];
 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" 

Signed-off-by: Leo-Andres Hofmann 
Acked-by: Peter Müller 
---
 html/cgi-bin/pakfire.cgi | 6 ++++--
 langs/de/cgi-bin/de.pl   | 1 +
 langs/en/cgi-bin/en.pl   | 1 +
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi
index daa82e34c..ec3ee2cc6 100644
--- a/html/cgi-bin/pakfire.cgi
+++ b/html/cgi-bin/pakfire.cgi
@@ -96,8 +96,10 @@ if($cgiparams{'ACTION'} eq 'json-getstatus') {
 }
 
 ### Process Pakfire install/update commands ###
-if(($cgiparams{'ACTION'} ne '') && (! &_is_pakfire_busy())) {
-	if(($cgiparams{'ACTION'} eq 'install') && ($cgiparams{'FORCE'} eq 'on')) {
+if($cgiparams{'ACTION'} ne '') {
+	if(&_is_pakfire_busy()) {
+		$errormessage = $Lang::tr{'pakfire already busy'};
+	} elsif(($cgiparams{'ACTION'} eq 'install') && ($cgiparams{'FORCE'} eq 'on')) {
 		my @pkgs = split(/\|/, $cgiparams{'INSPAKS'});
 		&General::system_background("/usr/local/bin/pakfire", "install", "--non-interactive", "--no-colors", @pkgs);
 	} elsif(($cgiparams{'ACTION'} eq 'remove') && ($cgiparams{'FORCE'} eq 'on')) {
diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl
index a841b39f9..7a39e233b 100644
--- a/langs/de/cgi-bin/de.pl
+++ b/langs/de/cgi-bin/de.pl
@@ -1990,6 +1990,7 @@
 'pagerefresh' => 'Seite wird aktualisiert. Bitte warten.',
 'pakfire accept all' => 'Möchten Sie der Installation aller Pakete zustimmen?',
 'pakfire ago' => 'her.',
+'pakfire already busy' => 'Pakfire führt bereits eine Aufgabe aus. Bitte versuchen Sie es später erneut.',
 'pakfire available addons' => 'Verfügbare Addons:',
 'pakfire configuration' => 'Pakfire Konfiguration',
 'pakfire core update auto' => 'Core- und Addon-Updates automatisch installieren:',
diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl
index e30ee4f69..f90e3103b 100644
--- a/langs/en/cgi-bin/en.pl
+++ b/langs/en/cgi-bin/en.pl
@@ -2041,6 +2041,7 @@
 'pagerefresh' => 'Page is beeing refreshed, please wait.',
 'pakfire accept all' => 'Do you want to install all packages?',
 'pakfire ago' => 'ago.',
+'pakfire already busy' => 'Pakfire is already performing a task. Please try again later.',
 'pakfire available addons' => 'Available Addons:',
 'pakfire configuration' => 'Pakfire Configuration',
 'pakfire core update auto' => 'Install core and addon updates automatically:',

From patchwork Sun May  8 12:09:50 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: 5598
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 4Kx3673cn3z3x1v
	for ; Sun,  8 May 2022 12:10:23 +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 4Kx3601C3Xznj;
	Sun,  8 May 2022 12:10:16 +0000 (UTC)
Received: from mail02.haj.ipfire.org (localhost [127.0.0.1])
	by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Kx3600pD7z2yRl;
	Sun,  8 May 2022 12:10:16 +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 4Kx35x3Hq6z2xfn
 for ; Sun,  8 May 2022 12:10:13 +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 4Kx35q0BnSz5X5
 for ; Sun,  8 May 2022 12:10:06 +0000 (UTC)
Received: (qmail 30343 invoked by uid 990); 8 May 2022 12:10:04 -0000
From: Leo-Andres Hofmann 
To: development@lists.ipfire.org
Subject: [PATCH 5/7] pakfire.cgi: Implement Post/Redirect/Get pattern
Date: Sun,  8 May 2022 14:09:50 +0200
Message-Id: <20220508120952.52-5-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) MIME_GOOD(-0.1) MID_CONTAINS_FROM(1)
 BAYES_HAM(-3)
X-Rspamd-Score: -1.6
Received: from unknown (HELO unkown) (::1)
 by arche.uberspace.de (Haraka/2.8.28) with ESMTPSA;
 Sun, 08 May 2022 14:10:04 +0200
ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1652011807; a=rsa-sha256;
 cv=none;
 b=VY/QLraBiAdfjjiwGo/yshQStW2N6YnAjYj9ZWtymwxwk7kAmN2QemfG1Ak0TwqKfmakmH
 JatIO9OadQLtQXxElJybOExdpvdZcmPUNgMWI0h/DoGVkC4WSvUE8SCUhL33X0RzobQqzP
 Am7BP4DIJxBgT1tn9Oix7UvguBxe112tXt1SNuqKtVonpdLHDqteHje9dM9aEzVoh+E+vb
 es3bHDfR8FoNXkckrUKMcxV1llwoI3oov5vewW/08gvHRpmZ8Ogn2bEopQvU7shSQfTq3I
 frH+BDag5WLneFOmYL3jAbMGlOr06VmAgUELCfkerJuik4pMp8bprlTzZmUHAw==
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=1652011807;
 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=zmtTYADReqyqVq6GAPupLiY3GVEAH0dITM5Cmw1KTyw=;
 b=vaRkO0dF30cuFRxXC9i/wu2FdNr8uKkX4RsyAxY35cQaTPSXlRK6mFptIVBFcoS8bWQDMA
 l/9zF//kemYUPyUErrGco6LAh14xQ6inoG5LRmWWy05yGqmCbdPPRNrcBJDck0y+D5Ohv0
 2PEDKSepm7wnC78aN4UMDY5cRhYrM+RwkLHD1Ya8S/4pMsd1X8zP5GCYgoyQvDjjI1p/eR
 SbnQ0yDXfutix5XMONaduroMwyeghgBvi/ReL9hdhQtQbyeLv3F+MneYCBcBa5S5mezMvT
 Ghc/aLI3KXaSOlYchNpADhcTESW2urLZq1PsH5EVc0yVZDLFY6vlz4Zs0fCxRA==
X-Rspamd-Queue-Id: 4Kx35q0BnSz5X5
X-Rspamd-Server: mail01.haj.ipfire.org
X-Spamd-Result: default: False [-0.58 / 11.00]; MID_CONTAINS_FROM(1.00)[];
 NEURAL_HAM(-1.00)[-1.000];
 SPF_REPUTATION_HAM(-0.77)[-0.77342682734463];
 R_MISSING_CHARSET(0.50)[]; MX_INVALID(0.50)[];
 DMARC_POLICY_ALLOW(-0.50)[leo-andres.de,quarantine];
 R_SPF_ALLOW(-0.20)[+mx:c]; MIME_GOOD(-0.10)[text/plain];
 IP_REPUTATION_HAM(-0.01)[asn: 205766(0.00), country: DE(-0.01), ip:
 185.26.156.147(0.00)]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[];
 MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[];
 ASN(0.00)[asn:205766, ipnet:185.26.156.0/24, country:DE];
 RCVD_IN_DNSWL_NONE(0.00)[185.26.156.147:from];
 TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_ONE(0.00)[1];
 RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_TWO(0.00)[2];
 FROM_HAS_DN(0.00)[];
 ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1];
 TO_DN_NONE(0.00)[]; RCVD_TLS_ALL(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" 

Refreshing the Pakfire page may cause a command to be
executed multiple times and induce odd errors.

This patch implements a HTTP 303 redirect after form processing,
which causes the browser to discard the POST form data.
Navigating backward or reloading the page now does not trigger
multiple executions anymore.

Fixes: #12781

Signed-off-by: Leo-Andres Hofmann 
Acked-by: Peter Müller 
---
 html/cgi-bin/pakfire.cgi | 56 +++++++++++++++++++++++++++++++++++-----
 1 file changed, 50 insertions(+), 6 deletions(-)

diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi
index ec3ee2cc6..6fade81bd 100644
--- a/html/cgi-bin/pakfire.cgi
+++ b/html/cgi-bin/pakfire.cgi
@@ -21,6 +21,7 @@
 
 use strict;
 use List::Util qw(any);
+use URI;
 
 # enable only the following on debugging purpose
 #use warnings;
@@ -37,12 +38,17 @@ my %color = ();
 my %pakfiresettings = ();
 my %mainsettings = ();
 
+# The page mode is used to explictly switch between user interface functions:
+my $PM_DEFAULT = 'default'; # Default user interface with command processing
+my $PM_LOGREAD = 'logread'; # Log messages viewer (ignores all commands)
+my $pagemode = $PM_DEFAULT;
+
 # Load general settings
 &General::readhash("${General::swroot}/main/settings", \%mainsettings);
 &General::readhash("${General::swroot}/pakfire/settings", \%pakfiresettings);
 &General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color);
 
-# Get CGI request data
+# Get CGI POST request data
 $cgiparams{'ACTION'} = '';
 $cgiparams{'FORCE'} = '';
 
@@ -51,6 +57,17 @@ $cgiparams{'DELPAKS'} = '';
 
 &Header::getcgihash(\%cgiparams);
 
+# Get CGI GET request data (if available)
+if($ENV{'QUERY_STRING'}) {
+	my $uri = URI->new($ENV{'REQUEST_URI'});
+	my %query = $uri->query_form;
+
+	my $mode = lc($query{'mode'} // '');
+	if(($mode eq $PM_DEFAULT) || ($mode eq $PM_LOGREAD)) {
+		$pagemode = $mode; # Limit to existing modes
+	}
+}
+
 ### Process AJAX/JSON request ###
 if($cgiparams{'ACTION'} eq 'json-getstatus') {
 	# Send HTTP headers
@@ -96,19 +113,24 @@ if($cgiparams{'ACTION'} eq 'json-getstatus') {
 }
 
 ### Process Pakfire install/update commands ###
-if($cgiparams{'ACTION'} ne '') {
+if(($cgiparams{'ACTION'} ne '') && ($pagemode eq $PM_DEFAULT)) {
 	if(&_is_pakfire_busy()) {
 		$errormessage = $Lang::tr{'pakfire already busy'};
+		$pagemode = $PM_LOGREAD; # Running Pakfire instance found, switch to log viewer mode
 	} elsif(($cgiparams{'ACTION'} eq 'install') && ($cgiparams{'FORCE'} eq 'on')) {
 		my @pkgs = split(/\|/, $cgiparams{'INSPAKS'});
 		&General::system_background("/usr/local/bin/pakfire", "install", "--non-interactive", "--no-colors", @pkgs);
+		&_http_pagemode_redirect($PM_LOGREAD, 1);
 	} elsif(($cgiparams{'ACTION'} eq 'remove') && ($cgiparams{'FORCE'} eq 'on')) {
 		my @pkgs = split(/\|/, $cgiparams{'DELPAKS'});
 		&General::system_background("/usr/local/bin/pakfire", "remove", "--non-interactive", "--no-colors", @pkgs);
+		&_http_pagemode_redirect($PM_LOGREAD, 1);
 	} elsif($cgiparams{'ACTION'} eq 'update') {
 		&General::system_background("/usr/local/bin/pakfire", "update", "--force", "--no-colors");
+		&_http_pagemode_redirect($PM_LOGREAD, 1);
 	} elsif($cgiparams{'ACTION'} eq 'upgrade') {
 		&General::system_background("/usr/local/bin/pakfire", "upgrade", "-y", "--no-colors");
+		&_http_pagemode_redirect($PM_LOGREAD, 1);
 	} elsif($cgiparams{'ACTION'} eq $Lang::tr{'save'}) {
 		$pakfiresettings{"TREE"} = $cgiparams{"TREE"};
 
@@ -122,6 +144,7 @@ if($cgiparams{'ACTION'} ne '') {
 
 			# Update lists
 			&General::system_background("/usr/local/bin/pakfire", "update", "--force", "--no-colors");
+			&_http_pagemode_redirect($PM_LOGREAD, 1);
 		}
 	}
 }
@@ -221,8 +244,8 @@ if ($errormessage) {
 	&Header::closebox();
 }
 
-# Show log output while Pakfire is running
-if(&_is_pakfire_busy()) {
+# Show only log output while Pakfire is running and stop afterwards
+if(($pagemode eq $PM_LOGREAD) || (&_is_pakfire_busy())) {
 	&Header::openbox("100%", "center", "Pakfire");
 
 	print <
X-Patchwork-Id: 5597
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 4Kx36552Cpz3xqn
	for ; Sun,  8 May 2022 12:10:21 +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 4Kx35y0k1Dz5l9;
	Sun,  8 May 2022 12:10:14 +0000 (UTC)
Received: from mail02.haj.ipfire.org (localhost [127.0.0.1])
	by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Kx35y0Mp9z2yfm;
	Sun,  8 May 2022 12:10:14 +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 4Kx35x2VNjz2x9j
 for ; Sun,  8 May 2022 12:10:13 +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 4Kx35p4hrSz5VR
 for ; Sun,  8 May 2022 12:10:06 +0000 (UTC)
Received: (qmail 30370 invoked by uid 990); 8 May 2022 12:10:05 -0000
From: Leo-Andres Hofmann 
To: development@lists.ipfire.org
Subject: [PATCH 6/7] pakfire.cgi: Discard tac stderr output
Date: Sun,  8 May 2022 14:09:51 +0200
Message-Id: <20220508120952.52-6-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) MIME_GOOD(-0.1) MID_CONTAINS_FROM(1)
 BAYES_HAM(-2.999999)
X-Rspamd-Score: -1.599999
Received: from unknown (HELO unkown) (::1)
 by arche.uberspace.de (Haraka/2.8.28) with ESMTPSA;
 Sun, 08 May 2022 14:10:05 +0200
ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1652011806; a=rsa-sha256;
 cv=none;
 b=RRfWVVM5Jact6aJgdE8thEFyCKcVjDn9pfeIxzvJI7EauYiqlkNvnWQsH1S7a/jm3ynpIa
 1cCkUlQBP5xfmaK1WvllXE5B19ehBlkH4hzqnaangzoJ14OWDxaoYkZhO5AniOA0uf7M9g
 4u5lkQJmqZPZSOREumqnF7O3H6Cba+/xTiOEzzjUpqjASGNZJJZCfuvN12/HSuib9L/kh8
 xTvEoYpBRXXD13/Gk5o3LXHCQQSeRdXro2JuKhv+xwYyy9Hg+1bciqxz2LWAvqv90GjBJs
 pkeZlcivyOqnASl6f0MLccAeKvUaIW2XyITza0Tur8Fi0NEcVvOVemb5os4g1w==
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=1652011806;
 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=cUAXnsp0WCV5dtMEIWJ7+R6IG18AXO/AHg7YAGyO4Hw=;
 b=E7teHDjMbaAY41mTaSg/0yaa8soF07r7ZZw3VTQllr8YNKr+zgmPR6WwssiK9RMlm3G+KW
 h2agRBuki5SrGli/gybXfcKEPYj3/+/bBG2ENYw0amoa1U5bal9Rs4mDi1iYbH4UKy1p/v
 IVvZNlpd1fLBNLYWxonKoAWkdFkaT7H+OXC7/7RK/bCWPtyC8znxPilP0wcxdi/iB43y+R
 ht6xKHwMIjAXjTE+sNk7Gzt7Nc6Bdlu7dSQsrwXOMpua6f8Occf4YXbYMWDesjmlzNkP9x
 2Ujw+9MByuoGcRs3gVrTd5vGgcn5AGbmU/YzIvBdhpkCoOnEJx0FhZztSuvIaQ==
X-Rspamd-Queue-Id: 4Kx35p4hrSz5VR
X-Rspamd-Server: mail01.haj.ipfire.org
X-Spamd-Result: default: False [-3.58 / 11.00]; BAYES_HAM(-3.00)[99.99%];
 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_GOOD(-0.10)[text/plain];
 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:+];
 ASN(0.00)[asn:205766, ipnet:185.26.156.0/24, country:DE];
 FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(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" 

Prevents meaningless "broken pipe" messages in the httpd error log.

Signed-off-by: Leo-Andres Hofmann 
Acked-by: Peter Müller 
---
 html/cgi-bin/pakfire.cgi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi
index 6fade81bd..489b07a6d 100644
--- a/html/cgi-bin/pakfire.cgi
+++ b/html/cgi-bin/pakfire.cgi
@@ -75,7 +75,7 @@ if($cgiparams{'ACTION'} eq 'json-getstatus') {
 
 	# Read /var/log/messages backwards until a "Pakfire started" header is found,
 	# to capture all messages of the last (i.e. current) Pakfire run
-	my @messages = `tac /var/log/messages | sed -n '/pakfire:/{p;/Pakfire.*started/q}'`;
+	my @messages = `tac /var/log/messages 2>/dev/null | sed -n '/pakfire:/{p;/Pakfire.*started/q}'`;
 
 	# Test if the log contains an error message (fastest implementation, stops at first match)
 	my $failure = any{ index($_, 'ERROR') != -1 } @messages;

From patchwork Sun May  8 12:09:52 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: 5596
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 4Kx3635LKdz3x1v
	for ; Sun,  8 May 2022 12:10:19 +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 4Kx35y028Kz5R3;
	Sun,  8 May 2022 12:10:14 +0000 (UTC)
Received: from mail02.haj.ipfire.org (localhost [127.0.0.1])
	by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Kx35x6h9vz2ySt;
	Sun,  8 May 2022 12:10:13 +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 4Kx35x11Yyz2x9j
 for ; Sun,  8 May 2022 12:10:13 +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 4Kx35p2Lq6zPq
 for ; Sun,  8 May 2022 12:10:06 +0000 (UTC)
Received: (qmail 30379 invoked by uid 990); 8 May 2022 12:10:05 -0000
From: Leo-Andres Hofmann 
To: development@lists.ipfire.org
Subject: [PATCH 7/7] pakfire.cgi: Cosmetic fixes
Date: Sun,  8 May 2022 14:09:52 +0200
Message-Id: <20220508120952.52-7-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: MID_CONTAINS_FROM(1) MIME_HTML_ONLY(0.2) BAYES_HAM(-3)
X-Rspamd-Score: -1.8
Received: from unknown (HELO unkown) (::1)
 by arche.uberspace.de (Haraka/2.8.28) with ESMTPSA;
 Sun, 08 May 2022 14:10:05 +0200
ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1652011806; a=rsa-sha256;
 cv=none;
 b=QhQjQsXQ/rjSqSbZB8C/hvdpTk2L2rHyqBrXRyazxs4PyBac6y8j39+OPr/Ckt/KqgHCdj
 mVjePT4Ps6Bzz5BDj8c+0HVlO5ByKuWyTKScyLZ/QUabkM63hd97MySJKCFoATxFKa6jn1
 f7+7jF50K1DZZCuxgVvmzRE9MK7gXjj0HTAI2evpFEkLmI3VXchX8MYjG+YSIEAwavDfAx
 oapEXHzXX52xcK51sFC8b+7LqeztK8U+3P65RWet1weZFgc09JayAbL4K54HsceBgH3XKJ
 tpo/+iUrIFhak66PNYPy14diYBWftvkYJviXuRWPQQJpLmW1ilTVpeZx9NSvKA==
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=1652011806;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=CYAgGz+rDSeWTCAHsWXNxxxTcMQIZJ58r8+pt/rf3ww=;
 b=C8uqB+6xdsfc4dQZ4dDu37dhNdvxbTvW0xb2Vw3dEQgiRhIcGwdh1kug9jufaNmABybtEG
 MAGst18Mjklm2rx/pQl0TVyAG3co35pz7gdIISBDc87IHXSonR0zKjlr08LE/DqXvT95WF
 hYdzJS28nKZFa+EJ5rrGd/tM2oiiZW+jdKhTRvh2dqwTuaw6aYpwsCE7uaXQ48EhnhbDjx
 oarYgyyDJkdTMWXkmTAWFTS9CixhdB6E6Fi1Ll5qlgjEW/DhqFn+biJXiJ1nOyU2/Qxqzb
 kV90vpZSAHCNMbKtJk3SaxKJfZZKDu5oGwyWQQdlCOGovKOoRhAMsysdhwq5tg==
X-Rspamd-Queue-Id: 4Kx35p2Lq6zPq
X-Rspamd-Server: mail01.haj.ipfire.org
X-Spamd-Result: default: False [-3.75 / 11.00]; BAYES_HAM(-2.97)[99.88%];
 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];
 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)]; MIME_TRACE(0.00)[0:~];
 RCVD_COUNT_TWO(0.00)[2];
 ASN(0.00)[asn:205766, ipnet:185.26.156.0/24, country:DE];
 FROM_EQ_ENVFROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[];
 R_DKIM_NA(0.00)[];
 RCVD_IN_DNSWL_NONE(0.00)[185.26.156.147:from];
 RCVD_TLS_ALL(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[];
 FROM_HAS_DN(0.00)[]; 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" 

Add formatting to improve readability of dependencies list header.

Signed-off-by: Leo-Andres Hofmann 
Acked-by: Peter Müller 
---
 html/cgi-bin/pakfire.cgi | 6 ++++--
 langs/fr/cgi-bin/fr.pl   | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi
index 489b07a6d..3e8dc5460 100644
--- a/html/cgi-bin/pakfire.cgi
+++ b/html/cgi-bin/pakfire.cgi
@@ -283,7 +283,8 @@ if (($cgiparams{'ACTION'} eq 'install') && ($pagemode eq $PM_DEFAULT)) {
 	my @pkgs = split(/\|/, $cgiparams{'INSPAKS'});
 	my @output = &General::system_output("/usr/local/bin/pakfire", "resolvedeps", "--no-colors", @pkgs);
 	print <$Lang::tr{'pakfire install package'} @pkgs $Lang::tr{'pakfire possible dependency'}
+	

$Lang::tr{'pakfire install package'} @{pkgs}
+ $Lang::tr{'pakfire possible dependency'}

 END
 	foreach (@output) {
@@ -321,7 +322,8 @@ END
 	my @pkgs = split(/\|/, $cgiparams{'DELPAKS'});
 	my @output = &General::system_output("/usr/local/bin/pakfire", "resolvedeps", "--no-colors", @pkgs);
 	print <
$Lang::tr{'pakfire uninstall package'} @pkgs $Lang::tr{'pakfire possible dependency'} +

$Lang::tr{'pakfire uninstall package'} @{pkgs}
+ $Lang::tr{'pakfire possible dependency'}

 END
 	foreach (@output) {
diff --git a/langs/fr/cgi-bin/fr.pl b/langs/fr/cgi-bin/fr.pl
index bd17df4ee..6dbeebc16 100644
--- a/langs/fr/cgi-bin/fr.pl
+++ b/langs/fr/cgi-bin/fr.pl
@@ -2055,7 +2055,7 @@
 'pakfire last package update' => 'Dernière mise à jour de la liste des paquets : ',
 'pakfire last serverlist update' => 'Dernière mise à jour de la liste des serveurs : ',
 'pakfire last update' => 'Dernière mise à jour : ',
-'pakfire possible dependency' => '

Il y a peut-être des dépendances, voici la liste des paquets qu\'il faut (dés)installer.
', +'pakfire possible dependency' => 'Il y a peut-être des dépendances, voici la liste des paquets qu\'il faut (dés)installer.', 'pakfire register' => 'S\'inscrire au serveur pakfire :', 'pakfire return' => 'Retour à Pakfire', 'pakfire system state' => 'Statut système PakFire ',