Hello community,
here is the log from the commit of package libgusb for openSUSE:Factory checked in at 2016-04-05 10:42:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libgusb (Old)
and /work/SRC/openSUSE:Factory/.libgusb.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libgusb"
Changes:
--------
--- /work/SRC/openSUSE:Factory/libgusb/libgusb.changes 2015-12-17 15:54:14.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.libgusb.new/libgusb.changes 2016-04-05 10:42:27.000000000 +0200
@@ -1,0 +2,7 @@
+Wed Mar 23 17:10:18 UTC 2016 - zaitor@opensuse.org
+
+- Update to version 0.2.9:
+ + Add g_usb_context_wait_for_replug().
+ + Install gusbcmd as a debugging aid.
+
+-------------------------------------------------------------------
Old:
----
libgusb-0.2.8.tar.xz
New:
----
libgusb-0.2.9.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libgusb.spec ++++++
--- /var/tmp/diff_new_pack.gHKJnW/_old 2016-04-05 10:42:28.000000000 +0200
+++ /var/tmp/diff_new_pack.gHKJnW/_new 2016-04-05 10:42:28.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package libgusb
#
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
Name: libgusb
-Version: 0.2.8
+Version: 0.2.9
Release: 0
Summary: GObject-based library for libusb1
License: LGPL-2.1+
@@ -93,6 +93,7 @@
%files devel
%defattr(-,root,root,-)
+%{_bindir}/gusbcmd
%{_datadir}/gir-1.0/GUsb-1.0.gir
%dir %{_datadir}/vala/vapi
%{_datadir}/vala/vapi/gusb.vapi
++++++ libgusb-0.2.8.tar.xz -> libgusb-0.2.9.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgusb-0.2.8/NEWS new/libgusb-0.2.9/NEWS
--- old/libgusb-0.2.8/NEWS 2015-12-01 19:21:10.000000000 +0100
+++ new/libgusb-0.2.9/NEWS 2016-03-21 11:40:16.000000000 +0100
@@ -1,3 +1,11 @@
+Version 0.2.9
+~~~~~~~~~~~~~
+Released: 2016-03-21
+
+New Features:
+ - Add g_usb_context_wait_for_replug() (Richard Hughes)
+ - Install gusbcmd as a debugging aid (Richard Hughes)
+
Version 0.2.8
~~~~~~~~~~~~~
Released: 2015-12-01
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgusb-0.2.8/config.h new/libgusb-0.2.9/config.h
--- old/libgusb-0.2.8/config.h 2015-11-10 12:30:10.000000000 +0100
+++ new/libgusb-0.2.9/config.h 2016-02-19 13:01:05.000000000 +0100
@@ -44,7 +44,7 @@
#define PACKAGE_NAME "libgusb"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "libgusb 0.2.8"
+#define PACKAGE_STRING "libgusb 0.2.9"
/* 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.8"
+#define PACKAGE_VERSION "0.2.9"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Version number of package */
-#define VERSION "0.2.8"
+#define VERSION "0.2.9"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgusb-0.2.8/configure new/libgusb-0.2.9/configure
--- old/libgusb-0.2.8/configure 2015-12-01 19:21:30.000000000 +0100
+++ new/libgusb-0.2.9/configure 2016-02-19 13:01:04.000000000 +0100
@@ -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.8.
+# Generated by GNU Autoconf 2.69 for libgusb 0.2.9.
#
# Report bugs to http://www.hughsie.com.
#
@@ -590,8 +590,8 @@
# Identity of this package.
PACKAGE_NAME='libgusb'
PACKAGE_TARNAME='libgusb'
-PACKAGE_VERSION='0.2.8'
-PACKAGE_STRING='libgusb 0.2.8'
+PACKAGE_VERSION='0.2.9'
+PACKAGE_STRING='libgusb 0.2.9'
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.8 to adapt to many kinds of systems.
+\`configure' configures libgusb 0.2.9 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.8:";;
+ short | recursive ) echo "Configuration of libgusb 0.2.9:";;
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.8
+libgusb configure 0.2.9
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.8, which was
+It was created by libgusb $as_me 0.2.9, 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.8'
+ VERSION='0.2.9'
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=8
+G_USB_MICRO_VERSION=9
@@ -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.8, which was
+This file was extended by libgusb $as_me 0.2.9, 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.8
+libgusb config.status 0.2.9
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgusb-0.2.8/configure.ac new/libgusb-0.2.9/configure.ac
--- old/libgusb-0.2.8/configure.ac 2015-12-01 19:21:22.000000000 +0100
+++ new/libgusb-0.2.9/configure.ac 2015-12-01 19:22:54.000000000 +0100
@@ -3,7 +3,7 @@
m4_define([gusb_major_version], [0])
m4_define([gusb_minor_version], [2])
-m4_define([gusb_micro_version], [8])
+m4_define([gusb_micro_version], [9])
m4_define([gusb_version],
[gusb_major_version.gusb_minor_version.gusb_micro_version])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgusb-0.2.8/docs/api/html/gusb-gusb-version.html new/libgusb-0.2.9/docs/api/html/gusb-gusb-version.html
--- old/libgusb-0.2.8/docs/api/html/gusb-gusb-version.html 2015-12-01 19:22:32.000000000 +0100
+++ new/libgusb-0.2.9/docs/api/html/gusb-gusb-version.html 2016-03-21 11:41:59.000000000 +0100
@@ -101,7 +101,7 @@
<hr>
<div class="refsect2">
<a name="G-USB-MICRO-VERSION:CAPS"></a><h3>G_USB_MICRO_VERSION</h3>
-<pre class="programlisting">#define G_USB_MICRO_VERSION (8)
+<pre class="programlisting">#define G_USB_MICRO_VERSION (9)
</pre>
<p>The compile-time micro version</p>
</div>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgusb-0.2.8/docs/api/html/index.html new/libgusb-0.2.9/docs/api/html/index.html
--- old/libgusb-0.2.8/docs/api/html/index.html 2015-12-01 19:22:32.000000000 +0100
+++ new/libgusb-0.2.9/docs/api/html/index.html 2016-03-21 11:41:59.000000000 +0100
@@ -23,7 +23,7 @@
</p></div></div>
</div></div></div>
<div><p class="releaseinfo">
- for GUsb 0.2.8
+ for GUsb 0.2.9
</p></div>
<div><p class="copyright">Copyright © 2011 Richard Hughes</p></div>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgusb-0.2.8/docs/api/version.xml new/libgusb-0.2.9/docs/api/version.xml
--- old/libgusb-0.2.8/docs/api/version.xml 2015-12-01 19:21:32.000000000 +0100
+++ new/libgusb-0.2.9/docs/api/version.xml 2016-02-19 13:01:05.000000000 +0100
@@ -1 +1 @@
-0.2.8
+0.2.9
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgusb-0.2.8/gusb/gusb-context.c new/libgusb-0.2.9/gusb/gusb-context.c
--- old/libgusb-0.2.8/gusb/gusb-context.c 2015-08-03 09:46:20.000000000 +0200
+++ new/libgusb-0.2.9/gusb/gusb-context.c 2016-03-11 10:47:35.000000000 +0100
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
- * Copyright (C) 2011-2014 Richard Hughes
+ * Copyright (C) 2011-2016 Richard Hughes
* Copyright (C) 2011 Hans de Goede
*
* Licensed under the GNU Lesser General Public License Version 2.1
@@ -58,6 +58,7 @@
GMainContext *main_ctx;
GPtrArray *devices;
GHashTable *dict_usb_ids;
+ GHashTable *dict_replug;
GThread *thread_event;
gboolean done_enumerate;
volatile gint thread_event_run;
@@ -67,6 +68,12 @@
libusb_hotplug_callback_handle hotplug_id;
};
+typedef struct {
+ GMainLoop *loop;
+ GUsbDevice *device;
+ guint timeout_id;
+} GUsbContextReplugHelper;
+
static guint signals[LAST_SIGNAL] = { 0 };
static GParamSpec *pspecs[N_PROPERTIES] = { NULL, };
@@ -78,6 +85,19 @@
g_usb_context_initable_iface_init))
/**
+ * g_usb_context_replug_helper_free:
+ **/
+static void
+g_usb_context_replug_helper_free (GUsbContextReplugHelper *replug_helper)
+{
+ if (replug_helper->timeout_id != 0)
+ g_source_remove (replug_helper->timeout_id);
+ g_main_loop_unref (replug_helper->loop);
+ g_object_unref (replug_helper->device);
+ g_free (replug_helper);
+}
+
+/**
* g_usb_context_error_quark:
*
* Return value: Our personal error quark.
@@ -106,6 +126,7 @@
g_clear_pointer (&priv->main_ctx, g_main_context_unref);
g_clear_pointer (&priv->devices, g_ptr_array_unref);
g_clear_pointer (&priv->dict_usb_ids, g_hash_table_unref);
+ g_clear_pointer (&priv->dict_replug, g_hash_table_unref);
g_clear_pointer (&priv->ctx, libusb_exit);
G_OBJECT_CLASS (g_usb_context_parent_class)->dispose (object);
@@ -277,6 +298,8 @@
{
GUsbDevice *device = NULL;
GUsbContextPrivate *priv = context->priv;
+ GUsbContextReplugHelper *replug_helper;
+ const gchar *platform_id;
guint8 bus;
guint8 address;
GError *error = NULL;
@@ -300,7 +323,22 @@
g_error_free (error);
goto out;
}
+
+ /* add to enumerated list */
g_ptr_array_add (priv->devices, g_object_ref (device));
+
+ /* if we're waiting for replug, suppress the signal */
+ platform_id = g_usb_device_get_platform_id (device);
+ replug_helper = g_hash_table_lookup (priv->dict_replug, platform_id);
+ if (replug_helper != NULL) {
+ g_debug ("%s is in replug, ignoring add", platform_id);
+ g_object_unref (replug_helper->device);
+ replug_helper->device = g_object_ref (device);
+ g_main_loop_quit (replug_helper->loop);
+ goto out;
+ }
+
+ /* emit signal */
g_usb_context_emit_device_add (context, device);
out:
if (device != NULL)
@@ -313,6 +351,8 @@
{
GUsbDevice *device = NULL;
GUsbContextPrivate *priv = context->priv;
+ GUsbContextReplugHelper *replug_helper;
+ const gchar *platform_id;
guint8 bus;
guint8 address;
@@ -324,8 +364,21 @@
g_debug ("%i:%i does not exist", bus, address);
return;
}
- g_usb_context_emit_device_remove (context, device);
+
+ /* remove from enumerated list */
g_ptr_array_remove (priv->devices, device);
+
+ /* if we're waiting for replug, suppress the signal */
+ platform_id = g_usb_device_get_platform_id (device);
+ replug_helper = g_hash_table_lookup (priv->dict_replug, platform_id);
+ if (replug_helper != NULL) {
+ g_debug ("%s is in replug, ignoring remove", platform_id);
+ goto out;
+ }
+
+ /* emit signal */
+ g_usb_context_emit_device_remove (context, device);
+out:
g_object_unref (device);
}
@@ -494,6 +547,8 @@
priv = context->priv = g_usb_context_get_instance_private (context);
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,
+ g_free, NULL);
}
static gboolean
@@ -933,6 +988,82 @@
}
/**
+ * g_usb_context_replug_timeout_cb:
+ **/
+static gboolean
+g_usb_context_replug_timeout_cb (gpointer user_data)
+{
+ GUsbContextReplugHelper *replug_helper = (GUsbContextReplugHelper *) user_data;
+ replug_helper->timeout_id = 0;
+ g_main_loop_quit (replug_helper->loop);
+ return FALSE;
+}
+
+/**
+ * g_usb_context_wait_for_replug:
+ * @context: a #GUsbContext
+ * @device: a #GUsbDevice
+ * @timeout_ms: timeout to wait
+ * @error: A #GError or %NULL
+ *
+ * Waits for the device to be replugged.
+ * It may come back with a different VID:PID.
+ *
+ * Warning: This is syncronous and blocks until the device comes
+ * back or the timeout triggers.
+ *
+ * Return value: (transfer full): a new #GUsbDevice, or %NULL for invalid
+ *
+ * Since: 0.2.9
+ **/
+GUsbDevice *
+g_usb_context_wait_for_replug (GUsbContext *context,
+ GUsbDevice *device,
+ guint timeout_ms,
+ GError **error)
+{
+ GUsbDevice *device_new = NULL;
+ GUsbContextPrivate *priv = context->priv;
+ GUsbContextReplugHelper *replug_helper;
+ const gchar *platform_id;
+
+ g_return_val_if_fail (G_USB_IS_CONTEXT (context), NULL);
+
+ /* create a helper */
+ replug_helper = g_new0 (GUsbContextReplugHelper, 1);
+ replug_helper->device = g_object_ref (device);
+ replug_helper->loop = g_main_loop_new (priv->main_ctx, FALSE);
+ replug_helper->timeout_id = g_timeout_add (timeout_ms,
+ g_usb_context_replug_timeout_cb,
+ replug_helper);
+
+ /* register */
+ platform_id = g_usb_device_get_platform_id (device);
+ g_hash_table_insert (priv->dict_replug,
+ g_strdup (platform_id), replug_helper);
+
+ /* wait for timeout, or replug */
+ g_main_loop_run (replug_helper->loop);
+
+ /* unregister */
+ g_hash_table_remove (priv->dict_replug, platform_id);
+
+ /* so we timed out; emit the removal now */
+ if (replug_helper->timeout_id == 0) {
+ g_usb_context_emit_device_remove (context, replug_helper->device);
+ g_set_error_literal (error,
+ G_USB_CONTEXT_ERROR,
+ G_USB_CONTEXT_ERROR_INTERNAL,
+ "request timed out");
+ goto out;
+ }
+ device_new = g_object_ref (replug_helper->device);
+out:
+ g_usb_context_replug_helper_free (replug_helper);
+ return device_new;
+}
+
+/**
* g_usb_context_new:
* @error: a #GError, or %NULL
*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgusb-0.2.8/gusb/gusb-context.h new/libgusb-0.2.9/gusb/gusb-context.h
--- old/libgusb-0.2.8/gusb/gusb-context.h 2015-05-26 21:55:38.000000000 +0200
+++ new/libgusb-0.2.9/gusb/gusb-context.h 2016-03-11 09:25:06.000000000 +0100
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
- * Copyright (C) 2011-2014 Richard Hughes
+ * Copyright (C) 2011-2016 Richard Hughes
* Copyright (C) 2011 Hans de Goede
*
* Licensed under the GNU Lesser General Public License Version 2.1
@@ -94,6 +94,11 @@
const gchar *platform_id,
GError **error);
+GUsbDevice *g_usb_context_wait_for_replug (GUsbContext *context,
+ GUsbDevice *device,
+ guint timeout_ms,
+ GError **error);
+
G_END_DECLS
#endif /* __GUSB_CONTEXT_H__ */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgusb-0.2.8/gusb/gusb-device.c new/libgusb-0.2.9/gusb/gusb-device.c
--- old/libgusb-0.2.8/gusb/gusb-device.c 2015-11-25 15:00:44.000000000 +0100
+++ new/libgusb-0.2.9/gusb/gusb-device.c 2016-03-11 09:25:06.000000000 +0100
@@ -456,7 +456,7 @@
rc = libusb_get_active_config_descriptor (device->priv->device, &config);
if (!g_usb_device_libusb_error_to_gerror (device, rc, error))
- return NULL;
+ return 0x00;
/* find the right data */
for (i = 0; i < config->bNumInterfaces; i++) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgusb-0.2.8/gusb/gusb-version.h new/libgusb-0.2.9/gusb/gusb-version.h
--- old/libgusb-0.2.8/gusb/gusb-version.h 2015-12-01 19:21:32.000000000 +0100
+++ new/libgusb-0.2.9/gusb/gusb-version.h 2016-02-19 13:01:05.000000000 +0100
@@ -53,7 +53,7 @@
*
* The compile-time micro version
*/
-#define G_USB_MICRO_VERSION (8)
+#define G_USB_MICRO_VERSION (9)
/**
* G_USB_CHECK_VERSION:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgusb-0.2.8/tools/Makefile.am new/libgusb-0.2.9/tools/Makefile.am
--- old/libgusb-0.2.8/tools/Makefile.am 2015-04-22 11:55:07.000000000 +0200
+++ new/libgusb-0.2.9/tools/Makefile.am 2016-02-19 13:00:48.000000000 +0100
@@ -16,19 +16,19 @@
GUSB_LIBS = \
$(top_builddir)/gusb/libgusb.la
-noinst_PROGRAMS = \
- gusb
+bin_PROGRAMS = \
+ gusbcmd
-gusb_SOURCES = \
+gusbcmd_SOURCES = \
gusb-main.c
-gusb_LDADD = \
+gusbcmd_LDADD = \
$(USB_LIBS) \
$(GLIB_LIBS) \
$(GUDEV_LIBS) \
$(GUSB_LIBS)
-gusb_CFLAGS = \
+gusbcmd_CFLAGS = \
$(WARNINGFLAGS_C)
clean-local:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgusb-0.2.8/tools/Makefile.in new/libgusb-0.2.9/tools/Makefile.in
--- old/libgusb-0.2.8/tools/Makefile.in 2015-12-01 19:21:30.000000000 +0100
+++ new/libgusb-0.2.9/tools/Makefile.in 2016-02-19 13:01:04.000000000 +0100
@@ -88,7 +88,7 @@
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-noinst_PROGRAMS = gusb$(EXEEXT)
+bin_PROGRAMS = gusbcmd$(EXEEXT)
subdir = tools
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \
@@ -103,19 +103,20 @@
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
-PROGRAMS = $(noinst_PROGRAMS)
-am_gusb_OBJECTS = gusb-gusb-main.$(OBJEXT)
-gusb_OBJECTS = $(am_gusb_OBJECTS)
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_gusbcmd_OBJECTS = gusbcmd-gusb-main.$(OBJEXT)
+gusbcmd_OBJECTS = $(am_gusbcmd_OBJECTS)
am__DEPENDENCIES_1 =
-gusb_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+gusbcmd_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(GUSB_LIBS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
-gusb_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(gusb_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
+gusbcmd_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(gusbcmd_CFLAGS) \
+ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@@ -150,8 +151,8 @@
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
-SOURCES = $(gusb_SOURCES)
-DIST_SOURCES = $(gusb_SOURCES)
+SOURCES = $(gusbcmd_SOURCES)
+DIST_SOURCES = $(gusbcmd_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -345,16 +346,16 @@
GUSB_LIBS = \
$(top_builddir)/gusb/libgusb.la
-gusb_SOURCES = \
+gusbcmd_SOURCES = \
gusb-main.c
-gusb_LDADD = \
+gusbcmd_LDADD = \
$(USB_LIBS) \
$(GLIB_LIBS) \
$(GUDEV_LIBS) \
$(GUSB_LIBS)
-gusb_CFLAGS = \
+gusbcmd_CFLAGS = \
$(WARNINGFLAGS_C)
CLEANFILES = $(BUILT_SOURCES)
@@ -396,9 +397,49 @@
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ || test -f $$p1 \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
-clean-noinstPROGRAMS:
- @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
echo " rm -f" $$list; \
rm -f $$list || exit $$?; \
test -n "$(EXEEXT)" || exit 0; \
@@ -406,9 +447,9 @@
echo " rm -f" $$list; \
rm -f $$list
-gusb$(EXEEXT): $(gusb_OBJECTS) $(gusb_DEPENDENCIES) $(EXTRA_gusb_DEPENDENCIES)
- @rm -f gusb$(EXEEXT)
- $(AM_V_CCLD)$(gusb_LINK) $(gusb_OBJECTS) $(gusb_LDADD) $(LIBS)
+gusbcmd$(EXEEXT): $(gusbcmd_OBJECTS) $(gusbcmd_DEPENDENCIES) $(EXTRA_gusbcmd_DEPENDENCIES)
+ @rm -f gusbcmd$(EXEEXT)
+ $(AM_V_CCLD)$(gusbcmd_LINK) $(gusbcmd_OBJECTS) $(gusbcmd_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -416,7 +457,7 @@
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gusb-gusb-main.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gusbcmd-gusb-main.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -439,19 +480,19 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-gusb-gusb-main.o: gusb-main.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gusb_CFLAGS) $(CFLAGS) -MT gusb-gusb-main.o -MD -MP -MF $(DEPDIR)/gusb-gusb-main.Tpo -c -o gusb-gusb-main.o `test -f 'gusb-main.c' || echo '$(srcdir)/'`gusb-main.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gusb-gusb-main.Tpo $(DEPDIR)/gusb-gusb-main.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gusb-main.c' object='gusb-gusb-main.o' libtool=no @AMDEPBACKSLASH@
+gusbcmd-gusb-main.o: gusb-main.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gusbcmd_CFLAGS) $(CFLAGS) -MT gusbcmd-gusb-main.o -MD -MP -MF $(DEPDIR)/gusbcmd-gusb-main.Tpo -c -o gusbcmd-gusb-main.o `test -f 'gusb-main.c' || echo '$(srcdir)/'`gusb-main.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gusbcmd-gusb-main.Tpo $(DEPDIR)/gusbcmd-gusb-main.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gusb-main.c' object='gusbcmd-gusb-main.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gusb_CFLAGS) $(CFLAGS) -c -o gusb-gusb-main.o `test -f 'gusb-main.c' || echo '$(srcdir)/'`gusb-main.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gusbcmd_CFLAGS) $(CFLAGS) -c -o gusbcmd-gusb-main.o `test -f 'gusb-main.c' || echo '$(srcdir)/'`gusb-main.c
-gusb-gusb-main.obj: gusb-main.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gusb_CFLAGS) $(CFLAGS) -MT gusb-gusb-main.obj -MD -MP -MF $(DEPDIR)/gusb-gusb-main.Tpo -c -o gusb-gusb-main.obj `if test -f 'gusb-main.c'; then $(CYGPATH_W) 'gusb-main.c'; else $(CYGPATH_W) '$(srcdir)/gusb-main.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gusb-gusb-main.Tpo $(DEPDIR)/gusb-gusb-main.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gusb-main.c' object='gusb-gusb-main.obj' libtool=no @AMDEPBACKSLASH@
+gusbcmd-gusb-main.obj: gusb-main.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gusbcmd_CFLAGS) $(CFLAGS) -MT gusbcmd-gusb-main.obj -MD -MP -MF $(DEPDIR)/gusbcmd-gusb-main.Tpo -c -o gusbcmd-gusb-main.obj `if test -f 'gusb-main.c'; then $(CYGPATH_W) 'gusb-main.c'; else $(CYGPATH_W) '$(srcdir)/gusb-main.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gusbcmd-gusb-main.Tpo $(DEPDIR)/gusbcmd-gusb-main.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gusb-main.c' object='gusbcmd-gusb-main.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gusb_CFLAGS) $(CFLAGS) -c -o gusb-gusb-main.obj `if test -f 'gusb-main.c'; then $(CYGPATH_W) 'gusb-main.c'; else $(CYGPATH_W) '$(srcdir)/gusb-main.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gusbcmd_CFLAGS) $(CFLAGS) -c -o gusbcmd-gusb-main.obj `if test -f 'gusb-main.c'; then $(CYGPATH_W) 'gusb-main.c'; else $(CYGPATH_W) '$(srcdir)/gusb-main.c'; fi`
mostlyclean-libtool:
-rm -f *.lo
@@ -545,6 +586,9 @@
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
@@ -580,7 +624,7 @@
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-am
-clean-am: clean-generic clean-libtool clean-local clean-noinstPROGRAMS \
+clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \
mostlyclean-am
distclean: distclean-am
@@ -607,7 +651,7 @@
install-dvi-am:
-install-exec-am:
+install-exec-am: install-binPROGRAMS
install-html: install-html-am
@@ -647,23 +691,24 @@
ps-am:
-uninstall-am:
+uninstall-am: uninstall-binPROGRAMS
.MAKE: install-am install-strip
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
- clean-libtool clean-local clean-noinstPROGRAMS cscopelist-am \
- ctags ctags-am distclean distclean-compile distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags tags-am uninstall uninstall-am
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic clean-libtool clean-local \
+ cscopelist-am ctags ctags-am distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-binPROGRAMS install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS
.PRECIOUS: Makefile
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgusb-0.2.8/tools/gusb-main.c new/libgusb-0.2.9/tools/gusb-main.c
--- old/libgusb-0.2.8/tools/gusb-main.c 2015-11-07 13:52:08.000000000 +0100
+++ new/libgusb-0.2.9/tools/gusb-main.c 2016-03-11 09:25:06.000000000 +0100
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
- * Copyright (C) 2011-2014 Richard Hughes
+ * Copyright (C) 2011-2016 Richard Hughes
*
* Licensed under the GNU General Public License Version 2
*
@@ -356,6 +356,51 @@
}
/**
+ * gusb_cmd_replug:
+ **/
+static gboolean
+gusb_cmd_replug (GUsbCmdPrivate *priv, gchar **values, GError **error)
+{
+ GUsbDevice *device;
+ GUsbDevice *device_new;
+ guint16 vid, pid;
+
+ /* check args */
+ if (g_strv_length (values) != 2) {
+ g_set_error_literal (error, 1, 0,
+ "no VID:PID specified");
+ return FALSE;
+ }
+
+ /* get vid:pid */
+ vid = g_ascii_strtoull (values[0], NULL, 16);
+ pid = g_ascii_strtoull (values[1], NULL, 16);
+ device = g_usb_context_find_by_vid_pid (priv->usb_ctx,
+ vid, pid, error);
+ if (device == NULL)
+ return FALSE;
+
+ /* watch for debugging */
+ g_signal_connect (priv->usb_ctx, "device-added",
+ G_CALLBACK (gusb_device_list_added_cb),
+ priv);
+ g_signal_connect (priv->usb_ctx, "device-removed",
+ G_CALLBACK (gusb_device_list_removed_cb),
+ priv);
+
+ /* wait for replug */
+ device_new = g_usb_context_wait_for_replug (priv->usb_ctx,
+ device,
+ 5000,
+ error);
+ if (device_new == NULL)
+ return FALSE;
+
+ g_object_unref (device);
+ return TRUE;
+}
+
+/**
* gusb_cmd_run:
**/
static gboolean
@@ -444,6 +489,10 @@
"watch",
"Watch devices as they come and go",
gusb_cmd_watch);
+ gusb_cmd_add (priv->cmd_array,
+ "replug",
+ "Watch a device as it reconnects",
+ gusb_cmd_replug);
/* sort by command name */
g_ptr_array_sort (priv->cmd_array,