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:',