r33@keebo: data | 2005-01-30T23:18:13.192535Z
authorJesus Climent <mooch@debian.org>
Sun, 30 Jan 2005 23:19:22 +0000 (23:19 +0000)
committerJesus Climent <mooch@debian.org>
Sun, 30 Jan 2005 23:19:22 +0000 (23:19 +0000)
 possible checking of cdparanoia -Q option

abcde

diff --git a/abcde b/abcde
index 4a28dda..04544cf 100755 (executable)
--- a/abcde
+++ b/abcde
@@ -843,7 +843,12 @@ do_discid ()
                                cdparanoia|debug)
                                        if [ "$WEHAVEACD" = "y" ]; then
                                                vecho "Querying the CD for audio tracks..."
-                                               TRACKS=$( $CDROMREADER -d $CDROM -Q --verbose 2>&1 | egrep '^[[:space:]]+[[:digit:]]' | tail -n 1 |  awk '{print $1}' | tr -d "." | tr '\n' ' ' )
+                                               CDPARANOIAOUTPUT=$( $CDROMREADER -d $CDROM -Q --verbose 2>&1 )
+                                               RET=$?
+                                               if [ ! "$RET" = "0" ];then
+                                                       echo "Warning: Something went wrong while querying the CD... Maybe a DATA CD?"
+                                               fi
+                                               TRACKS=$( echo $CDPARANOIAOUTPUT | egrep '^[[:space:]]+[[:digit:]]' | tail -n 1 |  awk '{print $1}' | tr -d "." | tr '\n' ' ' )
                                                CDPARANOIAAUDIOTRACKS="$TRACKS"
                                        else
                                                if [ -f "$ABCDETEMPDIR/status" ] && checkstatus cdparanoia-audio-tracks ; then
@@ -858,6 +863,10 @@ do_discid ()
                else
                        TRACKS=$(echo $TRACKINFO | cut -f2 -d' ')
                fi
+               if echo "$TRACKS" | grep [[:digit:]] > /dev/null 2>&1 ;then :;else
+                       echo "The disc does not contain any tracks. Giving up..."
+                       exit 0
+               fi
                echo -n "Grabbing entire CD - tracks: "
                if [ ! "$PADTRACKS" = "y" ] ; then
                        TRACKNUMPADDING=$(echo -n $TRACKS | wc -c | tr -d ' ')