From 7fe95fb9f1fe0ec22d3a1d0f683b75fc8edc8c5e Mon Sep 17 00:00:00 2001 From: Colin Patrick McCabe Date: Sat, 3 Apr 2010 13:36:45 -0700 Subject: [PATCH] superrip: fix manifest validation Fix manifest validation. Also, fix parsing of cdda2wav output for discs with fewer than 10 tracks. --- superrip.rb | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/superrip.rb b/superrip.rb index bdf7512..d9ab7d7 100755 --- a/superrip.rb +++ b/superrip.rb @@ -44,8 +44,8 @@ def get_number_of_tracks_on_cd look_for_tracks = true elsif (look_for_tracks == true) then look_for_tracks = false - line =~ /[ \t]*1-([1234567890][1234567890]*)[^1234567890]/ \ - or raise "couldn't understand cdda2wav output!" + line =~ /[ \t]*1-([ 1234567890][1234567890]*)[^1234567890]/ \ + or raise "couldn't understand cdda2wav output! (line:#{line})" return $1.to_i end end @@ -184,11 +184,10 @@ class Manifest if (@t.empty?) then raise "you must define some tracks" end - @t.each { |t| t.validate } if (not $opts.partial) then - (1..num_tracks).each do |t| - if not @t[t].defined? - raise "don't know what to do with track #{t}" + (1..num_tracks).each do |tnum| + if not @t.has_key?(tnum) + raise "don't know what to do with track #{tnum}" end end end @@ -235,6 +234,7 @@ manifest = Manifest.new($opts.manifest_file) puts manifest.inspect num_tracks = get_number_of_tracks_on_cd() puts "found #{num_tracks} tracks" +manifest.validate(num_tracks) manifest.rip(num_tracks) puts "*** FINISHED ***" exit 0 -- 1.6.6.rc1.39.g9a42