[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[abcde] Bug#87563: abcde: cddb-tool crashes if no internet connection is available



Package: abcde
Version: 1.0.1.1-1
Severity: normal

There is some error checking but it doesn't work:

    CDINFO=`wget ... | tr -d '\r'` || exit $LOOKUP_ERR

This return of this pipeline is the return code of tr, which always succeeds,
no matter what input it gets.

The following patch repairs this:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
*** cddb-tool.orig	Sun Feb 25 12:02:40 2001
--- cddb-tool	Sun Feb 25 11:52:10 2001
***************
*** 218,225 ****
      TRACKINFO="$*"
      TRACKINFOPLUS=`echo $TRACKINFO | tr ' ' '+'`
      echo -n "Looking up CD name.." >&2
!     CDINFO=`wget -q -O - "$SERVER?cmd=cddb+query+$TRACKINFOPLUS\&hello=$HELLOINFO\&proto=3" | tr -d '\r'` \
!      2>/dev/null || exit $LOOKUP_ERR
      echo -n ".." >&2
      RESPONSECODE=`echo $CDINFO | cut -f1 -d' '`
      case $RESPONSECODE in
--- 218,231 ----
      TRACKINFO="$*"
      TRACKINFOPLUS=`echo $TRACKINFO | tr ' ' '+'`
      echo -n "Looking up CD name.." >&2
!     CDINFO=`wget -q -O - \
!        "$SERVER?cmd=cddb+query+$TRACKINFOPLUS\&hello=$HELLOINFO\&proto=3" | \
!        tr -d '\r'` 
!     if [ -z $CDINFO ]; then
!       echo 'wget error.' >&2
!       exit $LOOKUP_ERR
!     fi
!     echo cdinfo: $CDINFO end
      echo -n ".." >&2
      RESPONSECODE=`echo $CDINFO | cut -f1 -d' '`
      case $RESPONSECODE in
***************
*** 284,289 ****
--- 290,300 ----
    wget -q -O $CDDBDATA "$SERVER?cmd=cddb+read+$CATEGORY+$DISCID\&hello=$HELLOINFO\&proto=3" 2>/dev/null
    echo "got it." >&2
    RESPONSECODE=`cat $CDDBDATA | head -1 | cut -f1 -d' '`
+   if [ -z $RESPONSECODE ]; then
+     echo 'wget error.' >&2
+     rm -f $CDDBDATA
+     exit $LOOKUP_ERR
+   fi
    if [ $RESPONSECODE -gt 399 ]; then
      echo "$NAME: CDDB error: `cat $CDDBDATA | head -1`" >&2
      rm -f $CDDBDATA
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

-- System Information
Debian Release: 2.2
Kernel Version: Linux endeavour 2.2.17 #1 Mon Dec 4 19:00:40 CET 2000 i586 unknown

Versions of the packages abcde depends on:
ii  cd-discid      0.2-2          CDDB DiscID utility
ii  cdparanoia     3a9.7-2        An audio extraction tool for sampling CDs.
ii  debianutils    1.13.3         Miscellaneous utilities specific to Debian.
ii  id3            0.12-1         An ID3 Tag Editor
ii  wget           1.5.3-3        utility to retrieve files from the WWW via H
cdda2wav	Not installed or no info


To unsubscribe: echo unsubscribe | mail abcde-request@whimsica.lly.org