[arch-commits] Commit in yubikey-personalization/repos (3 files)

Christian Hesse eworm at archlinux.org
Sat Apr 25 18:59:38 UTC 2020


    Date: Saturday, April 25, 2020 @ 18:59:36
  Author: eworm
Revision: 621042

archrelease: copy trunk to staging-x86_64

Added:
  yubikey-personalization/repos/staging-x86_64/
  yubikey-personalization/repos/staging-x86_64/0001-fix-boolean-value-with-json-c-0.14.patch
    (from rev 621041, yubikey-personalization/trunk/0001-fix-boolean-value-with-json-c-0.14.patch)
  yubikey-personalization/repos/staging-x86_64/PKGBUILD
    (from rev 621041, yubikey-personalization/trunk/PKGBUILD)

-----------------------------------------------+
 0001-fix-boolean-value-with-json-c-0.14.patch |   83 ++++++++++++++++++++++++
 PKGBUILD                                      |   51 ++++++++++++++
 2 files changed, 134 insertions(+)

Copied: yubikey-personalization/repos/staging-x86_64/0001-fix-boolean-value-with-json-c-0.14.patch (from rev 621041, yubikey-personalization/trunk/0001-fix-boolean-value-with-json-c-0.14.patch)
===================================================================
--- staging-x86_64/0001-fix-boolean-value-with-json-c-0.14.patch	                        (rev 0)
+++ staging-x86_64/0001-fix-boolean-value-with-json-c-0.14.patch	2020-04-25 18:59:36 UTC (rev 621042)
@@ -0,0 +1,83 @@
+From 0aa2e2cae2e1777863993a10c809bb50f4cde7f8 Mon Sep 17 00:00:00 2001
+From: Christian Hesse <mail at eworm.de>
+Date: Sat, 25 Apr 2020 20:55:28 +0200
+Subject: [PATCH 1/1] fix boolean value with json-c 0.14
+
+Upstream removed the TRUE and FALSE defines in commit
+0992aac61f8b087efd7094e9ac2b84fa9c040fcd.
+---
+ ykpers-json.c | 18 +++++++++---------
+ 1 file changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/ykpers-json.c b/ykpers-json.c
+index a62e907..15ad380 100644
+--- a/ykpers-json.c
++++ b/ykpers-json.c
+@@ -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 ? 0 : 1
+ #endif
+ 
+ static void set_json_value(struct map_st *p, int mode, json_object *options, YKP_CONFIG *cfg) {
+@@ -50,7 +50,7 @@ static void set_json_value(struct map_st *p, int mode, json_object *options, YKP
+ 	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 @@ int _ykp_json_import_cfg(YKP_CONFIG *cfg, const char *json, size_t len) {
+ 			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 @@ int _ykp_json_import_cfg(YKP_CONFIG *cfg, const char *json, size_t len) {
+ 		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 @@ int _ykp_json_import_cfg(YKP_CONFIG *cfg, const char *json, size_t len) {
+ 					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);
+ 					}
+ 				}

Copied: yubikey-personalization/repos/staging-x86_64/PKGBUILD (from rev 621041, yubikey-personalization/trunk/PKGBUILD)
===================================================================
--- staging-x86_64/PKGBUILD	                        (rev 0)
+++ staging-x86_64/PKGBUILD	2020-04-25 18:59:36 UTC (rev 621042)
@@ -0,0 +1,51 @@
+# Maintainer: Christian Hesse <mail at eworm.de>
+
+pkgname=yubikey-personalization
+_shortname=ykpers
+pkgver=1.20.0
+pkgrel=2
+pkgdesc='Yubico YubiKey Personalization library and tool'
+arch=('x86_64')
+url='https://github.com/Yubico/yubikey-personalization'
+license=('BSD')
+depends=('libusb' 'json-c' 'yubico-c-client')
+# We need systemd to be installed for udev version check
+makedepends=('systemd')
+provides=('ykpers')
+conflicts=('ykpers')
+validpgpkeys=('0A3B0262BCA1705307D5FF06BCA00FD4B2168C0A') # Klas Lindfors <klas at yubico.com>
+source=("https://developers.yubico.com/${pkgname}/Releases/${_shortname}-${pkgver}.tar.gz"{,.sig}
+        '0001-fix-boolean-value-with-json-c-0.14.patch')
+sha256sums=('0ec84d0ea862f45a7d85a1a3afe5e60b8da42df211bb7d27a50f486e31a79b93'
+            'SKIP'
+            'f9b434e9570ce7d0192182aab979f767238b704f12645546e567db841bb7b5e2')
+
+prepare() {
+	cd "${_shortname}-${pkgver}"
+
+	patch -Np1 < ../0001-fix-boolean-value-with-json-c-0.14.patch
+}
+
+build() {
+	cd "${_shortname}-${pkgver}"
+
+	./configure \
+		--prefix=/usr \
+		--with-udevrulesdir=/usr/lib/udev/rules.d/
+	make
+}
+
+check() {
+	cd "${_shortname}-${pkgver}"
+
+	make check
+}
+
+package() {
+	cd "${_shortname}-${pkgver}"
+
+	install -D -m0644 COPYING "${pkgdir}/usr/share/licenses/yubikey-personalization/COPYING"
+	install -D -m0644 README "${pkgdir}/usr/share/doc/yubikey-personalization/README"
+	make DESTDIR="${pkgdir}/" install
+}
+



More information about the arch-commits mailing list