mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-26 07:13:08 +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:
parent
bbb6513b42
commit
3256b03294
14
dsv/dsv
14
dsv/dsv
@ -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" ||
|
||||
|
Loading…
Reference in New Issue
Block a user