From: Stefan Schantl Date: Wed, 18 Feb 2026 18:13:01 +0000 (+0100) Subject: general-functions.pl: Refactor GetCoreUpdateVersion function X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7c80e81f64653148b834a137cb08043ef021a8a;p=ipfire-2.x.git general-functions.pl: Refactor GetCoreUpdateVersion function 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 Signed-off-by: Michael Tremer --- 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; }