[Bug 523116] Re: /usr/sbin/update-usbids.sh doesn't handle gzip usb.ids file from http://www.linux-usb.org/usb.ids

Hans Spath 523116 at bugs.launchpad.net
Wed Jan 31 09:59:00 UTC 2018


There has been a configuration issue with the linux-usb.org webserver.
If you were behind a proxy, it was possible to receive a gzip encoded
response even if the client (wget) didn't indicate support for such. The
issue has been resolved recently.

See https://sourceforge.net/p/forge/site-support/16108/ for details.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to usbutils in Ubuntu.
https://bugs.launchpad.net/bugs/523116

Title:
  /usr/sbin/update-usbids.sh doesn't handle gzip usb.ids file from
  http://www.linux-usb.org/usb.ids

Status in usbutils package in Ubuntu:
  New

Bug description:
  Binary package hint: usbutils

  http://www.linux-usb.org/usb.ids returns usb.ids as a gzip file -
  which the update-usbids.sh cannot handle using grep.

  the following revised script will successfully download the usb.ids
  file:

  #!/bin/sh

  # see also update-pciids.sh (fancier)

  [ "$1" = "-q" ] && quiet="true" || quiet="false"

  set -e
  SRC="http://www.linux-usb.org/usb.ids"
  DEST=/var/lib/misc/usb.ids

  # if usb.ids is read-only (because the filesystem is read-only),
  # then just skip this whole process.
  if ! touch ${DEST} >&2 >/dev/null ; then
          ${quiet} || echo "${DEST} is read-only, exiting."
          exit 0
  fi

  if which wget >/dev/null 2>&1 ; then
          DL="wget -O $DEST.new.gz $SRC"
          ${quiet} && DL="$DL -q"
  elif which lynx >/dev/null 2>&1 ; then
          DL="eval lynx -source $SRC >$DEST.new.gz"
  else
          echo >&2 "update-usbids: cannot find wget nor lynx"
          exit 1
  fi

  if ! $DL ; then
          echo >&2 "update-usbids: download failed"
          rm -f $DEST.new
          exit 1
  fi

  gunzip $DEST.new.gz

  if ! grep >/dev/null "^C " $DEST.new ; then
          echo >&2 "update-usbids: missing class info, probably truncated file"
          exit 1
  fi

  if [ -f $DEST ] ; then
          mv $DEST $DEST.old
          # --reference is supported only by chmod from GNU file, so let's ignore any errors
          chmod -f --reference=$DEST.old $DEST.new 2>/dev/null || true
  fi
  mv $DEST.new $DEST

  ${quiet} || echo "Done."

  ProblemType: Bug
  Architecture: amd64
  Date: Wed Feb 17 23:10:03 2010
  DistroRelease: Ubuntu 9.10
  NonfreeKernelModules: fglrx
  Package: usbutils 0.82-0ubuntu1 [modified: usr/sbin/update-usbids.sh var/lib/misc/usb.ids]
  ProcEnviron:
   LANGUAGE=
   LANG=en_NZ.UTF-8
   SHELL=/bin/bash
  ProcVersionSignature: Ubuntu 2.6.31-19.56-generic
  SourcePackage: usbutils
  Uname: Linux 2.6.31-19-generic x86_64
  XsessionErrors:
   (firefox:10801): GLib-WARNING **: g_set_prgname() called multiple times
   (polkit-gnome-authentication-agent-1:10809): GLib-CRITICAL **: g_once_init_leave: assertion `initialization_value != 0' failed
   (firefox:10846): GLib-WARNING **: g_set_prgname() called multiple times

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/usbutils/+bug/523116/+subscriptions



More information about the foundations-bugs mailing list