summaryrefslogtreecommitdiff
path: root/debian/patches/14_tocfile_abspath.patch
blob: cdff8b409ec9b573167f67bf6477a5cfe3e6e10d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Print a better warning when the cdrdao toc file cannot be found, and use
the absolute path so the file will be found if it exists.   Debian #338697.


diff -urN jack-3.1.1~/jack_functions.py jack-3.1.1/jack_functions.py
--- jack-3.1.1~/jack_functions.py	2005-11-12 12:16:08.000000000 +0000
+++ jack-3.1.1/jack_functions.py	2005-11-12 12:16:20.000000000 +0000
@@ -236,7 +236,12 @@
     "returns TOC object, needs name of toc-file to read"
     toc = jack_TOC.TOC()
 
-    f = open(tocfile, "r")
+    if not os.path.exists(tocfile):
+        error("Can't open TOC file '%s': file does not exist." % os.path.abspath(tocfile))
+    try:
+        f = open(tocfile, "r")
+    except (IOError, OSError), e:
+        error("Can't open TOC file '%s': %s" % (os.path.abspath(tocfile), e))
 
     tocpath, tocfiledummy = os.path.split(tocfile)
 
diff -urN jack-3.1.1~/jack_prepare.py jack-3.1.1/jack_prepare.py
--- jack-3.1.1~/jack_prepare.py	2005-11-12 12:16:08.000000000 +0000
+++ jack-3.1.1/jack_prepare.py	2005-11-12 16:48:29.000000000 +0000
@@ -58,6 +58,8 @@
                 jack_ripstuff.all_tracks = []
             else:
                 if cf['_image_toc_file']:
+                    # put the absolute path in the variable since we'll change cwd soon
+                    cf['_image_toc_file'] = os.path.abspath(cf['_image_toc_file'])
                     jack_ripstuff.all_tracks, dummy, dummy = jack_functions.cdrdao_gettoc(cf['_image_toc_file'])
                 else:
                     jack_ripstuff.all_tracks = jack_functions.gettoc(cf['_toc_prog'])