summaryrefslogtreecommitdiff
blob: ee22dd20c1ed867e4db8a42baaf85ed59fdb63af (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
#! /bin/sh /usr/share/dpatch/dpatch-run
## 000-Fix_conf_file_search_path by
## Adam Cécile (Le_Vert) <gandalf@le-vert.net>
##
## DP: Search for configuration file in $HOME/.hellanzb/ or /etc/

@DPATCH@

diff -u hellanzb-0.11/Hellanzb/Core.py hellanzb-0.11/Hellanzb/Core.py.new
--- hellanzb-0.11/Hellanzb/Core.py	2007-02-10 15:01:50.000000000 +0100
+++ hellanzb-0.11/Hellanzb/Core.py.new	2007-02-10 15:05:48.000000000 +0100
@@ -33,16 +33,9 @@
         else:
             error('Unable to load specified config file: ' + optionalConfigFile)
             sys.exit(1)
-
-    # look for conf in this order: sys.prefix, ./, or ./etc/
-    confDirs = [os.path.join(sys.prefix, 'etc')]
-    try:
-        confDirs.append(os.path.join(os.getcwd(), 'etc'))
-        confDirs.append(os.getcwd())
-    except OSError, ose:
-        if ose.errno != 2:
-            raise
-        # OSError: [Errno 2] No such file or directory. cwd doesn't exist
+    
+    # Look for conf file in /etc or $HOME/.hellanzb
+    confDirs = [ os.path.expanduser('~') + '/.hellanzb', '/etc' ]
 
     # hard coding preferred Darwin config file location, kind of lame. but I'd rather do
     # this then make an etc dir in os x's Python.framework directory