[packages] usbutils: Create gziped list when updating IDs, bump release number

git-svn-id: svn://svn.openwrt.org/openwrt/packages@17233 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
acinonyx 2009-08-11 23:37:49 +00:00
parent 784511bd1b
commit bd5f893390
2 changed files with 37 additions and 1 deletions

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
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

View File

@ -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