You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/net-nntp/hellanzb/files/hellanzb-0.13-Fix_conf_file...

32 lines
1.2 KiB

#! /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