Package: icedax
Version: 9:1.1.11-4
Severity: normal
Tags: patch
X-Debbugs-Cc: [email protected]

Dear Wonderful Maintainer,
cdda2mp3 does not correctly handle the FILEPREFIX environment variable.  
Currently, it is ignored, but the man page indicates it should work.  Current 
behavior is to take the command line parameter, or if unset default to a value, 
and overwrite the environment variable regardless.

Additionally - default values that may be set in /etc/default can currently 
override environment variables and command line arguments.

This patch makes the following fixes:
* Moves /etc/default handling earlier so environment and command line 
parameters will override defaults - as commonly expected.
* Has FILEPREFIX prefer the command line parameter, but fall back to the 
incoming environment variable, and if neither is set fall back to a default.


-- System Information:
Debian Release: 13.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.12.63+deb13-amd64 (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_WARN, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages icedax depends on:
ii  libc6  2.41-12+deb13u2

icedax recommends no packages.

Versions of packages icedax suggests:
pn  cdrkit-doc    <none>
pn  vorbis-tools  <none>

-- no debconf information
--- cdda2mp3.orig       2006-11-25 06:08:05.000000000 -0600
+++ cdda2mp3    2026-05-07 09:19:53.412893920 -0500
@@ -4,6 +4,13 @@
 # This variant uses named pipes in order to save space.
 # usage: cdda2ogg <name prefix for all ogg/mp3 files>
 
+# Read default values from the system configuration file.
+# Allow environment variables and command-line options
+# to override these though.
+if [ -e /etc/default/cdda2$suffix ]; then
+       . /etc/default/cdda2$suffix
+fi
+
 # specify the sampling program and its options
 # do not specify the track option here!
 CDDA2WAV=${CDDA2WAV:-icedax}
@@ -45,11 +52,11 @@
 CDDA_DEVICE=${CDDA_DEVICE:-/dev/cdrw}
 export CDDA_DEVICE
 
-FILEPREFIX=${1:-audiotrack}
-
-if [ -e /etc/default/cdda2$suffix ]; then
-       . /etc/default/cdda2$suffix
-fi
+# Prefer the first command line option.
+# Fall back to the environment variable
+# Fall back again to a default value
+FILEPREFIX=${1:-"$FILEPREFIX"}
+FILEPREFIX=${FILEPREFIX:-audiotrack}
 
 if [ -z "$LIST" ] ; then
    echo Looking for available tracks...

Reply via email to