Fix debian/preinst not to ignore errors.
[abcde.git] / cddb-tool
index 4f44a89..e0df3b1 100755 (executable)
--- a/cddb-tool
+++ b/cddb-tool
@@ -38,13 +38,13 @@ if [ "$HTTPGET" = "" ]; then
                HTTPGETOPTS=${HTTPGETOPTS:="-q -o -"}
        elif [ X"$(uname)" = X"NetBSD" ] ; then
                HTTPGET=ftp
-               HTTPGETOPTS=${HTTPGETOPTS:="-q -o -"}
+               HTTPGETOPTS=${HTTPGETOPTS:="-a -V -o - "}
        elif [ X"$(uname)" = X"Darwin" ] ; then
                HTTPGET=curl
                HTTPGETOPTS=${HTTPGETOPTS:="-f -s"}
        else
                HTTPGET=wget
-               HTTPGETOPTS=${HTTPGETOPTS:="-q -O -"}
+               HTTPGETOPTS=${HTTPGETOPTS:="-q -nv -e timestamping=off -O -"}
        fi
 fi
 
@@ -196,7 +196,7 @@ send) # cddb-tool send filename email@address
        ADDRESS="$2"
        DISCID=$(grep ^DISCID= "$FILE" | cut -f2 -d= | tr -d \[:cntrl:\])
        CDDBGENRE=$(grep '^#CATEGORY=' "$FILE" | cut -f2- -d= | tr -d \[:cntrl:\])
-       grep -v "^#CATEGORY=" "$FILE" | mail -s "cddb $CDDBGENRE $DISCID" "$ADDRESS"
+       grep -v "^#CATEGORY=" "$FILE" | iconv -t utf-8 | mail -a "Content-Type: text/plain; charset=utf-8" -s "cddb $CDDBGENRE $DISCID" "$ADDRESS"
        ;;
 
 query) # cddb-tool query serverurl proto user host discid...
@@ -208,7 +208,7 @@ query) # cddb-tool query serverurl proto user host discid...
        shift 4
        TRACKINFO="$@"
        TRACKINFOPLUS=$(echo $TRACKINFO | tr ' ' '+')
-       RESULTS=$($HTTPGET "$SERVER?cmd=cddb+query+$TRACKINFOPLUS\&hello=$HELLOINFO\&proto=$PROTO") || exit $LOOKUP_ERR
+       RESULTS=$($HTTPGET "$SERVER?cmd=cddb+query+$TRACKINFOPLUS&hello=$HELLOINFO&proto=$PROTO") || exit $LOOKUP_ERR
        echo "$RESULTS" | tr '\r' '\n' | tr -s '\n' | sed 's/^ //g'
        ;;
 
@@ -220,7 +220,7 @@ read) # cddb-tool read serverurl proto user host genre discnumber
        CATEGORY="$5"
        DISCID="$6"
        HELLOINFO="$USER+$HOST+$NAME+$VERSION"
-       $HTTPGET $CDDBDATA "$SERVER?cmd=cddb+read+$CATEGORY+$DISCID\&hello=$HELLOINFO\&proto=$PROTO" 2>/dev/null
+       $HTTPGET $CDDBDATA "$SERVER?cmd=cddb+read+$CATEGORY+$DISCID&hello=$HELLOINFO&proto=$PROTO" 2>/dev/null
        ;;
 
 stat) # cddb-tool stat serverurl user host proto
@@ -229,7 +229,7 @@ stat) # cddb-tool stat serverurl user host proto
        HOST="$3"
        PROTO="$4"
        HELLOINFO="$USER+$HOST+$NAME+$VERSION"
-       $HTTPGET $CDDBDATA "$SERVER?cmd=stat&hello=$HELLOINFO\&proto=$PROTO" 2>/dev/null
+       $HTTPGET $CDDBDATA "$SERVER?cmd=stat&hello=$HELLOINFO&proto=$PROTO" 2>/dev/null
        ;;
 
 help) # help