1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-12-22 23:05:11 +02:00

dsv/dsv: sent User-Agent to "dsv/1.0" (instead of Wget/...)

Digi-Key now blocks wget from accessing their document cache.
Seems to be a rather silly move ...
This commit is contained in:
Werner Almesberger 2013-09-10 11:55:49 -03:00
parent bbb6513b42
commit 3256b03294

14
dsv/dsv
View File

@ -2,8 +2,8 @@
#
# dsv - Improved data sheet viewer
#
# Written 2010-2012 by Werner Almesberger
# Copyright 2010-2012 Werner Almesberger
# Written 2010-2013 by Werner Almesberger
# Copyright 2010-2013 Werner Almesberger
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -41,6 +41,12 @@ usage()
}
do_wget()
{
wget -nv -U "dsv/1.0" "$@"
}
up()
{
old=`pwd`
@ -64,13 +70,13 @@ flush()
if [ ! -r "$DSV_DIR/$ds" ]; then
inside=${url#*.[Zz][Ii][Pp] }
if [ "$inside" = "$url" ]; then
wget -nv -O "$DSV_DIR/$ds" "$url"
do_wget -O "$DSV_DIR/$ds" "$url"
# @@@ should handle error
else
url=${url%`echo x"$inside" | sed 's/./?/g'`}
zip=$nm-`basename "$url"`
if [ ! -r "$DSV_DIR/$zip" ]; then
wget -nv -O "$DSV_DIR/$zip" "$url"
do_wget -O "$DSV_DIR/$zip" "$url"
# @@@ should handle error
fi
unzip -p "$DSV_DIR/$zip" "$inside" >"$DSV_DIR/$ds" ||