Hello community, here is the log from the commit of package ocli for openSUSE:Factory checked in at 2020-06-06 23:40:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ocli (Old) and /work/SRC/openSUSE:Factory/.ocli.new.3606 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ocli" Sat Jun 6 23:40:23 2020 rev:3 rq:812021 version:0.9.0 Changes: -------- --- /work/SRC/openSUSE:Factory/ocli/ocli.changes 2020-02-27 14:36:56.105982419 +0100 +++ /work/SRC/openSUSE:Factory/.ocli.new.3606/ocli.changes 2020-06-06 23:40:40.921156433 +0200 @@ -1,0 +2,6 @@ +Thu Jun 4 13:26:37 UTC 2020 - Martin Hauke <[email protected]> + +- Add patch: + * 0001-FIX-adapted-for-gpsd-3.20.patch + +------------------------------------------------------------------- New: ---- 0001-FIX-adapted-for-gpsd-3.20.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ocli.spec ++++++ --- /var/tmp/diff_new_pack.eLxNWj/_old 2020-06-06 23:40:41.769159094 +0200 +++ /var/tmp/diff_new_pack.eLxNWj/_new 2020-06-06 23:40:41.773159106 +0200 @@ -25,6 +25,7 @@ Group: Productivity/Networking/Other URL: https://github.com/owntracks/ocli Source: https://github.com/owntracks/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz +Patch0: 0001-FIX-adapted-for-gpsd-3.20.patch BuildRequires: gpsd-devel BuildRequires: mosquitto-devel Provides: owntracks-cli-publisher @@ -37,6 +38,7 @@ %prep %setup -q +%patch0 -p1 %build export CFLAGS="%{optflags}" ++++++ 0001-FIX-adapted-for-gpsd-3.20.patch ++++++ >From c9f15c8c92b59cdfc7152bc3fdd77c251efe777e Mon Sep 17 00:00:00 2001 From: Christoph Krey <[email protected]> Date: Thu, 4 Jun 2020 15:11:14 +0200 Subject: [PATCH] [FIX] adapted for gpsd >= 3.20 --- owntracks-cli-publisher.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/owntracks-cli-publisher.c b/owntracks-cli-publisher.c index 9104a68..f7c2be6 100644 --- a/owntracks-cli-publisher.c +++ b/owntracks-cli-publisher.c @@ -85,7 +85,7 @@ static void print_fix(struct udata *ud, struct gps_data_t *gpsdata, double time, void catcher(int sig) { - fprintf(stderr, "%s: Going down on signal %d", PROGNAME, sig); + fprintf(stderr, "%s: Going down on signal %d\n", PROGNAME, sig); exit(1); } @@ -264,7 +264,14 @@ static void print_fix(struct udata *ud, struct gps_data_t *gpsdata, double ttime accuracy = 0.0; } +#if GPSD_API_MAJOR_VERSION >= 9 + timespec_t ts; + ts.tv_sec = (long)ttime; + ts.tv_nsec = 0; + timespec_to_iso8601(ts, tbuf, sizeof(tbuf)); +#else unix_to_iso8601(ttime, tbuf, sizeof(tbuf)); +#endif if (ud->verbose) { printf("mode=%d, lat=%f, lon=%f, acc=%f, tst=%s (%ld)\n", fix->mode, @@ -372,7 +379,11 @@ static void print_fix(struct udata *ud, struct gps_data_t *gpsdata, double ttime static void conditionally_log_fix(struct udata *ud, struct gps_data_t *gpsdata) { struct gps_fix_t *fix = &(gpsdata->fix); +#if GPSD_API_MAJOR_VERSION >= 9 + static timespec_t int_time, old_int_time; +#else static double int_time, old_int_time; +#endif static double old_lat, old_lon; static bool first = true; bool valid = false; @@ -449,7 +460,11 @@ static void conditionally_log_fix(struct udata *ud, struct gps_data_t *gpsdata) int_time = fix->time; +#if GPSD_API_MAJOR_VERSION >= 9 + if ((int_time.tv_sec == old_int_time.tv_sec) || fix->mode < MODE_2D) { +#else if ((int_time == old_int_time) || fix->mode < MODE_2D) { +#endif // puts("rubbish"); usleep(SIESTA); return; @@ -466,7 +481,11 @@ static void conditionally_log_fix(struct udata *ud, struct gps_data_t *gpsdata) } /* Don't log if interval seconds haven't elapsed since the last fix */ +#if GPSD_API_MAJOR_VERSION >= 9 + if ((labs(int_time.tv_sec - old_int_time.tv_sec) < ud->interval) && !first) { +#else if ((fabs(int_time - old_int_time) < ud->interval) && !first) { +#endif // puts("too soon"); usleep(SIESTA); return; @@ -481,7 +500,11 @@ static void conditionally_log_fix(struct udata *ud, struct gps_data_t *gpsdata) old_lon = fix->longitude; } +#if GPSD_API_MAJOR_VERSION >= 9 + print_fix(ud, gpsdata, (double)int_time.tv_sec, PERIODIC_REPORT); +#else print_fix(ud, gpsdata, int_time, PERIODIC_REPORT); +#endif } static int env_number(char *key, int min) @@ -640,6 +663,8 @@ int main(int argc, char **argv) printf("t_base %s\n", ud->basetopic); printf("t_cmd %s\n", ud->t_cmd); printf("t_dump %s\n", ud->t_dump ); + printf("GPSD_API_MAJOR_VERSION %d\n", + GPSD_API_MAJOR_VERSION); } mosquitto_lib_init(); -- 2.26.2
