#! /bin/sh /usr/share/dpatch/dpatch-run ## 000-Fix_conf_file_search_path by ## Adam Cécile (Le_Vert) ## ## 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