Debian Patches

Status for usbview/3.1+git20250817.a3de218-1

Patch Description Author Forwarded Bugs Origin Last update
0001-no-PATH_MAX.patch sysfs: allocate paths dynamically instead of using PATH_MAX
PATH_MAX is not defined on all systems (e.g. GNU Hurd), and fixed-size
path buffers are fragile anyway. Build paths with g_build_filename()
and g_strdup_printf(), and read the interface driver symlink with
g_file_read_link() and g_path_get_basename().

This also fixes two latent bugs in the driver-name lookup: readlink()
does not NUL-terminate a result that fills the buffer, and the
hand-rolled basename walks off the start of the buffer if the link
target contained no '/'. Which is never the case, but still.

drop PATH_MAX patch, superseded by dynamic allocation
"Barak A. Pearlmutter" <barak+git@pearlmutter.net> no 2026-11-02
0002-rsvg-convert-icons.patch Rasterize icons with rsvg-convert, avoiding inkscape D-Bus crash
When inkscape is installed, ImageMagick's convert delegates SVG
rendering to it. Inkscape registers as a unique GApplication on the
session bus, and several instances launched concurrently by a parallel
make race on that registration and abort with
"terminate called after throwing an instance of 'Gio::DBus::Error'"
(ServiceUnknown: The name is not activatable), failing the build.

Use rsvg-convert to rasterize the SVG when it is available, falling
back to convert otherwise, with SELF_CALL=1 set so that inkscape, if
used, registers as non-unique. Derive the XPM from the 64x64 PNG so
that convert never has to render SVG for it.

See https://gitlab.com/inkscape/inkscape/-/work_items/4716
and https://bugs.debian.org/1152805
"Barak A. Pearlmutter" <barak+git@pearlmutter.net> no 2026-11-01
0003-keyboard-shortcuts.patch Add keyboard shortcuts for Quit, Refresh, and About
Give the buttons mnemonics (Alt+Q, Alt+R, Alt+A) and add accelerators
Ctrl+Q / Ctrl+W to quit and Ctrl+R / F5 to refresh, so the program can
be driven without a mouse.
"Barak A. Pearlmutter" <barak+git@pearlmutter.net> no debian 2026-11-01
0004-appstream-metadata.patch Fix AppStream metainfo validation issues
Add the missing content_rating type, homepage/bugtracker/vcs URLs,
developer info, and release history, so that
"appstreamcli validate --pedantic" passes cleanly.
"Barak A. Pearlmutter" <barak+git@pearlmutter.net> no 2026-11-01
0005-auto-refresh-on-hotplug.patch Refresh the device tree automatically on USB hotplug
Listen for kernel uevents on a NETLINK_KOBJECT_UEVENT socket, and
reload the tree whenever a SUBSYSTEM=usb event arrives (add, remove,
bind, unbind, ...). sysfs does not support inotify, so watching /sys
does not work.

Plugging in a single device produces a burst of uevents (device,
interfaces, driver binding), so the refresh waits until no USB event
has arrived for 250ms; refreshing on the first event can catch sysfs
half-populated. A receive-buffer overflow (ENOBUFS, i.e. lost events)
also triggers a refresh. If the socket cannot be opened the program
just runs without automatic refresh, and on non-Linux systems the
feature is compiled out.

Based on the netlink approach in chopin1998's feature/auto-refresh
branch, reworked: trailing-edge debounce instead of dropping events
within 200ms of a refresh, bind/unbind also refresh, kernel-assigned
netlink port id, ENOBUFS handling, no stdout chatter, and Linux-only
code guarded so other kernels (e.g. GNU Hurd) still build.
"Barak A. Pearlmutter" <barak+git@pearlmutter.net> no other, https://github.com/chopin1998/usbview/tree/feature/auto-refresh 2026-11-02

All known versions for source package 'usbview'

Links