diff -Nru libgusb-0.2.10/aclocal.m4 libgusb-0.2.11/aclocal.m4
--- libgusb-0.2.10/aclocal.m4 2017-03-24 15:46:15.000000000 +0000
+++ libgusb-0.2.11/aclocal.m4 2017-06-08 15:34:55.000000000 +0000
@@ -117,9 +117,9 @@
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
])
-dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
-dnl serial 11 (pkg-config-0.29.1)
-dnl
+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+# serial 11 (pkg-config-0.29.1)
+
dnl Copyright © 2004 Scott James Remnant .
dnl Copyright © 2012-2015 Dan Nicholson
dnl
@@ -393,6 +393,74 @@
AS_VAR_IF([$1], [""], [$5], [$4])dnl
])dnl PKG_CHECK_VAR
+dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
+dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
+dnl [DESCRIPTION], [DEFAULT])
+dnl ------------------------------------------
+dnl
+dnl Prepare a "--with-" configure option using the lowercase
+dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
+dnl PKG_CHECK_MODULES in a single macro.
+AC_DEFUN([PKG_WITH_MODULES],
+[
+m4_pushdef([with_arg], m4_tolower([$1]))
+
+m4_pushdef([description],
+ [m4_default([$5], [build with ]with_arg[ support])])
+
+m4_pushdef([def_arg], [m4_default([$6], [auto])])
+m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
+m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
+
+m4_case(def_arg,
+ [yes],[m4_pushdef([with_without], [--without-]with_arg)],
+ [m4_pushdef([with_without],[--with-]with_arg)])
+
+AC_ARG_WITH(with_arg,
+ AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
+ [AS_TR_SH([with_]with_arg)=def_arg])
+
+AS_CASE([$AS_TR_SH([with_]with_arg)],
+ [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
+ [auto],[PKG_CHECK_MODULES([$1],[$2],
+ [m4_n([def_action_if_found]) $3],
+ [m4_n([def_action_if_not_found]) $4])])
+
+m4_popdef([with_arg])
+m4_popdef([description])
+m4_popdef([def_arg])
+
+])dnl PKG_WITH_MODULES
+
+dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
+dnl [DESCRIPTION], [DEFAULT])
+dnl -----------------------------------------------
+dnl
+dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
+dnl check._[VARIABLE-PREFIX] is exported as make variable.
+AC_DEFUN([PKG_HAVE_WITH_MODULES],
+[
+PKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
+
+AM_CONDITIONAL([HAVE_][$1],
+ [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
+])dnl PKG_HAVE_WITH_MODULES
+
+dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
+dnl [DESCRIPTION], [DEFAULT])
+dnl ------------------------------------------------------
+dnl
+dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
+dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
+dnl and preprocessor variable.
+AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
+[
+PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
+
+AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
+ [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
+])dnl PKG_HAVE_DEFINE_WITH_MODULES
+
# Copyright (C) 2002-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
diff -Nru libgusb-0.2.10/config.h libgusb-0.2.11/config.h
--- libgusb-0.2.10/config.h 2016-11-09 09:11:44.000000000 +0000
+++ libgusb-0.2.11/config.h 2017-04-13 16:24:36.000000000 +0000
@@ -44,7 +44,7 @@
#define PACKAGE_NAME "libgusb"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "libgusb 0.2.10"
+#define PACKAGE_STRING "libgusb 0.2.11"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libgusb"
@@ -53,10 +53,10 @@
#define PACKAGE_URL ""
/* Define to the version of this package. */
-#define PACKAGE_VERSION "0.2.10"
+#define PACKAGE_VERSION "0.2.11"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Version number of package */
-#define VERSION "0.2.10"
+#define VERSION "0.2.11"
diff -Nru libgusb-0.2.10/configure libgusb-0.2.11/configure
--- libgusb-0.2.10/configure 2017-03-24 15:46:15.000000000 +0000
+++ libgusb-0.2.11/configure 2017-06-08 15:34:56.000000000 +0000
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libgusb 0.2.10.
+# Generated by GNU Autoconf 2.69 for libgusb 0.2.11.
#
# Report bugs to .
#
@@ -590,8 +590,8 @@
# Identity of this package.
PACKAGE_NAME='libgusb'
PACKAGE_TARNAME='libgusb'
-PACKAGE_VERSION='0.2.10'
-PACKAGE_STRING='libgusb 0.2.10'
+PACKAGE_VERSION='0.2.11'
+PACKAGE_STRING='libgusb 0.2.11'
PACKAGE_BUGREPORT='http://www.hughsie.com'
PACKAGE_URL=''
@@ -1380,7 +1380,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures libgusb 0.2.10 to adapt to many kinds of systems.
+\`configure' configures libgusb 0.2.11 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1450,7 +1450,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libgusb 0.2.10:";;
+ short | recursive ) echo "Configuration of libgusb 0.2.11:";;
esac
cat <<\_ACEOF
@@ -1582,7 +1582,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libgusb configure 0.2.10
+libgusb configure 0.2.11
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1860,7 +1860,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libgusb $as_me 0.2.10, which was
+It was created by libgusb $as_me 0.2.11, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2728,7 +2728,7 @@
# Define the identity of the package.
PACKAGE='libgusb'
- VERSION='0.2.10'
+ VERSION='0.2.11'
cat >>confdefs.h <<_ACEOF
@@ -3438,7 +3438,7 @@
# use this in cd-version.h
G_USB_MAJOR_VERSION=0
G_USB_MINOR_VERSION=2
-G_USB_MICRO_VERSION=10
+G_USB_MICRO_VERSION=11
@@ -13030,12 +13030,12 @@
pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.38.0 gobject-2.0 gthread-2.0 gio-2.0\""; } >&5
- ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.38.0 gobject-2.0 gthread-2.0 gio-2.0") 2>&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.44.0 gobject-2.0 gthread-2.0 gio-2.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.44.0 gobject-2.0 gthread-2.0 gio-2.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.38.0 gobject-2.0 gthread-2.0 gio-2.0" 2>/dev/null`
+ pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.44.0 gobject-2.0 gthread-2.0 gio-2.0" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
@@ -13047,12 +13047,12 @@
pkg_cv_GLIB_LIBS="$GLIB_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.38.0 gobject-2.0 gthread-2.0 gio-2.0\""; } >&5
- ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.38.0 gobject-2.0 gthread-2.0 gio-2.0") 2>&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.44.0 gobject-2.0 gthread-2.0 gio-2.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.44.0 gobject-2.0 gthread-2.0 gio-2.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.38.0 gobject-2.0 gthread-2.0 gio-2.0" 2>/dev/null`
+ pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.44.0 gobject-2.0 gthread-2.0 gio-2.0" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
@@ -13073,14 +13073,14 @@
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
- GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.38.0 gobject-2.0 gthread-2.0 gio-2.0" 2>&1`
+ GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.44.0 gobject-2.0 gthread-2.0 gio-2.0" 2>&1`
else
- GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.38.0 gobject-2.0 gthread-2.0 gio-2.0" 2>&1`
+ GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.44.0 gobject-2.0 gthread-2.0 gio-2.0" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$GLIB_PKG_ERRORS" >&5
- as_fn_error $? "Package requirements (glib-2.0 >= 2.38.0 gobject-2.0 gthread-2.0 gio-2.0) were not met:
+ as_fn_error $? "Package requirements (glib-2.0 >= 2.44.0 gobject-2.0 gthread-2.0 gio-2.0) were not met:
$GLIB_PKG_ERRORS
@@ -13788,7 +13788,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by libgusb $as_me 0.2.10, which was
+This file was extended by libgusb $as_me 0.2.11, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -13854,7 +13854,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-libgusb config.status 0.2.10
+libgusb config.status 0.2.11
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff -Nru libgusb-0.2.10/configure.ac libgusb-0.2.11/configure.ac
--- libgusb-0.2.10/configure.ac 2016-03-21 10:53:31.000000000 +0000
+++ libgusb-0.2.11/configure.ac 2017-06-08 15:23:16.000000000 +0000
@@ -3,7 +3,7 @@
m4_define([gusb_major_version], [0])
m4_define([gusb_minor_version], [2])
-m4_define([gusb_micro_version], [10])
+m4_define([gusb_micro_version], [11])
m4_define([gusb_version],
[gusb_major_version.gusb_minor_version.gusb_micro_version])
@@ -98,7 +98,7 @@
dnl ---------------------------------------------------------------------------
dnl - Check library dependencies
dnl ---------------------------------------------------------------------------
-PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.38.0 gobject-2.0 gthread-2.0 gio-2.0)
+PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.44.0 gobject-2.0 gthread-2.0 gio-2.0)
PKG_CHECK_MODULES(USB, libusb-1.0 >= 1.0.19)
dnl ---------------------------------------------------------------------------
diff -Nru libgusb-0.2.10/debian/changelog libgusb-0.2.11/debian/changelog
--- libgusb-0.2.10/debian/changelog 2017-07-17 09:21:06.000000000 +0000
+++ libgusb-0.2.11/debian/changelog 2017-08-07 16:55:14.000000000 +0000
@@ -1,3 +1,9 @@
+libgusb (0.2.11-1) unstable; urgency=medium
+
+ * New upstream release.
+
+ -- Michal Čihař Mon, 07 Aug 2017 12:55:14 -0400
+
libgusb (0.2.10-2) unstable; urgency=medium
* Revert upstream changes in symbol versioning (Closes: #868340).
diff -Nru libgusb-0.2.10/debian/libgusb2.symbols libgusb-0.2.11/debian/libgusb2.symbols
--- libgusb-0.2.10/debian/libgusb2.symbols 2017-07-17 09:21:04.000000000 +0000
+++ libgusb-0.2.11/debian/libgusb2.symbols 2017-08-07 16:55:14.000000000 +0000
@@ -2,6 +2,7 @@
LIBGUSB_0.1.0@LIBGUSB_0.1.0 0.1.0
LIBGUSB_0.1.1@LIBGUSB_0.1.1 0.1.1
LIBGUSB_0.1.7@LIBGUSB_0.1.7 0.1.7
+ LIBGUSB_0.2.11@LIBGUSB_0.2.11 0.2.11
LIBGUSB_0.2.2@LIBGUSB_0.2.2 0.2.2
LIBGUSB_0.2.4@LIBGUSB_0.2.4 0.2.4
LIBGUSB_0.2.5@LIBGUSB_0.2.5 0.2.5
@@ -11,11 +12,13 @@
g_usb_context_find_by_platform_id@LIBGUSB_0.2.4 0.2.4
g_usb_context_find_by_vid_pid@LIBGUSB_0.2.2 0.2.2
g_usb_context_get_devices@LIBGUSB_0.2.2 0.2.2
+ g_usb_context_get_flags@LIBGUSB_0.2.11 0.2.11
g_usb_context_get_main_context@LIBGUSB_0.1.0 0.1.0
g_usb_context_get_source@LIBGUSB_0.1.0 0.1.0
g_usb_context_get_type@LIBGUSB_0.1.0 0.1.0
g_usb_context_new@LIBGUSB_0.1.0 0.1.0
g_usb_context_set_debug@LIBGUSB_0.1.0 0.1.0
+ g_usb_context_set_flags@LIBGUSB_0.2.11 0.2.11
g_usb_context_set_main_context@LIBGUSB_0.1.0 0.1.0
g_usb_context_wait_for_replug@LIBGUSB_0.1.0 0.2.10
g_usb_device_bulk_transfer@LIBGUSB_0.1.0 0.1.0
diff -Nru libgusb-0.2.10/debian/patches/revert-versioning.patch libgusb-0.2.11/debian/patches/revert-versioning.patch
--- libgusb-0.2.10/debian/patches/revert-versioning.patch 2017-07-17 09:15:23.000000000 +0000
+++ libgusb-0.2.11/debian/patches/revert-versioning.patch 2017-08-07 16:55:14.000000000 +0000
@@ -10,14 +10,14 @@
https://github.com/hughsie/libgusb/issues/9
--- a/gusb/libgusb.ver
+++ b/gusb/libgusb.ver
-@@ -37,28 +37,4 @@
+@@ -37,34 +37,10 @@
LIBGUSB_0.2.5 {
global:
g_usb_device_get_custom_index;
- g_usb_context_get_main_context;
- g_usb_context_set_main_context;
} LIBGUSB_0.2.4;
--
+
-LIBGUSB_0.2.8 {
- global:
- g_usb_device_get_interface;
@@ -39,3 +39,10 @@
- global:
- g_usb_context_wait_for_replug;
-} LIBGUSB_0.2.8;
+-
+ LIBGUSB_0.2.11 {
+ global:
+ g_usb_context_set_flags;
+ g_usb_context_get_flags;
+-} LIBGUSB_0.2.9;
++} LIBGUSB_0.2.5;
diff -Nru libgusb-0.2.10/docs/api/gusb-sections.txt libgusb-0.2.11/docs/api/gusb-sections.txt
--- libgusb-0.2.10/docs/api/gusb-sections.txt 2017-04-10 13:32:54.000000000 +0000
+++ libgusb-0.2.11/docs/api/gusb-sections.txt 2017-07-24 10:00:15.000000000 +0000
@@ -5,8 +5,11 @@
GUsbContext
GUsbContextClass
GUsbContextError
+GUsbContextFlags
g_usb_context_error_quark
g_usb_context_new
+g_usb_context_set_flags
+g_usb_context_get_flags
g_usb_context_get_source
g_usb_context_get_main_context
g_usb_context_set_main_context
diff -Nru libgusb-0.2.10/docs/api/html/faq.html libgusb-0.2.11/docs/api/html/faq.html
--- libgusb-0.2.10/docs/api/html/faq.html 2017-04-10 13:32:54.000000000 +0000
+++ libgusb-0.2.11/docs/api/html/faq.html 2017-07-24 10:00:15.000000000 +0000
@@ -3,7 +3,7 @@
Frequently asked questions: GUsb Reference Manual
-
+
diff -Nru libgusb-0.2.10/docs/api/html/GUsbContext.html libgusb-0.2.11/docs/api/html/GUsbContext.html
--- libgusb-0.2.10/docs/api/html/GUsbContext.html 2017-04-10 13:32:54.000000000 +0000
+++ libgusb-0.2.11/docs/api/html/GUsbContext.html 2017-07-24 10:00:15.000000000 +0000
@@ -3,7 +3,7 @@
GUsbContext: GUsb Reference Manual
-
+
@@ -61,6 +61,22 @@
+void
+ |
+
+g_usb_context_set_flags ()
+ |
+
+
+
+GUsbContextFlags
+ |
+
+g_usb_context_get_flags ()
+ |
+
+
+
GUsbSource *
|
@@ -211,6 +227,10 @@
| GUsbContextError |
+enum |
+GUsbContextFlags |
+
+
|
GUsbContextPrivate |
@@ -261,19 +281,78 @@
error |
-a GError, or NULL |
+a GError, or NULL |
|
Since: 0.1.0
+
+
+
g_usb_context_get_flags ()
+
GUsbContextFlags
+g_usb_context_get_flags (GUsbContext *context
);
+
Sets the flags to use for the context.
+
+
+
Since: 0.2.11
+
+
+
Since: 0.2.2
@@ -530,7 +609,7 @@
error |
-A GError or NULL |
+A GError or NULL |
|
@@ -538,7 +617,7 @@
Since: 0.2.2
@@ -572,7 +651,7 @@
error |
-A GError or NULL |
+A GError or NULL |
|
@@ -580,7 +659,7 @@
Since: 0.2.4
@@ -623,7 +702,7 @@
error |
-A GError or NULL |
+A GError or NULL |
|
@@ -631,7 +710,7 @@
Since: 0.2.9
@@ -680,6 +759,33 @@
+
+
+
enum GUsbContextFlags
+
The flags to use for the context.
+
+
GUsbContextPrivate
diff -Nru libgusb-0.2.10/docs/api/html/gusb.devhelp2 libgusb-0.2.11/docs/api/html/gusb.devhelp2
--- libgusb-0.2.10/docs/api/html/gusb.devhelp2 2017-04-10 13:32:54.000000000 +0000
+++ libgusb-0.2.11/docs/api/html/gusb.devhelp2 2017-07-24 10:00:15.000000000 +0000
@@ -25,6 +25,8 @@
+
+
@@ -39,6 +41,7 @@
+
@@ -128,6 +131,8 @@
+
+
diff -Nru libgusb-0.2.10/docs/api/html/GUsbDevice.html libgusb-0.2.11/docs/api/html/GUsbDevice.html
--- libgusb-0.2.10/docs/api/html/GUsbDevice.html 2017-04-10 13:32:54.000000000 +0000
+++ libgusb-0.2.11/docs/api/html/GUsbDevice.html 2017-07-24 10:00:15.000000000 +0000
@@ -3,7 +3,7 @@
GUsbDevice: GUsb Reference Manual
-
+
@@ -515,7 +515,7 @@
Since: 0.2.4
@@ -733,7 +733,7 @@
Returns
-
an string ID, or NULL
if not available.
+
an string ID, or NULL
if not available.
Since: 0.2.4
@@ -760,7 +760,7 @@
Returns
-
an string ID, or NULL
if not available.
+
an string ID, or NULL
if not available.
Since: 0.2.4
@@ -969,7 +969,7 @@
error |
-a GError, or NULL |
+a GError, or NULL |
|
@@ -1025,7 +1025,7 @@
error |
-a GError, or NULL |
+a GError, or NULL |
|
@@ -1033,7 +1033,7 @@
Since: 0.2.8
@@ -1061,7 +1061,7 @@
error |
-a GError, or NULL |
+a GError, or NULL |
|
@@ -1069,7 +1069,7 @@
Since: 0.2.8
@@ -1098,7 +1098,7 @@
error |
-a GError, or NULL |
+a GError, or NULL |
|
@@ -1133,7 +1133,7 @@
error |
-a GError, or NULL |
+a GError, or NULL |
|
@@ -1172,7 +1172,7 @@
error |
-a GError, or NULL |
+a GError, or NULL |
|
@@ -1207,7 +1207,7 @@
error |
-a GError, or NULL |
+a GError, or NULL |
|
@@ -1249,7 +1249,7 @@
error |
-a GError, or NULL |
+a GError, or NULL |
|
@@ -1296,7 +1296,7 @@
error |
-a GError, or NULL |
+a GError, or NULL |
|
@@ -1343,7 +1343,7 @@
error |
-a GError, or NULL |
+a GError, or NULL |
|
@@ -1390,7 +1390,7 @@
error |
-a GError, or NULL |
+a GError, or NULL |
|
@@ -1427,7 +1427,7 @@
error |
-a GError, or NULL |
+a GError, or NULL |
|
@@ -1505,7 +1505,7 @@
actual_length |
-the actual number of bytes sent, or NULL |
+the actual number of bytes sent, or NULL |
|
@@ -1517,12 +1517,12 @@
cancellable |
-a GCancellable, or NULL |
+a GCancellable, or NULL |
|
error |
-a GError, or NULL |
+a GError, or NULL |
|
@@ -1580,7 +1580,7 @@
actual_length |
-the actual number of bytes sent, or NULL |
+the actual number of bytes sent, or NULL |
|
@@ -1592,12 +1592,12 @@
cancellable |
-a GCancellable, or NULL |
+a GCancellable, or NULL |
|
error |
-a GError, or NULL |
+a GError, or NULL |
|
@@ -1655,7 +1655,7 @@
actual_length |
-the actual number of bytes sent, or NULL |
+the actual number of bytes sent, or NULL |
|
@@ -1667,12 +1667,12 @@
cancellable |
-a GCancellable, or NULL |
+a GCancellable, or NULL |
|
error |
-a GError, or NULL |
+a GError, or NULL |
|
@@ -1736,7 +1736,7 @@
cancellable |
-a GCancellable, or NULL |
+a GCancellable, or NULL |
|
@@ -1784,7 +1784,7 @@
error |
-A GError or NULL |
+A GError or NULL |
|
@@ -1848,7 +1848,7 @@
cancellable |
-a GCancellable, or NULL |
+a GCancellable, or NULL |
|
@@ -1896,7 +1896,7 @@
error |
-A GError or NULL |
+A GError or NULL |
|
@@ -1960,7 +1960,7 @@
cancellable |
-a GCancellable, or NULL |
+a GCancellable, or NULL |
|
@@ -2009,7 +2009,7 @@
error |
-A GError or NULL |
+A GError or NULL |
|
diff -Nru libgusb-0.2.10/docs/api/html/GUsbDeviceList.html libgusb-0.2.11/docs/api/html/GUsbDeviceList.html
--- libgusb-0.2.10/docs/api/html/GUsbDeviceList.html 2017-04-10 13:32:54.000000000 +0000
+++ libgusb-0.2.11/docs/api/html/GUsbDeviceList.html 2017-07-24 10:00:15.000000000 +0000
@@ -3,7 +3,7 @@
GUsbDeviceList: GUsb Reference Manual
-
+
@@ -275,7 +275,7 @@
error |
-A GError or NULL |
+A GError or NULL |
|
@@ -283,7 +283,7 @@
Since: 0.1.0
@@ -324,7 +324,7 @@
error |
-A GError or NULL |
+A GError or NULL |
|
@@ -332,7 +332,7 @@
Since: 0.1.0
diff -Nru libgusb-0.2.10/docs/api/html/gusb-gusb-interface.html libgusb-0.2.11/docs/api/html/gusb-gusb-interface.html
--- libgusb-0.2.10/docs/api/html/gusb-gusb-interface.html 2017-04-10 13:32:54.000000000 +0000
+++ libgusb-0.2.11/docs/api/html/gusb-gusb-interface.html 2017-07-24 10:00:15.000000000 +0000
@@ -3,7 +3,7 @@
gusb-interface: GUsb Reference Manual
-
+
@@ -388,7 +388,7 @@
Since: 0.2.8
diff -Nru libgusb-0.2.10/docs/api/html/gusb-gusb-source.html libgusb-0.2.11/docs/api/html/gusb-gusb-source.html
--- libgusb-0.2.10/docs/api/html/gusb-gusb-source.html 2017-04-10 13:32:54.000000000 +0000
+++ libgusb-0.2.11/docs/api/html/gusb-gusb-source.html 2017-07-24 10:00:15.000000000 +0000
@@ -3,7 +3,7 @@
gusb-source: GUsb Reference Manual
-
+
diff -Nru libgusb-0.2.10/docs/api/html/gusb-gusb-version.html libgusb-0.2.11/docs/api/html/gusb-gusb-version.html
--- libgusb-0.2.10/docs/api/html/gusb-gusb-version.html 2017-04-10 13:32:54.000000000 +0000
+++ libgusb-0.2.11/docs/api/html/gusb-gusb-version.html 2017-07-24 10:00:15.000000000 +0000
@@ -3,7 +3,7 @@
gusb-version: GUsb Reference Manual
-
+
@@ -101,7 +101,7 @@
G_USB_MICRO_VERSION
-
#define G_USB_MICRO_VERSION (10)
+#define G_USB_MICRO_VERSION (11)
The compile-time micro version
diff -Nru libgusb-0.2.10/docs/api/html/index.html libgusb-0.2.11/docs/api/html/index.html
--- libgusb-0.2.10/docs/api/html/index.html 2017-04-10 13:32:54.000000000 +0000
+++ libgusb-0.2.11/docs/api/html/index.html 2017-07-24 10:00:15.000000000 +0000
@@ -3,7 +3,7 @@
GUsb Reference Manual: GUsb Reference Manual
-
+
@@ -23,7 +23,7 @@
- for GUsb 0.2.10
+ for GUsb 0.2.11
Copyright © 2011 Richard Hughes
diff -Nru libgusb-0.2.10/docs/api/html/introduction.html libgusb-0.2.11/docs/api/html/introduction.html
--- libgusb-0.2.10/docs/api/html/introduction.html 2017-04-10 13:32:54.000000000 +0000
+++ libgusb-0.2.11/docs/api/html/introduction.html 2017-07-24 10:00:15.000000000 +0000
@@ -3,7 +3,7 @@
GUSB Introduction: GUsb Reference Manual
-
+
diff -Nru libgusb-0.2.10/docs/api/html/libgusb-helpers.html libgusb-0.2.11/docs/api/html/libgusb-helpers.html
--- libgusb-0.2.10/docs/api/html/libgusb-helpers.html 2017-04-10 13:32:54.000000000 +0000
+++ libgusb-0.2.11/docs/api/html/libgusb-helpers.html 2017-07-24 10:00:15.000000000 +0000
@@ -3,7 +3,7 @@
libgusb glib helpers: GUsb Reference Manual
-
+
diff -Nru libgusb-0.2.10/docs/api/html/libgusb.html libgusb-0.2.11/docs/api/html/libgusb.html
--- libgusb-0.2.10/docs/api/html/libgusb.html 2017-04-10 13:32:54.000000000 +0000
+++ libgusb-0.2.11/docs/api/html/libgusb.html 2017-07-24 10:00:15.000000000 +0000
@@ -3,7 +3,7 @@
libgusb GObject library: GUsb Reference Manual
-
+
diff -Nru libgusb-0.2.10/docs/api/html/specification.html libgusb-0.2.11/docs/api/html/specification.html
--- libgusb-0.2.10/docs/api/html/specification.html 2017-04-10 13:32:54.000000000 +0000
+++ libgusb-0.2.11/docs/api/html/specification.html 2017-07-24 10:00:15.000000000 +0000
@@ -3,7 +3,7 @@
GUSB Specification: GUsb Reference Manual
-
+
diff -Nru libgusb-0.2.10/docs/api/version.xml libgusb-0.2.11/docs/api/version.xml
--- libgusb-0.2.10/docs/api/version.xml 2017-03-24 15:46:18.000000000 +0000
+++ libgusb-0.2.11/docs/api/version.xml 2017-06-08 15:34:59.000000000 +0000
@@ -1 +1 @@
-0.2.10
+0.2.11
diff -Nru libgusb-0.2.10/gusb/gusb-context.c libgusb-0.2.11/gusb/gusb-context.c
--- libgusb-0.2.10/gusb/gusb-context.c 2017-03-27 08:10:01.000000000 +0000
+++ libgusb-0.2.11/gusb/gusb-context.c 2017-07-24 09:57:16.000000000 +0000
@@ -64,6 +64,7 @@
volatile gint thread_event_run;
guint hotplug_poll_id;
int debug_level;
+ GUsbContextFlags flags;
libusb_context *ctx;
libusb_hotplug_callback_handle hotplug_id;
};
@@ -324,6 +325,15 @@
goto out;
}
+ /* auto-open */
+ if (priv->flags & G_USB_CONTEXT_FLAGS_AUTO_OPEN_DEVICES) {
+ if (!_g_usb_device_open_internal (device, &error)) {
+ g_warning ("cannot open the device: %s", error->message);
+ g_error_free (error);
+ goto out;
+ }
+ }
+
/* add to enumerated list */
g_ptr_array_add (priv->devices, g_object_ref (device));
@@ -527,6 +537,38 @@
priv->done_enumerate = TRUE;
}
+/**
+ * g_usb_context_set_flags:
+ * @context: a #GUsbContext
+ * @flags: some #GUsbContextFlags, e.g. %G_USB_CONTEXT_FLAGS_AUTO_OPEN_DEVICES
+ *
+ * Sets the flags to use for the context. These should be set before
+ * g_usb_context_enumerate() is called.
+ *
+ * Since: 0.2.11
+ **/
+void
+g_usb_context_set_flags (GUsbContext *context, GUsbContextFlags flags)
+{
+ context->priv->flags = flags;
+}
+
+/**
+ * g_usb_context_get_flags:
+ * @context: a #GUsbContext
+ *
+ * Sets the flags to use for the context.
+ *
+ * Return value: the #GUsbContextFlags, e.g. %G_USB_CONTEXT_FLAGS_AUTO_OPEN_DEVICES
+ *
+ * Since: 0.2.11
+ **/
+GUsbContextFlags
+g_usb_context_get_flags (GUsbContext *context)
+{
+ return context->priv->flags;
+}
+
static gpointer
g_usb_context_event_thread_cb (gpointer data)
{
@@ -545,6 +587,7 @@
GUsbContextPrivate *priv;
priv = context->priv = g_usb_context_get_instance_private (context);
+ priv->flags = G_USB_CONTEXT_FLAGS_NONE;
priv->devices = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
priv->dict_usb_ids = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
priv->dict_replug = g_hash_table_new_full (g_str_hash, g_str_equal,
diff -Nru libgusb-0.2.10/gusb/gusb-context.h libgusb-0.2.11/gusb/gusb-context.h
--- libgusb-0.2.10/gusb/gusb-context.h 2016-03-11 08:25:06.000000000 +0000
+++ libgusb-0.2.11/gusb/gusb-context.h 2017-07-23 20:05:55.000000000 +0000
@@ -63,11 +63,27 @@
G_USB_CONTEXT_ERROR_INTERNAL
} GUsbContextError;
+/**
+ * GUsbContextFlags:
+ *
+ * The flags to use for the context.
+ **/
+typedef enum {
+ G_USB_CONTEXT_FLAGS_NONE = 0,
+ G_USB_CONTEXT_FLAGS_AUTO_OPEN_DEVICES = 1 << 0,
+ /*< private >*/
+ G_USB_CONTEXT_FLAGS_LAST
+} GUsbContextFlags;
+
GType g_usb_context_get_type (void);
GQuark g_usb_context_error_quark (void);
GUsbContext *g_usb_context_new (GError **error);
+void g_usb_context_set_flags (GUsbContext *context,
+ GUsbContextFlags flags);
+GUsbContextFlags g_usb_context_get_flags (GUsbContext *context);
+
G_DEPRECATED
GUsbSource *g_usb_context_get_source (GUsbContext *context,
GMainContext *main_ctx);
diff -Nru libgusb-0.2.10/gusb/gusb-device.c libgusb-0.2.11/gusb/gusb-device.c
--- libgusb-0.2.10/gusb/gusb-device.c 2017-03-24 16:36:54.000000000 +0000
+++ libgusb-0.2.11/gusb/gusb-device.c 2017-07-24 09:57:49.000000000 +0000
@@ -390,6 +390,26 @@
g_usb_device_get_pid (device));
}
+gboolean
+_g_usb_device_open_internal (GUsbDevice *device, GError **error)
+{
+ gint rc;
+
+ if (device->priv->handle != NULL) {
+ g_set_error (error,
+ G_USB_DEVICE_ERROR,
+ G_USB_DEVICE_ERROR_ALREADY_OPEN,
+ "Device %04x:%04x is already open",
+ g_usb_device_get_vid (device),
+ g_usb_device_get_pid (device));
+ return FALSE;
+ }
+
+ /* open device */
+ rc = libusb_open (device->priv->device, &device->priv->handle);
+ return g_usb_device_libusb_error_to_gerror (device, rc, error);
+}
+
/**
* g_usb_device_open:
* @device: a #GUsbDevice
@@ -404,27 +424,17 @@
* Since: 0.1.0
**/
gboolean
-g_usb_device_open (GUsbDevice *device,
- GError **error)
+g_usb_device_open (GUsbDevice *device, GError **error)
{
- gint rc;
-
g_return_val_if_fail (G_USB_IS_DEVICE (device), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
- if (device->priv->handle != NULL) {
- g_set_error (error,
- G_USB_DEVICE_ERROR,
- G_USB_DEVICE_ERROR_ALREADY_OPEN,
- "Device %04x:%04x is already open",
- g_usb_device_get_vid (device),
- g_usb_device_get_pid (device));
- return FALSE;
- }
+ /* ignore */
+ if (g_usb_context_get_flags (device->priv->context) & G_USB_CONTEXT_FLAGS_AUTO_OPEN_DEVICES)
+ return TRUE;
- /* open device */
- rc = libusb_open (device->priv->device, &device->priv->handle);
- return g_usb_device_libusb_error_to_gerror (device, rc, error);
+ /* open */
+ return _g_usb_device_open_internal (device, error);
}
/**
@@ -608,6 +618,10 @@
g_return_val_if_fail (G_USB_IS_DEVICE (device), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+ /* ignore */
+ if (g_usb_context_get_flags (device->priv->context) & G_USB_CONTEXT_FLAGS_AUTO_OPEN_DEVICES)
+ return TRUE;
+
if (device->priv->handle == NULL)
return g_usb_device_not_open_error (device, error);
diff -Nru libgusb-0.2.10/gusb/gusb-device-private.h libgusb-0.2.11/gusb/gusb-device-private.h
--- libgusb-0.2.10/gusb/gusb-device-private.h 2015-04-22 09:55:07.000000000 +0000
+++ libgusb-0.2.11/gusb/gusb-device-private.h 2017-07-23 20:05:55.000000000 +0000
@@ -30,6 +30,8 @@
GError **error);
libusb_device *_g_usb_device_get_device (GUsbDevice *device);
+gboolean _g_usb_device_open_internal (GUsbDevice *device,
+ GError **error);
G_END_DECLS
diff -Nru libgusb-0.2.10/gusb/gusb-version.h libgusb-0.2.11/gusb/gusb-version.h
--- libgusb-0.2.10/gusb/gusb-version.h 2017-03-24 15:46:18.000000000 +0000
+++ libgusb-0.2.11/gusb/gusb-version.h 2017-06-08 15:34:59.000000000 +0000
@@ -53,7 +53,7 @@
*
* The compile-time micro version
*/
-#define G_USB_MICRO_VERSION (10)
+#define G_USB_MICRO_VERSION (11)
/**
* G_USB_CHECK_VERSION:
diff -Nru libgusb-0.2.10/gusb/libgusb.ver libgusb-0.2.11/gusb/libgusb.ver
--- libgusb-0.2.10/gusb/libgusb.ver 2016-05-31 08:33:53.000000000 +0000
+++ libgusb-0.2.11/gusb/libgusb.ver 2017-07-23 20:05:55.000000000 +0000
@@ -62,3 +62,9 @@
global:
g_usb_context_wait_for_replug;
} LIBGUSB_0.2.8;
+
+LIBGUSB_0.2.11 {
+ global:
+ g_usb_context_set_flags;
+ g_usb_context_get_flags;
+} LIBGUSB_0.2.9;
diff -Nru libgusb-0.2.10/Makefile.in libgusb-0.2.11/Makefile.in
--- libgusb-0.2.10/Makefile.in 2017-03-24 15:46:16.000000000 +0000
+++ libgusb-0.2.11/Makefile.in 2017-06-08 15:34:56.000000000 +0000
@@ -169,7 +169,7 @@
$(top_srcdir)/build-aux/ltmain.sh \
$(top_srcdir)/build-aux/missing AUTHORS COPYING ChangeLog \
INSTALL NEWS README TODO build-aux/compile \
- build-aux/config.guess build-aux/config.sub \
+ build-aux/config.guess build-aux/config.sub build-aux/depcomp \
build-aux/install-sh build-aux/ltmain.sh build-aux/missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
diff -Nru libgusb-0.2.10/NEWS libgusb-0.2.11/NEWS
--- libgusb-0.2.10/NEWS 2017-04-10 13:31:37.000000000 +0000
+++ libgusb-0.2.11/NEWS 2017-07-24 09:59:19.000000000 +0000
@@ -1,3 +1,13 @@
+Version 0.2.11
+~~~~~~~~~~~~~~
+Released: 2017-07-24
+
+New Features:
+ - Add g_usb_context_set_flags() (Richard Hughes)
+
+Bugfixes:
+ - Fix the actual required GLib version (Richard Hughes)
+
Version 0.2.10
~~~~~~~~~~~~~~
Released: 2017-04-10
diff -Nru libgusb-0.2.10/tools/gusb-main.c libgusb-0.2.11/tools/gusb-main.c
--- libgusb-0.2.10/tools/gusb-main.c 2016-03-11 08:25:06.000000000 +0000
+++ libgusb-0.2.11/tools/gusb-main.c 2017-07-23 20:05:55.000000000 +0000
@@ -158,6 +158,32 @@
return g_string_free (string, FALSE);
}
+static void
+gusb_main_device_open (GUsbDevice *device)
+{
+ GError *error = NULL;
+ guint8 idx;
+
+ /* open */
+ if (!g_usb_device_open (device, &error)) {
+ g_print ("failed to open: %s\n", error->message);
+ g_error_free (error);
+ return;
+ }
+
+ /* print info we can only get whilst open */
+ idx = g_usb_device_get_product_index (device);
+ if (idx != 0x00) {
+ gchar *product = g_usb_device_get_string_descriptor (device, idx, &error);
+ if (product == NULL) {
+ g_print ("failed to get string desc: %s\n", error->message);
+ g_error_free (error);
+ return;
+ }
+ g_print ("product: %s\n", product);
+ }
+}
+
/**
* gusb_device_list_added_cb:
**/
@@ -170,6 +196,7 @@
g_usb_device_get_platform_id (device),
g_usb_device_get_bus (device),
g_usb_device_get_address (device));
+ gusb_main_device_open (device);
}
/**
@@ -339,6 +366,7 @@
g_usb_device_get_platform_id (device),
g_usb_device_get_bus (device),
g_usb_device_get_address (device));
+ gusb_main_device_open (device);
}
loop = g_main_loop_new (NULL, FALSE);
@@ -478,6 +506,7 @@
/* GUsbContext */
priv->usb_ctx = g_usb_context_new (NULL);
+ g_usb_context_set_flags (priv->usb_ctx, G_USB_CONTEXT_FLAGS_AUTO_OPEN_DEVICES);
/* add commands */
priv->cmd_array = g_ptr_array_new_with_free_func ((GDestroyNotify) gusb_cmd_item_free);