summaryrefslogtreecommitdiff
path: root/debian/patches/75_fix_datatrack_rename.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/75_fix_datatrack_rename.patch')
-rw-r--r--debian/patches/75_fix_datatrack_rename.patch177
1 files changed, 177 insertions, 0 deletions
diff --git a/debian/patches/75_fix_datatrack_rename.patch b/debian/patches/75_fix_datatrack_rename.patch
new file mode 100644
index 0000000..da1edb0
--- /dev/null
+++ b/debian/patches/75_fix_datatrack_rename.patch
@@ -0,0 +1,177 @@
+Fixes that "jack -R -t x" fails when x is a data track and CD not in drive.
+jack doesn't realize that it is in fact a data track. We can fix this by
+moving the code around a bit so the jack.progress file is parsed first,
+then jack will know it's not a valid audio track. Debian #341889
+
+Depends on 70_fix_upd_progress.patch.
+
+
+diff -urN c/jack jack-3.1.1+cvs20050801/jack
+--- c/jack 2006-02-05 18:48:20.000000000 +0000
++++ jack-3.1.1+cvs20050801/jack 2006-02-05 19:04:29.000000000 +0000
+@@ -94,36 +94,28 @@
+
+ ext = jack_targets.targets[jack_helpers.helpers[cf['_encoder']]['target']]['file_extension']
+
+-### (1) search for a dir containing a toc-file or do the multi-mode
++### search for a dir containing a toc-file or do the multi-mode
+ toc_just_read = jack_prepare.find_workdir()
+ os.environ["JACK_CUR_DIR"] = os.getcwd()
+ os.environ["JACK_BASE_DIR"] = cf['_base_dir']
+ # now we are set to go as we know we are in the right dir
+
+-### (2) check toc (operation mode)
++### check toc (operation mode)
+ if cf['_check_toc']:
+ jack_prepare.check_toc()
+ sys.exit(0)
+
+-### (3a) read and interpret toc_file
++### read and interpret toc_file
+ is_submittable, track1_offset = jack_prepare.read_toc_file()
+
+-### (3b) make sure we have a freedb file
++### make sure we have a freedb file
+ if not os.path.exists(cf['_freedb_form_file']):
+ jack_freedb.freedb_template(jack_ripstuff.all_tracks)
+
+-### (4a) filter out data tracks
+-jack_prepare.filter_tracks(toc_just_read)
+-
+-### (4b) Parse tracks from argv, generate todo
+-todo = jack_prepare.gen_todo()
+-if len(todo) == 0:
+- error("nothing to do. bye.")
+-
+ ### init status
+-jack_status.init(todo)
++jack_status.init(jack_ripstuff.all_tracks)
+
+-#XXX## (5) read progress info into status
++#XXX## read progress info into status
+
+ jack_ripstuff.all_tracks_orig = []
+ for i in jack_ripstuff.all_tracks:
+@@ -131,20 +123,27 @@
+
+ status = jack_prepare.init_status()
+
+-### (6) update progress file at user's request (operation mode)
+-if cf['_upd_progress']:
+- jack_prepare.update_progress(status, todo)
+- sys.exit(0)
++jack_prepare.tracknum = {}
++for i in jack_ripstuff.all_tracks:
++ jack_prepare.tracknum[i[NUM]] = i
+
+-### (7) now read in the progress file
+-status = jack_prepare.read_progress(status, todo)
++### now read in the progress file
++status = jack_prepare.read_progress(status, jack_ripstuff.all_tracks)
+
+-### (8) submit freedb data on user's request
++### filter out data tracks
++jack_prepare.filter_tracks(toc_just_read, status)
++
++### Parse tracks from argv, generate todo
++todo = jack_prepare.gen_todo()
++if len(todo) == 0:
++ error("nothing to do. bye.")
++
++### submit freedb data on user's request
+ if cf['_freedb_submit'] or cf['_freedb_mailsubmit']:
+ jack_prepare.freedb_submit()
+ sys.exit(0)
+
+-### (9) do query on start
++### do query on start
+ freedb_rename = 0
+ if cf['_query_if_needed']:
+ if not os.path.exists(cf['_freedb_form_file'] + ".bak"):
+@@ -152,7 +151,7 @@
+ if cf['_query_on_start']:
+ freedb_rename = jack_prepare.query_on_start(todo)
+
+-### (10) update freedb dbfile
++### update freedb dbfile
+ if cf['_update_freedb']:
+ if not jack_tag.track_names:
+ err, jack_tag.track_names, jack_tag.locale_names, freedb_rename, revision = jack_freedb.interpret_db_file(jack_ripstuff.all_tracks, todo, cf['_freedb_form_file'], verb = 1, dirs = 0)
+@@ -161,7 +160,12 @@
+ info("now submit your changes if you like, using the option --submit (via http POST). Don't forget to activate your changes locally with -R")
+ sys.exit(0)
+
+-### (11) undo renaming (operation mode)
++### update progress file at user's request (operation mode)
++if cf['_upd_progress']:
++ jack_prepare.update_progress(status, todo)
++ sys.exit(0)
++
++### undo renaming (operation mode)
+ if cf['_undo_rename']:
+ jack_prepare.undo_rename(status, todo)
+ sys.exit(0)
+diff -urN c/jack_prepare.py jack-3.1.1+cvs20050801/jack_prepare.py
+--- c/jack_prepare.py 2006-02-05 18:48:20.000000000 +0000
++++ jack-3.1.1+cvs20050801/jack_prepare.py 2006-02-05 19:14:17.000000000 +0000
+@@ -39,7 +39,7 @@
+
+ from jack_globals import *
+
+-tracknum = None
++global tracknum
+ datatracks = []
+
+ def find_workdir():
+@@ -210,8 +210,9 @@
+ is_submittable = 1
+ return is_submittable, track1_offset
+
+-def filter_tracks(toc_just_read):
++def filter_tracks(toc_just_read, status):
+ "filter out data tracks"
++ global datatracks
+
+ if toc_just_read and jack_helpers.helpers[cf['_ripper']].has_key("toc_cmd") and cf['_ripper'] != cf['_toc_prog']:
+ ripper_tracks = jack_functions.gettoc(cf['_ripper'])
+@@ -223,25 +224,24 @@
+ # "NUM LEN START COPY PRE CH" (not: "RIP RATE NAME")
+ if ripper_tracks[rtn][j] != jack_ripstuff.all_tracks[i][j]:
+ jack_functions.progress(i + 1, "patch", "%s %d -> %d" % (fields[j], jack_ripstuff.all_tracks[i][j], ripper_tracks[rtn][j]))
++ jack_ripstuff.all_tracks[i][j] = ripper_tracks[rtn][j]
+ debug("Track %02d %s" % (i + 1, fields[j]) + `jack_ripstuff.all_tracks[i][j]` + " != " + `ripper_tracks[rtn][j]` + " (trusting %s; to the right)" % cf['_ripper'])
+ else:
+ jack_functions.progress(i + 1, "off", "non-audio")
+ datatracks.append(i + 1)
+ info("Track %02d not found by %s. Treated as non-audio." % (i + 1, cf['_ripper']))
+-
++ if not toc_just_read:
++ datatracks += [x for x in status.keys() if status[x]["off"] and status[x]["off"] == ["non-audio"]]
+
+ def gen_todo():
+ "parse tracks from argv, generate todo"
+- global tracknum
+-
+- tracknum = {}
+- for i in jack_ripstuff.all_tracks:
+- tracknum[i[NUM]] = i
+
+ if not cf['_tracks'] and not jack_playorder.order:
+ todo = []
+ for i in jack_ripstuff.all_tracks:
+- if i[CH] == 2:
++ if i[NUM] in datatracks:
++ pass
++ elif i[CH] == 2:
+ todo.append(i)
+ else:
+ info("can't handle non audio track %i" % i[NUM])
+@@ -442,8 +442,6 @@
+ error("illegal patch %s. " % j, + "Track %02d: %s is %d" % (i, p_what, todo[jack_utils.has_track(todo, i)][fields.index(p_what)]))
+
+ if status[i]['off']:
+- if jack_utils.has_track(todo, i) >= 0:
+- del todo[jack_utils.has_track(todo, i)]
+ if jack_utils.has_track(jack_ripstuff.all_tracks_todo_sorted, i) >= 0:
+ del jack_ripstuff.all_tracks_todo_sorted[jack_utils.has_track(jack_ripstuff.all_tracks_todo_sorted, i)]
+