Package: cdda2wav
Version: 4:2.0+a34-2
Followup-For: Bug #283794
Tags: patch

The invalid code in /usr/bin/cdda2mp3 previously reported is caused by a
broken patch in debian/patches/03_script.dpatch:

Compare the part against cdda2mp3..
<snip>
 # specify the sampling program and its options
 # do not specify the track option here!
-CDDA2WAV=cdda2wav
-CDDA2WAV_OPTS='-H -P0 -q'
+MP_CODER=${MP_CODER:-oggenc}
+MP_OPTIONS=${MP_OPTIONS:-''}
</snip>

..to that against cdda2ogg:
<snip>
 # specify the sampling program and its options
 # do not specify the track option here!
-CDDA2WAV=cdda2wav
-CDDA2WAV_OPTS='-H -P0 -q'
+CDDA2WAV=${CDDA2WAV:-cdda2wav}
+CDDA2WAV_OPTS=${CDDA2WAV_OPTS:-'-H -P0 -q'}
</snip>

This is most probably due to a copy & paste error during patch creation.
As a result, cdda2mp3 won't run cdda2wav, provided the user hasn't
previously set $CDDA2WAV in the environment.

A patch against 03_script.dpatch is attached that also changes the
insertion ordering slightly, so that the resulting cdda2mp3/cdda2ogg
look more similar where they *are* similar. (Try diff-ing them as
they're in the final package now!)

For convenience, the resulting 03_script.dpatch is also attached.

Regards,
Fabian


P.S.: Shouldn't the $NAME part in cdda2ogg better be used in cdda2mp3, too?



-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.4.27-2-k7
Locale: LANG=de_DE, LC_CTYPE=de_DE (charmap=ISO-8859-1)

Versions of packages cdda2wav depends on:
ii  libc6                       2.3.2.ds1-20 GNU C Library: Shared libraries an

-- no debconf information
--- cdrtools-2.01+01a01/debian/patches/03_script.dpatch 2005-02-06 
13:11:50.000000000 +0100
+++ cdrtools-2.01+01a01-modified/debian/patches/03_script.dpatch        
2005-02-07 15:27:13.000000000 +0100
@@ -29,8 +29,8 @@
  # do not specify the track option here!
 -CDDA2WAV=cdda2wav
 -CDDA2WAV_OPTS='-H -P0 -q'
-+MP_CODER=${MP_CODER:-oggenc}
-+MP_OPTIONS=${MP_OPTIONS:-''}
++CDDA2WAV=${CDDA2WAV:-cdda2wav}
++CDDA2WAV_OPTS=${CDDA2WAV_OPTS:-'-H -P0 -q'}
  
  # for normal use, comment out the next line
  #DEBUG='-d1'
@@ -42,20 +42,20 @@
 +MP_CODER=${MP_CODER:-lame}
 +MP_OPTIONS=${MP_OPTIONS:-''}
  
- FILEPREFIX=${1:-audiotrack}
- 
-+if [ "$CDDADEVICE" = "" ]
-+then
-+  CDDA_DEVICE=/dev/cdrom
-+  export CDDA_DEVICE
-+fi
-+
 +$MP_CODER -h >/dev/null 2>&1
 +if [ $? != 0 ] ; then
 +   echo "Encoder not found. Install one first!"
 +   exit 1
 +fi
 +
++if [ "$CDDADEVICE" = "" ]
++then
++  CDDA_DEVICE=/dev/cdrom
++  export CDDA_DEVICE
++fi
++
+ FILEPREFIX=${1:-audiotrack}
+ 
 +if [ -e /etc/default/cdda2mp3 ]; then
 +      . /etc/default/cdda2mp3
 +fi
@@ -97,13 +97,13 @@
 +  CDDA_DEVICE=/dev/cdrom
 +  export CDDA_DEVICE
 +fi
++
  FILEPREFIX=${1:-audiotrack}
  
 -. /etc/default/cdda2ogg 2>/dev/null || true
 +if [ -e /etc/default/cdda2ogg ]; then
 +      . /etc/default/cdda2ogg
 +fi
-+
  
  TRACK=1
  while :
#! /bin/sh -e
## 03_script.dpatch by Joerg Jaspert <[EMAIL PROTECTED]>
## Original made by Eduard Bloch <[EMAIL PROTECTED]>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Small patch to the cdda2mp3 script to read a default config.

if [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
    -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
    *)
        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
        exit 1;;
esac

exit 0

@DPATCH@
diff -urNad /home/inet/cvs/cdrtools-2.0+a14/cdda2wav/cdda2mp3 
cdrtools-2.0+a14/cdda2wav/cdda2mp3
--- /home/inet/cvs/cdrtools-2.0+a14/cdda2wav/cdda2mp3   2000-06-24 
07:47:48.000000000 +0200
+++ cdrtools-2.0+a14/cdda2wav/cdda2mp3  2003-06-04 00:02:36.000000000 +0200
@@ -14,19 +14,35 @@
 
 # specify the sampling program and its options
 # do not specify the track option here!
-CDDA2WAV=cdda2wav
-CDDA2WAV_OPTS='-H -P0 -q'
+CDDA2WAV=${CDDA2WAV:-cdda2wav}
+CDDA2WAV_OPTS=${CDDA2WAV_OPTS:-'-H -P0 -q'}
 
 # for normal use, comment out the next line
 #DEBUG='-d1'
 
 # the post processor is fed through a pipe to avoid space waste
 # specify the post processing program and its options
-MP_CODER=lame
-#MP_OPTIONS=''
+MP_CODER=${MP_CODER:-lame}
+MP_OPTIONS=${MP_OPTIONS:-''}
 
+$MP_CODER -h >/dev/null 2>&1
+if [ $? != 0 ] ; then
+   echo "Encoder not found. Install one first!"
+   exit 1
+fi
+
+if [ "$CDDADEVICE" = "" ]
+then
+  CDDA_DEVICE=/dev/cdrom
+  export CDDA_DEVICE
+fi
+
 FILEPREFIX=${1:-audiotrack}
 
+if [ -e /etc/default/cdda2mp3 ]; then
+       . /etc/default/cdda2mp3
+fi
+
 TRACK=1
 while :
 do
diff -urNad /home/inet/cvs/cdrtools-2.0+a14/cdda2wav/cdda2ogg 
cdrtools-2.0+a14/cdda2wav/cdda2ogg
--- /home/inet/cvs/cdrtools-2.0+a14/cdda2wav/cdda2ogg   2002-04-09 
13:18:15.000000000 +0200
+++ cdrtools-2.0+a14/cdda2wav/cdda2ogg  2003-06-04 00:02:33.000000000 +0200
@@ -14,26 +14,34 @@
 
 # specify the sampling program and its options
 # do not specify the track option here!
-CDDA2WAV=cdda2wav
-CDDA2WAV_OPTS='-H -P0 -q'
+CDDA2WAV=${CDDA2WAV:-cdda2wav}
+CDDA2WAV_OPTS=${CDDA2WAV_OPTS:-'-H -P0 -q'}
 
 # for normal use, comment out the next line
 #DEBUG='-d1'
 
 # the post processor is fed through a pipe to avoid space waste
 # specify the post processing program and its options
-MP_CODER=oggenc
-MP_OPTIONS=''
+MP_CODER=${MP_CODER:-oggenc}
+MP_OPTIONS=${MP_OPTIONS:-''}
 
-$MP_CODER -h > /dev/null 2> /dev/null
+$MP_CODER -h >/dev/null 2>&1
 if [ $? != 0 ] ; then
    echo "Oggenc not found. Install vorbis-tools first!"
    exit 1
 fi
 
+if [ "$CDDADEVICE" = "" ]
+then
+  CDDA_DEVICE=/dev/cdrom
+  export CDDA_DEVICE
+fi
+
 FILEPREFIX=${1:-audiotrack}
 
-. /etc/default/cdda2ogg 2>/dev/null || true
+if [ -e /etc/default/cdda2ogg ]; then
+       . /etc/default/cdda2ogg
+fi
 
 TRACK=1
 while :

Reply via email to