control: tags -1 patch pending

NMU ongoing
diff -Nru psensor-1.1.5/debian/changelog psensor-1.1.5/debian/changelog
--- psensor-1.1.5/debian/changelog      2016-06-06 20:25:02.000000000 +0200
+++ psensor-1.1.5/debian/changelog      2019-08-12 15:41:22.000000000 +0200
@@ -1,3 +1,10 @@
+psensor (1.1.5-1.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Port to new json-c (Closes: #915851)
+
+ -- Gianfranco Costamagna <locutusofb...@debian.org>  Mon, 12 Aug 2019 
15:41:22 +0200
+
 psensor (1.1.5-1) unstable; urgency=medium
 
   * New upstream release
diff -Nru 
psensor-1.1.5/debian/patches/0001-Update-rsensor.c-drop-is_error-macro-definition.patch
 
psensor-1.1.5/debian/patches/0001-Update-rsensor.c-drop-is_error-macro-definition.patch
--- 
psensor-1.1.5/debian/patches/0001-Update-rsensor.c-drop-is_error-macro-definition.patch
     1970-01-01 01:00:00.000000000 +0100
+++ 
psensor-1.1.5/debian/patches/0001-Update-rsensor.c-drop-is_error-macro-definition.patch
     2019-06-30 10:33:04.000000000 +0200
@@ -0,0 +1,66 @@
+From 31d75df7c516c5e767e6b8219c2c08a39159d699 Mon Sep 17 00:00:00 2001
+From: Matheus Teixeira <matheus.m...@gmail.com>
+Date: Sun, 30 Jun 2019 08:39:18 +0000
+Subject: [PATCH] Update rsensor.c: drop is_error macro definition. New json-c
+ 13.1 removed bits.h inclusion, deprecating de facto all the definitions
+ inside. is_error is defined as "#define is_error(ptr) (ptr == NULL)"
+
+in this case, double checking the same pointer is just useless, remove it.
+Also simplify the double obj check in remote_psensor_update because obj can't 
change between the first and the second check
+
+After writing the patch I discovered a new PR From: Matheus Teixeira 
<matheus.m...@gmail.com>, with really similar content, so I'm giving
+credits for authorship to him.
+
+Signed-off-by: Gianfranco Costamagna <costamagnagianfra...@yahoo.it>
+Signed-off-by: Gianfranco Costamagna <locutusofb...@debian.org>
+---
+ src/rsensor.c | 22 ++++++++++------------
+ 1 file changed, 10 insertions(+), 12 deletions(-)
+
+Index: psensor-1.1.5/src/rsensor.c
+===================================================================
+--- psensor-1.1.5.orig/src/rsensor.c
++++ psensor-1.1.5/src/rsensor.c
+@@ -125,7 +125,7 @@
+ 
+       obj = get_json_object(url);
+ 
+-      if (obj && !is_error(obj)) {
++      if (obj) {
+               n = json_object_array_length(obj);
+               sensors = malloc((n + 1) * sizeof(struct psensor *));
+ 
+@@ -160,24 +160,22 @@
+ 
+       obj = get_json_object(s->url);
+ 
+-      if (obj && !is_error(obj)) {
++      if (obj) {
+               json_object *om;
+ 
+               json_object_object_get_ex(obj, "last_measure", &om);
+ 
+-              if (!is_error(obj)) {
+-                      json_object *ov, *ot;
+-                      struct timeval tv;
++              json_object *ov, *ot;
++              struct timeval tv;
+ 
+-                      json_object_object_get_ex(om, "value", &ov);
+-                      json_object_object_get_ex(om, "time", &ot);
++              json_object_object_get_ex(om, "value", &ov);
++              json_object_object_get_ex(om, "time", &ot);
+ 
+-                      tv.tv_sec = json_object_get_int(ot);
+-                      tv.tv_usec = 0;
++              tv.tv_sec = json_object_get_int(ot);
++              tv.tv_usec = 0;
+ 
+-                      psensor_set_current_measure
+-                          (s, json_object_get_double(ov), tv);
+-              }
++              psensor_set_current_measure
++                  (s, json_object_get_double(ov), tv);
+ 
+               json_object_put(obj);
+       } else {
diff -Nru psensor-1.1.5/debian/patches/series 
psensor-1.1.5/debian/patches/series
--- psensor-1.1.5/debian/patches/series 1970-01-01 01:00:00.000000000 +0100
+++ psensor-1.1.5/debian/patches/series 2019-06-30 10:33:04.000000000 +0200
@@ -0,0 +1 @@
+0001-Update-rsensor.c-drop-is_error-macro-definition.patch

Reply via email to