Package: jack / 3.1.1+cvs20050801-31

50_check_ripper_encoder.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
Check whether a command passed via --ripper/--encoder actually exists.


Depends on 21_fallback_ripper.patch


diff -urN jack-3.1.1+cvs20050801~/jack_checkopts.py jack-3.1.1+cvs20050801/jack_checkopts.py
--- jack-3.1.1+cvs20050801~/jack_checkopts.py	2006-05-20 14:02:09.000000000 +0200
+++ jack-3.1.1+cvs20050801/jack_checkopts.py	2006-05-20 14:08:54.000000000 +0200
@@ -228,6 +228,7 @@
 def check_rc(cf, global_cf, user_cf, argv_cf):
 
     all_keys = global_cf.keys() + user_cf.keys() + argv_cf.keys()
+    userdef_keys = user_cf.keys() + argv_cf.keys()
     if 'base_dir' not in all_keys:
         warning("You have no standard location set, putting files into the current directory. Please consider setting base_dir in ~/.jack3rc.")
 
@@ -244,6 +245,15 @@
             else:
                 error("No valid ripper found on your system.")
 
+    # Check whether ripper and encoder exist in $PATH.  Skip the check if
+    # it's a plugin since we cannot assume the name of the plugin
+    # corresponds to the executable.
+    for t in ("ripper", "encoder"):
+        helper = cf[t]["val"]
+        if t in userdef_keys and not helper.startswith("plugin_"):
+            if not jack_utils.in_path(helper):
+                error("Helper %s '%s' not found on your system." % (t, helper))
+
     # If the default CD device doesn't exist, see whether we can find another one
     if ('cd_device' not in all_keys and cf["rip_from_device"]["val"] and
         not os.path.exists(cf["cd_device"]["val"])):