From: Gunnar Wolf <gwolf@debian.org>
Origin: vendor
Bug-Debian: http://bugs.debian.org/397071
Forwarded: yes (private mail)
Last-Update: 2010-02-19
Description: Add --no-normalize flag to override --normalize
 Per user request, as --normalize was not overridable if specified in
 the configuration file
--- mp3roaster-0.3.0.orig/mp3roaster
+++ mp3roaster-0.3.0/mp3roaster
@@ -62,6 +62,7 @@ GetOptions (
     'opt_check_quotes|quotes|q',
     'opt_check_questions|questions|Q',
     'opt_wav_normalize|normalize|n',
+    'opt_wav_no_normalize|no-normalize|N',
 
     'verbose|v',
     'help|h',
@@ -97,6 +98,7 @@ Options:
   -q, --quotes      Replace quotes with underscores.
   -Q, --questions   Replace questionmarks with underscores.
   -n, --normalize   Normalize WAV files before burning.
+  -N, --no-normalize Don\'t normalize WAV files (useful to override config)
   -v, --verbose     Enable verbose output.
   -h, --help        Show this help screen.
   -V, --version     Show program version.
@@ -238,6 +240,7 @@ sub read_config_file_and_options {
     my $config_check_quotes;
     my $config_check_questions;
     my $config_wav_normalize;
+    my $config_wav_no_normalize;
 
     # This options MUST be defined in the configuration file
     # or MUST be passed to the program as a command line option
@@ -255,7 +258,8 @@ sub read_config_file_and_options {
         "config_check_brackets"     => \$config_check_brackets,
         "config_check_quotes"       => \$config_check_quotes,
         "config_check_questions"    => \$config_check_questions,
-        "config_wav_normalize"      => \$config_wav_normalize
+        "config_wav_normalize"      => \$config_wav_normalize,
+	"config_wav_no_normalize"   => \$config_wav_no_normalize
     );
 
     open('RC', $in_config_file_location);   # open file
@@ -332,6 +336,14 @@ sub read_config_file_and_options {
         }
     };
 
+    # Allow for overriding config_wav_normalize with
+    # config_wav_no_normalize: If both are set, no_normalize wins.
+    if ($confhash{config_wav_no_normalize} and
+	delete($confhash{config_wav_normalize}) and
+	$opthash{verbose}) {
+	print " * no-normalize is set and overrides normalize\n";
+    }
+
     return %confhash;
 }
 
@@ -1378,6 +1390,11 @@ Replace questionmarks with underscores
 
 Normalize WAV files before burning
 
+=item B<-N, --no-normalize>
+
+Don't normalize WAV files, even if --normalize is specified (either as
+a command line argument or in the configuratino file)
+
 =item B<-v, --verbose>
 
 Enable verbose output
