[packages] usbutils: Create gziped list when updating IDs, bump release number
authorVasilis Tsiligiannis <acinonyx@openwrt.gr>
Tue, 11 Aug 2009 23:37:49 +0000 (23:37 +0000)
committerVasilis Tsiligiannis <acinonyx@openwrt.gr>
Tue, 11 Aug 2009 23:37:49 +0000 (23:37 +0000)
SVN-Revision: 17233

utils/usbutils/Makefile
utils/usbutils/patches/110-gzip-update-usbids.patch [new file with mode: 0644]

index 4f2728991d56e2eac6054a653bffc94401ed06c6..27f15d38574bd0f2d68d34f16bcfdbfbb65373cf 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=usbutils
 PKG_VERSION:=0.84
 
 PKG_NAME:=usbutils
 PKG_VERSION:=0.84
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/linux-usb
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/linux-usb
diff --git a/utils/usbutils/patches/110-gzip-update-usbids.patch b/utils/usbutils/patches/110-gzip-update-usbids.patch
new file mode 100644 (file)
index 0000000..0e25e5c
--- /dev/null
@@ -0,0 +1,36 @@
+--- a/update-usbids.sh.in
++++ b/update-usbids.sh.in
+@@ -6,9 +6,9 @@
+ set -e
+ SRC="http://www.linux-usb.org/usb.ids"
+-DEST=usb.ids
++DEST=usb.ids.gz
+-# if usb.ids is read-only (because the filesystem is read-only),
++# if usb.ids.gz 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."
+@@ -16,10 +16,10 @@ if ! touch ${DEST} >&2 >/dev/null ; then
+ fi
+ if which wget >/dev/null 2>&1 ; then
+-      DL="wget -O $DEST.new $SRC"
++      DL="eval wget -O- $SRC | gzip >$DEST.new"
+       ${quiet} && DL="$DL -q"
+ elif which lynx >/dev/null 2>&1 ; then
+-      DL="eval lynx -source $SRC >$DEST.new"
++      DL="eval lynx -source $SRC | gzip >$DEST.new"
+ else
+       echo >&2 "update-usbids: cannot find wget nor lynx"
+       exit 1
+@@ -31,7 +31,7 @@ if ! $DL ; then
+       exit 1
+ fi
+-if ! grep >/dev/null "^C " $DEST.new ; then
++if ! zcat $DEST.new | grep >/dev/null "^C " ; then
+       echo >&2 "update-usbids: missing class info, probably truncated file"
+       exit 1
+ fi