[hamradio-commits] [dump1090-mutability] 71/172: Require that the JSON refresh interval is at least 1, as it is used to control the webmap refresh rate even if JSON files are not being written.

Matteo F. Vescovi mfv at moszumanska.debian.org
Sun Jan 28 13:45:47 UTC 2018


This is an automated email from the git hooks/post-receive script.

mfv pushed a commit to branch master
in repository dump1090-mutability.

commit 91f68ef6694481daae328f4335ea50e166753982
Author: Oliver Jowett <oliver at mutability.co.uk>
Date:   Wed Jan 14 01:15:54 2015 +0000

    Require that the JSON refresh interval is at least 1, as it is used
    to control the webmap refresh rate even if JSON files are not being written.
---
 debian/changelog                     |  2 ++
 debian/dump1090-mutability.config    | 13 +++++++------
 debian/dump1090-mutability.templates |  8 ++++++--
 3 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index fa617c0..c54287c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,6 +13,8 @@ dump1090-mutability (1.10.3010.14mu-11) UNRELEASED; urgency=medium
     discard bad position results.
   * Display message rate (30 sec average) on the webmap.
   * Restart lighttpd on package upgrade if we changed its config files.
+  * Require that the JSON refresh interval is at least 1, as it is used
+    to control the webmap refresh rate even if JSON files are not being written.
 
  -- Oliver Jowett <oliver at mutability.co.uk>  Sun, 11 Jan 2015 11:53:48 +0000
 
diff --git a/debian/dump1090-mutability.config b/debian/dump1090-mutability.config
index 517f63e..a55d2cc 100644
--- a/debian/dump1090-mutability.config
+++ b/debian/dump1090-mutability.config
@@ -108,6 +108,10 @@ is_unsigned_int_or_empty() {
   else return 1; fi
 }
 
+is_positive_int() {
+  if echo "$1" | grep -Eq '^(+?[1-9][0-9]*)$'; then return 0; else return 1; fi
+}
+
 is_signed_int() {
   if echo "$1" | grep -Eq '^(0|[+-]?[1-9][0-9]*)$'; then return 0; else return 1; fi
 }
@@ -201,13 +205,10 @@ db_go || true; db_get $NAME/auto-start; if [ "$RET" = "true" ]; then
  db_input_verify medium $NAME/net-bind-address is_ipaddrish_or_empty || true
 
  db_input_verify low $NAME/stats-interval is_unsigned_int || true
- db_input_verify low $NAME/json-interval is_unsigned_int || true
 
- db_go || true; db_get $NAME/json-interval; if [ -n "$RET" ] && [ "$RET" -gt 0 ]; then
-  # only if json-interval was given and non-zero
-  db_input low $NAME/json-dir || true
-  db_input low $NAME/json-location-accuracy || true
- fi
+ db_input_verify low $NAME/json-interval is_positive_int || true
+ db_input low $NAME/json-location-accuracy || true
+ db_input low $NAME/json-dir || true
 
  db_input low $NAME/log-decoded-messages || true
  db_input low $NAME/extra-args || true
diff --git a/debian/dump1090-mutability.templates b/debian/dump1090-mutability.templates
index 04c12ea..e6c450b 100644
--- a/debian/dump1090-mutability.templates
+++ b/debian/dump1090-mutability.templates
@@ -235,6 +235,8 @@ Description: Directory to write JSON aircraft state to:
  As this can be written frequently, you should select a location
  that is not on a sdcard. The default path under /run is on tmpfs
  and will not write to the sdcard.
+ .
+ A blank path disables writing JSON state.
 Type: string
 Default: /run/dump1090-mutability
 
@@ -246,8 +248,6 @@ Description: Interval between writing JSON aircraft state, in seconds:
  .
  Here you can control how often the JSON state is updated, which determines
  how frequently the virtual radar view updates.
- .
- A value of 0 will disable writing JSON state entirely.
 Type: string
 Default: 1
 
@@ -293,6 +293,10 @@ Template: dump1090-mutability/invalid-is_unsigned_int_or_empty
 Description: Value must be an unsigned integer, or blank.
 Type: error
 
+Template: dump1090-mutability/invalid-is_positive_int
+Description: Value must be a positive integer.
+Type: error
+
 Template: dump1090-mutability/invalid-is_signed_int
 Description: Value must be an integer.
 Type: error

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/dump1090-mutability.git



More information about the pkg-hamradio-commits mailing list