public inbox for ipfire-scm@lists.ipfire.org
 help / color / mirror / Atom feed
From: Arne Fitzenreiter <git@ipfire.org>
To: ipfire-scm@lists.ipfire.org
Subject: [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 99659ce50b2a693217d674b380af6ffdac191832
Date: Wed, 29 Jul 2020 17:18:28 +0000	[thread overview]
Message-ID: <4BH0ch3Z2Wz2xld@people01.haj.ipfire.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 3944 bytes --]

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".

The branch, next has been updated
       via  99659ce50b2a693217d674b380af6ffdac191832 (commit)
      from  18f05104294c0c4b951e8208ebb0640ed7900f41 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 99659ce50b2a693217d674b380af6ffdac191832
Author: Stefan Schantl <stefan.schantl(a)ipfire.org>
Date:   Wed Jul 29 18:57:43 2020 +0200

    libloc: Only update database once a week
    
    Ensure to download and update the database only once a week, even the
    script will be called by cron each hour.
    
    Fixes #12462.
    
    Signed-off-by: Stefan Schantl <stefan.schantl(a)ipfire.org>
    Signed-off-by: Arne Fitzenreiter <arne_f(a)ipfire.org>

-----------------------------------------------------------------------

Summary of changes:
 lfs/libloc                                         |  1 +
 ...libloc-0.9.3-location-provide-return-code.patch | 22 ++++++++++++++++++++++
 src/scripts/update-location-database               |  4 +++-
 3 files changed, 26 insertions(+), 1 deletion(-)
 create mode 100644 src/patches/libloc-0.9.3-location-provide-return-code.patch

Difference in files:
diff --git a/lfs/libloc b/lfs/libloc
index a71a9ac5b..12bc52ca4 100644
--- a/lfs/libloc
+++ b/lfs/libloc
@@ -80,6 +80,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
 
 	# Apply upstream patches
 	cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/libloc-0.9.3-country-terminate-buffer-when-reading-from-database.patch
+	cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/libloc-0.9.3-location-provide-return-code.patch
 
 	# Add patch for i586 to disable strong stack protector.
 ifeq "$(BUILD_ARCH)" "i586"
diff --git a/src/patches/libloc-0.9.3-location-provide-return-code.patch b/src/patches/libloc-0.9.3-location-provide-return-code.patch
new file mode 100644
index 000000000..2382145c3
--- /dev/null
+++ b/src/patches/libloc-0.9.3-location-provide-return-code.patch
@@ -0,0 +1,22 @@
+commit 1be0681cc4bcc006369e69d90dc4439eaa6f58d5
+Author: Stefan Schantl <stefan.schantl(a)ipfire.org>
+Date:   Wed Jul 29 18:50:20 2020 +0200
+
+    location: Provide a return code if the database does not need to be
+    updated.
+    
+    Signed-off-by: Stefan Schantl <stefan.schantl(a)ipfire.org>
+
+diff --git a/src/python/location.in b/src/python/location.in
+index 5211b28..8cdd140 100644
+--- a/src/python/location.in
++++ b/src/python/location.in
+@@ -416,7 +416,7 @@ class CLI(object):
+ 					_("The datase has recently be updated recently (%s)") % \
+ 						format_timedelta(now - t),
+ 				)
+-				return
++				return 3
+ 
+ 		# Fetch the timestamp we need from DNS
+ 		t = location.discover_latest_version()
diff --git a/src/scripts/update-location-database b/src/scripts/update-location-database
index d830286ce..06b22d101 100644
--- a/src/scripts/update-location-database
+++ b/src/scripts/update-location-database
@@ -21,6 +21,8 @@
 
 eval $(/usr/local/bin/readhash /var/ipfire/proxy/settings)
 
+UPDATE_INTERVAL="weekly"
+
 # Proxy settings.
 # Check if a proxy should be used.
 if [[ $UPSTREAM_PROXY ]]; then
@@ -39,7 +41,7 @@ if [[ $UPSTREAM_PROXY ]]; then
 fi
 
 # Get the latest location database from server.
-if /usr/bin/location update; then
+if /usr/bin/location update --cron=$UPDATE_INTERVAL; then
 	# Call location and export all countries in xt_geoip compatible format.
 	if /usr/bin/location export --directory=/usr/share/xt_geoip --family=ipv4 --format=xt_geoip; then
 


hooks/post-receive
--
IPFire 2.x development tree

                 reply	other threads:[~2020-07-29 17:18 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=4BH0ch3Z2Wz2xld@people01.haj.ipfire.org \
    --to=git@ipfire.org \
    --cc=ipfire-scm@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