[arch-commits] Commit in libusb/trunk (2 files)
David Runge
dvzrv at gemini.archlinux.org
Sun Apr 10 20:10:37 UTC 2022
Date: Sunday, April 10, 2022 @ 20:10:36
Author: dvzrv
Revision: 442276
upgpkg: libusb 1.0.26-1: Upgrade to 1.0.26.
Remove unneeded quotes and curly braces.
Remove now included patch.
Modified:
libusb/trunk/PKGBUILD
Deleted:
libusb/trunk/0001-core-Install-first-context-as-implicit-default.patch
-----------------------------------------------------------+
0001-core-Install-first-context-as-implicit-default.patch | 109 ------------
PKGBUILD | 27 +-
2 files changed, 10 insertions(+), 126 deletions(-)
Deleted: 0001-core-Install-first-context-as-implicit-default.patch
===================================================================
--- 0001-core-Install-first-context-as-implicit-default.patch 2022-04-10 18:53:38 UTC (rev 442275)
+++ 0001-core-Install-first-context-as-implicit-default.patch 2022-04-10 20:10:36 UTC (rev 442276)
@@ -1,109 +0,0 @@
-From d46cbbac4851ce6e49d8dacb0daa328453eb8a84 Mon Sep 17 00:00:00 2001
-From: Benjamin Berg <bberg at redhat.com>
-Date: Tue, 22 Feb 2022 11:45:38 +0100
-Subject: [PATCH] core: Install first context as implicit default
-
-There was a behaviour change in libusb, which triggers issues when the
-API is misused. This caused gutenprint to crash, see
-https://bugzilla.redhat.com/show_bug.cgi?id=2055504
-
-For now, work around this by installing an implicit default. But, change
-the code to log an error in case this "feature" is being used.
----
- libusb/core.c | 16 +++++++++++++---
- libusb/libusbi.h | 15 ++++++++++++++-
- tests/umockdev.c | 31 +++++++++++++++++++++++++++++++
- 3 files changed, 58 insertions(+), 4 deletions(-)
-
-diff --git a/libusb/core.c b/libusb/core.c
-index 1c1ada1..c75ddae 100644
---- a/libusb/core.c
-+++ b/libusb/core.c
-@@ -41,6 +41,7 @@ static libusb_log_cb log_handler;
- #endif
-
- struct libusb_context *usbi_default_context;
-+struct libusb_context *usbi_fallback_context;
- static int default_context_refcnt;
- static usbi_mutex_static_t default_context_lock = USBI_MUTEX_INITIALIZER;
- static struct usbi_option default_context_options[LIBUSB_OPTION_MAX];
-@@ -2284,7 +2285,7 @@ int API_EXPORTED libusb_init(libusb_context **ctx)
-
- usbi_mutex_static_lock(&default_context_lock);
-
-- if (!ctx && usbi_default_context) {
-+ if (!ctx && default_context_refcnt > 0) {
- usbi_dbg(usbi_default_context, "reusing default context");
- default_context_refcnt++;
- usbi_mutex_static_unlock(&default_context_lock);
-@@ -2354,9 +2355,15 @@ int API_EXPORTED libusb_init(libusb_context **ctx)
- goto err_io_exit;
- }
-
-- if (ctx)
-+ if (ctx) {
- *ctx = _ctx;
-
-+ if (!usbi_fallback_context) {
-+ usbi_fallback_context = _ctx;
-+ usbi_warn(usbi_fallback_context, "installing new context as implicit default");
-+ }
-+ }
-+
- usbi_mutex_static_unlock(&default_context_lock);
-
- return 0;
-@@ -2429,6 +2436,8 @@ void API_EXPORTED libusb_exit(libusb_context *ctx)
-
- if (!ctx)
- usbi_default_context = NULL;
-+ if (ctx == usbi_fallback_context)
-+ usbi_fallback_context = NULL;
-
- usbi_mutex_static_unlock(&default_context_lock);
-
-@@ -2575,7 +2584,8 @@ static void log_v(struct libusb_context *ctx, enum libusb_log_level level,
- #else
- enum libusb_log_level ctx_level;
-
-- ctx = usbi_get_context(ctx);
-+ ctx = ctx ? ctx : usbi_default_context;
-+ ctx = ctx ? ctx : usbi_fallback_context;
- if (ctx)
- ctx_level = ctx->debug;
- else
-diff --git a/libusb/libusbi.h b/libusb/libusbi.h
-index 5f0d5c2..580add8 100644
---- a/libusb/libusbi.h
-+++ b/libusb/libusbi.h
-@@ -436,13 +436,26 @@ struct libusb_context {
- };
-
- extern struct libusb_context *usbi_default_context;
-+extern struct libusb_context *usbi_fallback_context;
-
- extern struct list_head active_contexts_list;
- extern usbi_mutex_static_t active_contexts_lock;
-
- static inline struct libusb_context *usbi_get_context(struct libusb_context *ctx)
- {
-- return ctx ? ctx : usbi_default_context;
-+ static int warned = 0;
-+
-+ if (!ctx) {
-+ ctx = usbi_default_context;
-+ }
-+ if (!ctx) {
-+ ctx = usbi_fallback_context;
-+ if (ctx && warned == 0) {
-+ usbi_err(ctx, "API misuse! Using non-default context as implicit default.");
-+ warned = 1;
-+ }
-+ }
-+ return ctx;
- }
-
- enum usbi_event_flags {
---
-2.35.1
-
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2022-04-10 18:53:38 UTC (rev 442275)
+++ PKGBUILD 2022-04-10 20:10:36 UTC (rev 442276)
@@ -3,8 +3,8 @@
# Contributor: Tobias Powalowski <tpowa at archlinux.org>
pkgname=libusb
-pkgver=1.0.25
-pkgrel=3
+pkgver=1.0.26
+pkgrel=1
pkgdesc="Library that provides generic access to USB devices"
arch=(x86_64)
url="https://libusb.info/"
@@ -13,35 +13,28 @@
makedepends=(systemd)
provides=(libusb-1.0.so)
options=(debug)
-source=("https://github.com/${pkgname}/${pkgname}/releases/download/v$pkgver/${pkgname}-$pkgver.tar.bz2"
- 0001-core-Install-first-context-as-implicit-default.patch)
-sha512sums=('f1e6e5577d4bd1ff136927dc66c615014a06ac332ddd797b1d1ad5f7b68e2405e66068dcb210e2f0ae3e31681603ef72efbd88bf7fbe0eb41ce700fdc3f92f9d'
- '0a8575ca6c155d2fe3c7720ca24b502a93f47ce879235cbf58120396044a7345e049032b9c66258a92b5ba4d8cc8c4afda566f4772cddd8305abdf8742d9e55b')
-b2sums=('3aecfbf9fc068fdfb8e612918bb895988f8400dc2c3ffd96a81792ab844d632f0c098947200512ddc37cfa9003956f8454c1d0362973a5d646a225f81cc2923b'
- '008b2629c73f7358cb13b93123f94634e410aacaf491074be67c4fac54ecb2aa5cde93d4f0c076148e7ac7cf8530250496d801506d0250dccce89fd57d3cb380')
+source=(https://github.com/$pkgname/$pkgname/releases/download/v$pkgver/$pkgname-$pkgver.tar.bz2)
+sha512sums=('fcdb85c98f21639668693c2fd522814d440972d65883984c4ae53d0555bdbdb7e8c7a32199cd4b01113556a1eb5be7841b750cc73c9f6bda79bfe1af80914e71')
+b2sums=('0cc397ecf4de0066abbff9b286a9e4fcd48658698d5e0d6b736abf56b48c1b55a05f15fff7be53fd33f767621e0c25d87275a47e05a4bcb44c4b8ac9221cd081')
prepare() {
- cd "$pkgname-$pkgver"
- # FS#74110 / Work around API misuse in gutenprint - patch taken from Fedora
- patch -Np1 -i "$srcdir"/0001-core-Install-first-context-as-implicit-default.patch
+ cd $pkgname-$pkgver
autoreconf -fiv
}
build() {
- cd "$pkgname-$pkgver"
+ cd $pkgname-$pkgver
./configure --prefix=/usr
make
}
check() {
- cd "$pkgname-$pkgver"
- make -k check
+ make -k check -C $pkgname-$pkgver
}
package () {
depends+=(libudev.so)
- cd "$pkgname-$pkgver"
- make DESTDIR="$pkgdir" install
- install -vDm 644 {AUTHORS,ChangeLog,README} -t "${pkgdir}/usr/share/doc/${pkgname}/"
+ make DESTDIR="$pkgdir" install -C $pkgname-$pkgver
+ install -vDm 644 $pkgname-$pkgver/{AUTHORS,ChangeLog,README} -t "$pkgdir/usr/share/doc/$pkgname/"
}
More information about the arch-commits
mailing list