[packages/ykpers] - added json-c patch (fixes build with json-c 0.14); release 2

qboosh qboosh at pld-linux.org
Fri May 1 21:50:24 CEST 2020


commit f3fb7e74125200f6cadbab0149d7959c5a5919e0
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Fri May 1 21:50:44 2020 +0200

    - added json-c patch (fixes build with json-c 0.14); release 2

 ykpers-json-c.patch | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 ykpers.spec         |  4 ++-
 2 files changed, 73 insertions(+), 1 deletion(-)
---
diff --git a/ykpers.spec b/ykpers.spec
index b0b4cae..42d89a3 100644
--- a/ykpers.spec
+++ b/ykpers.spec
@@ -7,11 +7,12 @@ Summary:	Yubikey personalization program
 Summary(pl.UTF-8):	Program do personalizacji urządzeń Yubikey
 Name:		ykpers
 Version:	1.20.0
-Release:	1
+Release:	2
 License:	BSD
 Group:		Applications/System
 Source0:	https://developers.yubico.com/yubikey-personalization/Releases/%{name}-%{version}.tar.gz
 # Source0-md5:	8749113ce5a0164fe2b429b61242ba0f
+Patch0:		%{name}-json-c.patch
 URL:		https://developers.yubico.com/yubikey-personalization/
 BuildRequires:	asciidoc
 BuildRequires:	json-c-devel
@@ -59,6 +60,7 @@ Statyczna biblioteka ykpers.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 %configure \
diff --git a/ykpers-json-c.patch b/ykpers-json-c.patch
new file mode 100644
index 0000000..8be31b8
--- /dev/null
+++ b/ykpers-json-c.patch
@@ -0,0 +1,70 @@
+--- ykpers-1.20.0/ykpers-json.c.orig	2019-02-19 13:29:54.000000000 +0100
++++ ykpers-1.20.0/ykpers-json.c	2020-05-01 21:45:21.661700644 +0200
+@@ -40,7 +40,7 @@
+ #define yk_json_object_object_get(obj, key, value) json_object_object_get_ex(obj, key, &value)
+ #else
+ typedef int json_bool;
+-#define yk_json_object_object_get(obj, key, value) (value = json_object_object_get(obj, key)) == NULL ? (json_bool)FALSE : (json_bool)TRUE
++#define yk_json_object_object_get(obj, key, value) (value = json_object_object_get(obj, key)) == NULL ? (json_bool)0 : (json_bool)1
+ #endif
+ 
+ static void set_json_value(struct map_st *p, int mode, json_object *options, YKP_CONFIG *cfg) {
+@@ -50,7 +50,7 @@
+ 	if(p->mode && (mode & p->mode) == mode) {
+ 		json_object *joption;
+ 		json_bool ret = yk_json_object_object_get(options, p->json_text, joption);
+-		if(ret == TRUE && json_object_get_type(joption) == json_type_boolean) {
++		if(ret == 1 && json_object_get_type(joption) == json_type_boolean) {
+ 			int value = json_object_get_boolean(joption);
+ 			if(value == 1) {
+ 				p->setter(cfg, true);
+@@ -230,20 +230,20 @@
+ 			ykp_errno = YKP_EINVAL;
+ 			goto out;
+ 		}
+-		if(yk_json_object_object_get(jobj, "yubiProdConfig", yprod_json) == FALSE) {
++		if(yk_json_object_object_get(jobj, "yubiProdConfig", yprod_json) == 0) {
+ 			ykp_errno = YKP_EINVAL;
+ 			goto out;
+ 		}
+-		if(yk_json_object_object_get(yprod_json, "mode", jmode) == FALSE) {
++		if(yk_json_object_object_get(yprod_json, "mode", jmode) == 0) {
+ 			ykp_errno = YKP_EINVAL;
+ 			goto out;
+ 		}
+-		if(yk_json_object_object_get(yprod_json, "options", options) == FALSE) {
++		if(yk_json_object_object_get(yprod_json, "options", options) == 0) {
+ 			ykp_errno = YKP_EINVAL;
+ 			goto out;
+ 		}
+ 
+-		if(yk_json_object_object_get(yprod_json, "targetConfig", jtarget) == TRUE) {
++		if(yk_json_object_object_get(yprod_json, "targetConfig", jtarget) == 1) {
+ 			int target_config = json_object_get_int(jtarget);
+ 			int command;
+ 			if(target_config == 1) {
+@@ -275,13 +275,13 @@
+ 		if(mode == MODE_OATH_HOTP) {
+ 			json_object *jdigits, *jrandom;
+ 			ykp_set_tktflag_OATH_HOTP(cfg, true);
+-			if(yk_json_object_object_get(options, "oathDigits", jdigits) == TRUE) {
++			if(yk_json_object_object_get(options, "oathDigits", jdigits) == 1) {
+ 				int digits = json_object_get_int(jdigits);
+ 				if(digits == 8) {
+ 					ykp_set_cfgflag_OATH_HOTP8(cfg, true);
+ 				}
+ 			}
+-			if(yk_json_object_object_get(options, "randomSeed", jrandom) == TRUE) {
++			if(yk_json_object_object_get(options, "randomSeed", jrandom) == 1) {
+ 				int random = json_object_get_boolean(jrandom);
+ 				int seed = 0;
+ 				if(random == 1) {
+@@ -290,7 +290,7 @@
+ 					goto out;
+ 				} else {
+ 					json_object *jseed;
+-					if(yk_json_object_object_get(options, "fixedSeedvalue", jseed) == TRUE) {
++					if(yk_json_object_object_get(options, "fixedSeedvalue", jseed) == 1) {
+ 						seed = json_object_get_int(jseed);
+ 					}
+ 				}
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ykpers.git/commitdiff/f3fb7e74125200f6cadbab0149d7959c5a5919e0



More information about the pld-cvs-commit mailing list