From patchwork Wed Feb 18 18:13:01 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 9523 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) (Client CN "mail01.haj.ipfire.org", Issuer "R12" (not verified)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4fGyPd0ng3z3wkD for ; Thu, 19 Feb 2026 15:45:09 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [IPv6:2001:678:b28::201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail02.haj.ipfire.org", Issuer "E7" (not verified)) by mail01.ipfire.org (Postfix) with ESMTPS id 4fGyPc40Cfz5ct for ; Thu, 19 Feb 2026 15:45:08 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [IPv6:::1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4fGyPV6f7Bz3625 for ; Thu, 19 Feb 2026 15:45:02 +0000 (UTC) X-Original-To: development@lists.ipfire.org Received: from mail01.ipfire.org (mail01.haj.ipfire.org [IPv6:2001:678:b28::25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail01.haj.ipfire.org", Issuer "R12" (not verified)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4fGyPR3ZnTz33td for ; Thu, 19 Feb 2026 15:44:59 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4fGPnr51r1z44Y; Wed, 18 Feb 2026 18:15:44 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1771438544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=0oAqBGD5JhI30kDpmKYC5ILFnCK4bjH1cA8QP80SG9s=; b=NHnMVogTAZ39PaNPS5V7nakMZzhSPYFfGrBgq6mkPkwCAtSuIbZwORSmwpphzEhddie7x/ C+z/XmH1zd7tIGCA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1771438544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=0oAqBGD5JhI30kDpmKYC5ILFnCK4bjH1cA8QP80SG9s=; b=F9GSrTd0Aj0Kam9gj5/9GzIObdGHxhV8ZZ2mgdC/5FWSbgtdsVoOwxHH3IB5i/ceCdRqvT H766HYyyAOrnSkDgfVmnmv23t+kUNaziprCexL+ZSTjTyC/Eg7K08QikFcIxsS8m8S/14b nCq9LKylWNVk2w0GuOvc+q7RoQvGCYMh8knesveNHzrdDsiAkQoKEJ12fgqr/dtZpuv6FW hbkXjlSKkI/XR+xSYIOVYOshecs2xpjAiMYzNixnBQKmBqnyncDBlKRUAaOLgp0AQUektH Pp+uj3nhmb/mA8THsHT14akAErkynSrgEc/IBVG4tiXbU+05Y9AhWRoJ1gzwwA== From: Stefan Schantl To: development@lists.ipfire.org Cc: Stefan Schantl Subject: [PATCH] general-functions.pl: Refactor GetCoreUpdateVersion function Date: Wed, 18 Feb 2026 19:13:01 +0100 Message-ID: <20260218181301.5922-1-stefan.schantl@ipfire.org> Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 There is no need for a loop when only grab the first line of a file which only has one line. Also remove the newline from the grabbed line, which may cause malfunctions on further processing. Signed-off-by: Stefan Schantl --- config/cfgroot/general-functions.pl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-functions.pl index 1c3374d86..bcc8942c3 100644 --- a/config/cfgroot/general-functions.pl +++ b/config/cfgroot/general-functions.pl @@ -1058,11 +1058,9 @@ sub GetCoreUpdateVersion() { my $core_update; open(FILE, "/opt/pakfire/db/core/mine"); - while () { - $core_update = $_; - last; - } + $core_update = ; close(FILE); + chomp($core_update); return $core_update; }