mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-23 02:22:49 +02:00
dsv: make "dsv setup" accept spaces in names and aliases
- dsv (set_value): store name and alias with double quotes, to protect spaces - dsv (flush): access name and alias via "eval"
This commit is contained in:
parent
3b3c4bf056
commit
92cb58023d
15
dsv/dsv
15
dsv/dsv
@ -49,19 +49,20 @@ up()
|
|||||||
|
|
||||||
flush()
|
flush()
|
||||||
{
|
{
|
||||||
[ -z "$name" ] && return
|
eval nm=$name
|
||||||
|
[ -z "$nm" ] && return
|
||||||
if [ -z "$url" ]; then
|
if [ -z "$url" ]; then
|
||||||
echo "$name: no URL" 2>&1
|
echo "$nm: no URL" 2>&1
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
ds=$name-`basename "$url"`
|
ds=$nm-`basename "$url"`
|
||||||
mkdir -p $DSV_DIR
|
mkdir -p $DSV_DIR
|
||||||
if [ ! -r "$DSV_DIR/$ds" ]; then
|
if [ ! -r "$DSV_DIR/$ds" ]; then
|
||||||
wget -nv -O "$DSV_DIR/$ds" "$url"
|
wget -nv -O "$DSV_DIR/$ds" "$url"
|
||||||
# @@@ should handle error
|
# @@@ should handle error
|
||||||
fi
|
fi
|
||||||
for n in $name $alias; do
|
eval for n in $name $alias\; do \
|
||||||
echo "$ds" >$DSV_DIR/dsv-$n
|
echo '"$ds"' '>$DSV_DIR/dsv-$n'\; \
|
||||||
done
|
done
|
||||||
name=
|
name=
|
||||||
alias=
|
alias=
|
||||||
@ -73,8 +74,8 @@ set_value()
|
|||||||
{
|
{
|
||||||
case "$tag" in
|
case "$tag" in
|
||||||
N:|n:) flush
|
N:|n:) flush
|
||||||
name=$value;;
|
name="\"$value\"";;
|
||||||
A:|a:) alias="$alias $value";;
|
A:|a:) alias="$alias \"$value\"";;
|
||||||
D:|d:) url=$value;;
|
D:|d:) url=$value;;
|
||||||
"")
|
"")
|
||||||
;; # first iteration
|
;; # first iteration
|
||||||
|
Loading…
Reference in New Issue
Block a user