public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Adolf Belka <adolf.belka@ipfire.org>
To: development@lists.ipfire.org
Cc: Adolf Belka <adolf.belka@ipfire.org>
Subject: [PATCH] libloc: Fix bug14047 - return 3 when database is latest version
Date: Sat, 12 Sep 2026 12:34:17 +0200	[thread overview]
Message-ID: <20260912103417.14444-1-adolf.belka@ipfire.org> (raw)

- Currently libloc returns 0 when the database is the current version. Tha man page says
   it should return 3. The reason is that the return for that check is on its own so it
   defaults to returning 0.
- This patch makes it return 3.
- Fix has been confirmed to return 3 on my vm testbed system.
- A separate patch will be submitted that adds the fix to location.in in the libloc repo
   so that a future update version of libloc will include this fix and the patch in this
   submission can then be removed.

Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Fixes: bug14047
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
---
 lfs/libloc                                            |  3 ++-
 ....19-Return_3_when_database_is_latest_version.patch | 11 +++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 src/patches/libloc-0.9.19-Return_3_when_database_is_latest_version.patch

diff --git a/lfs/libloc b/lfs/libloc
index 5aee8813f..bfa0234d2 100644
--- a/lfs/libloc
+++ b/lfs/libloc
@@ -1,7 +1,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007-2025  IPFire Team  <info@ipfire.org>                     #
+# Copyright (C) 2007-2026  IPFire Team  <info@ipfire.org>                     #
 #                                                                             #
 # This program is free software: you can redistribute it and/or modify        #
 # it under the terms of the GNU General Public License as published by        #
@@ -81,6 +81,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
 
 	# https://lists.ipfire.org/pipermail/development/2022-November/014763.html
 	cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/libloc-0.9.18-Revert-Install-Perl-files-to-Perl-vendor-directory.patch
+	cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/libloc-0.9.19-Return_3_when_database_is_latest_version.patch
 	cd $(DIR_APP) && ./autogen.sh
 	cd $(DIR_APP) && ./configure \
 			--prefix=/usr \
diff --git a/src/patches/libloc-0.9.19-Return_3_when_database_is_latest_version.patch b/src/patches/libloc-0.9.19-Return_3_when_database_is_latest_version.patch
new file mode 100644
index 000000000..4ebd84c10
--- /dev/null
+++ b/src/patches/libloc-0.9.19-Return_3_when_database_is_latest_version.patch
@@ -0,0 +1,11 @@
+--- libloc-0.9.19/src/scripts/location.in.orig	2026-06-02 16:41:25.000000000 +0200
++++ libloc-0.9.19/src/scripts/location.in	2026-09-10 16:00:33.706282553 +0200
+@@ -468,7 +468,7 @@
+ 		# Check the version of the local database
+ 		if db and t and db.created_at >= t:
+ 			log.info("Already on the latest version")
+-			return
++			return 3
+ 
+ 		# Download the database into the correct directory
+ 		tmpdir = os.path.dirname(ns.database)
-- 
2.55.0



                 reply	other threads:[~2026-09-12 10:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260912103417.14444-1-adolf.belka@ipfire.org \
    --to=adolf.belka@ipfire.org \
    --cc=development@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox