Package: jack / 3.1.1+cvs20050801-31

51_error_not_block_device.patch Patch series | download
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
34
35
36
Fix an error when the --device passed is a directory.  Debian #360337

$ jack --device=/dev
This is jack 3.1.1 (C)2004 Arne Zellentin <zarne@users.sf.net>
Traceback (most recent call last):
File "/usr/lib/python2.3/site-packages/jack_functions.py", line 148, in gettoc
    exec(jack_helpers.helpers[toc_prog]['toc_fkt'])
  File "<string>", line 11, in ?
IndexError: tuple index out of range
 *error* CDDB.py could not read the disk's TOC. If you already ripped the CD,
         you'll have to cd into the directory which is either named after the
         CD's title or still called jack-xxxxxxxx (xxxxxxxx is a hex number).


--- a/jack_functions.py~	2006-04-05 16:04:06.000000000 +0200
+++ b/jack_functions.py	2006-04-05 16:39:56.000000000 +0200
@@ -21,6 +21,7 @@
 import traceback
 import sndhdr
 import types
+import stat
 import string
 import sys
 import os
--- a/jack_helpers.py~	2006-04-05 16:37:52.000000000 +0200
+++ b/jack_helpers.py	2006-04-05 16:39:25.000000000 +0200
@@ -509,6 +509,8 @@
     error("Device %s does not exist!" % cf['_cd_device'])
 if not os.access(cf['_cd_device'], os.R_OK):
     error("You don't have permission to access device %s!" % cf['_cd_device'])
+if not stat.S_ISBLK(os.stat(cf['_cd_device'])[stat.ST_MODE]):
+    error("Device %s is not a block device!" % cf['_cd_device'])
 try:
     device = cdrom.open(cf['_cd_device'])
     (first, last) = cdrom.toc_header(device)