[Abcde-users] 2.9.1 minor error

John Straw jestraw at gmail.com
Tue Jul 17 23:09:34 BST 2018


Steve McIntyre wrote:
> On Mon, Apr 16, 2018 at 02:25:32PM -0700, John Straw wrote:
> >This also happens for me when using the "-W" switch to prepend disc
> >number to track numbers.
>
> Hmmm. Can you share a log showing that please?

(Sorry, this took me forever to get around to ...)

Using current HEAD -> master (5c30ceb) to turn a one-track flac file
into individual ogg files, using a command like:

abcde -N -c .abcde.conf -d 1-nude_on_the_moon_the_b52s_anthology.flac -W1 -D 2>logfile

The log shows the following for tracks 8 (and a similar problem for
track 9):

+ do_tag 08
++ eval echo CD1
+++ echo CD1
+ COMMENTOUTPUT=CD1
+ '[' -z CD1 ']'
++ echo '0b122512 18 150 16375 37220 68102 90340 108942 129765 147900 164127 184195 199427 217452 237812 255185 280710 297350 3153
00 330580 4647'
++ cut '-d ' -f1
+ CDDBDISCID=0b122512
+ run_command '' echo 'Tagging track 08 of 18: Private Idaho...'
+ vvecho '' echo 'Tagging track 08 of 18: Private Idaho...'
+ '[' x '!=' x ']'
+ BLURB=
+ shift
++ checkstatus encode-output
++ PATTERN='^encode-output(=.*)?$'
+++ grep -E '^encode-output(=.*)?$' /tmp/abcde.0b122512/status
+++ tail -n 1
++ BLURB=
++ '[' -z '' ']'
++ return 1
+ '[' '' = loud ']'
+ '[' -z '' ']'
+ '[' 2 '!=' 1 ']'
+ echo 'Tagging track 08 of 18: Private Idaho...'
Tagging track 08 of 18: Private Idaho...
+ RETURN=0
+ case "$1" in
+ '[' 0 '!=' 0 ']'
+ '[' '' ']'
+ '[' -n y ']'
+ gettracknum
+ '[' -n 101 ']'
++ echo -n 08
++ tr -d ' '
++ wc -c
+ CURRENTTRACKPADDING=2
abcde: line 466: 08: value too great for base (error token is "08")
+ TRACKNUM=


The following patch fixes the problem for me:

diff --git a/abcde b/abcde
index 12678d2..4088ffd 100755
--- a/abcde
+++ b/abcde
@@ -463,7 +463,7 @@ gettracknum()
        if [ -n "$STARTTRACKNUMBER" ] ; then
                # Get the trackpadding from the current track, also trim whitespace for MacOSX
                CURRENTTRACKPADDING=$(echo -n "$UTRACKNUM" | wc -c | tr -d ' ')
-               TRACKNUM=$( printf %0.${CURRENTTRACKPADDING}d $((${UTRACKNUM} + ${STARTTRACKNUMBER} - ${FIRSTTRACK})))
+               TRACKNUM=$( printf %0.${CURRENTTRACKPADDING}d $(("10#${UTRACKNUM}" + ${STARTTRACKNUMBER} - ${FIRSTTRACK})))
        else
                TRACKNUM=${UTRACKNUM}
        fi

Or an alternate fix which follows the convention used elsewhere in the
code:

diff --git a/abcde b/abcde
index 12678d2..bb8b202 100755
--- a/abcde
+++ b/abcde
@@ -463,7 +463,8 @@ gettracknum()
        if [ -n "$STARTTRACKNUMBER" ] ; then
                # Get the trackpadding from the current track, also trim whitespace for MacOSX
                CURRENTTRACKPADDING=$(echo -n "$UTRACKNUM" | wc -c | tr -d ' ')
-               TRACKNUM=$( printf %0.${CURRENTTRACKPADDING}d $((${UTRACKNUM} + ${STARTTRACKNUMBER} - ${FIRSTTRACK})))
+               REALTRACKNUM=$(expr $UTRACKNUM + 0) # Unpad
+               TRACKNUM=$( printf %0.${CURRENTTRACKPADDING}d $((${REALTRACKNUM} + ${STARTTRACKNUMBER} - ${FIRSTTRACK})))
        else
                TRACKNUM=${UTRACKNUM}
        fi

--
John Straw                                             jestraw at gmail.com



More information about the Abcde-users mailing list