Hi Michael
Michael Tremer schreef op ma 21-03-2022 om 16:21 [+0000]:
This is a lot nicer without eval().
On 9 Mar 2022, at 22:56, Robin Roevens robin.roevens@disroot.org wrote:
Replace coreupdate_available code duplicating coredbinfo workings with call to actual coredbinfo function.
Signed-off-by: Robin Roevens robin.roevens@disroot.org
src/pakfire/lib/functions.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/pakfire/lib/functions.pl b/src/pakfire/lib/functions.pl index 0caa4787e..1e2729485 100644 --- a/src/pakfire/lib/functions.pl +++ b/src/pakfire/lib/functions.pl @@ -884,9 +884,10 @@ sub updates_available { }
sub coreupdate_available { - eval(`grep "core_" $Conf::dbdir/lists/core-list.db`); - if ("$core_release" > "$Conf::core_mine") { - return "yes ($core_release)"; + my %coredb = &Pakfire::coredbinfo();
+ if ("$coredb{'AvailableRelease'}" > "$coredb{'Release'}") { + return "yes ($coredb{'AvailableRelease'})"; } else { return "no";
Is returning a string what we want here?
Valid question.. I will look into it. In the light of moving UI out of the library functions that would certainly be the right thing to do (not returning strings here).
-- 2.34.1
-- Dit bericht is gescanned op virussen en andere gevaarlijke inhoud door MailScanner en lijkt schoon te zijn.