Package: jack / 3.1.1+cvs20050801-31

48_search_base_dir.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
running "jack -Q" twice from e.g. $HOME will result in an error in the
second case that the directory already exists.  This is because jack
doesn't find the existing directory, makes a new generic jack-* dir and
then tries to rename it - but that fails since there's an existing dir
already.  jack needs to search base_dir for an existing dir.

--- a/jack_prepare.py
+++ b/jack_prepare.py
@@ -72,6 +72,12 @@
 
             if cf['_scan_dirs']:
                 dirs = [os.getcwd()]
+                # Also scan base_dir since it's not guaranteed that users
+                # run jack in base_dir
+                if cf['_base_dir']:
+                    cf['_base_dir'] = expand(cf['_base_dir'])
+                    if os.path.exists(cf['_base_dir']) and cf['_base_dir'] not in dirs:
+                        dirs.append(cf['_base_dir'])
             else:
                 dirs = cf['_searchdirs']