projects
/
quix0rs-apt-p2p.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8892328
)
Fixed some packaging issues with config file handling.
author
Cameron Dale
<camrdale@gmail.com>
Wed, 20 Feb 2008 19:34:47 +0000
(11:34 -0800)
committer
Cameron Dale
<camrdale@gmail.com>
Wed, 20 Feb 2008 19:34:47 +0000
(11:34 -0800)
apt-dht.py
patch
|
blob
|
history
diff --git
a/apt-dht.py
b/apt-dht.py
index b096d383cd831927f39202de7fca3647aa99121e..1d9933b47d39b280dbd205e347c0479d06fb8add 100644
(file)
--- a/
apt-dht.py
+++ b/
apt-dht.py
@@
-19,7
+19,7
@@
from twisted.web2 import channel
from apt_dht.apt_dht_conf import config, version, DEFAULT_CONFIG_FILES
from apt_dht.interfaces import IDHT
from apt_dht.apt_dht_conf import config, version, DEFAULT_CONFIG_FILES
from apt_dht.interfaces import IDHT
-config_file =
[]
+config_file =
''
if __name__ == '__main__':
# Parse command line parameters when started on command line
if __name__ == '__main__':
# Parse command line parameters when started on command line
@@
-28,7
+28,7
@@
if __name__ == '__main__':
['help', 'h', 'Print this help message'],
]
optParameters = [
['help', 'h', 'Print this help message'],
]
optParameters = [
- ['config-file', 'c',
[]
, "Configuration file"],
+ ['config-file', 'c',
''
, "Configuration file"],
['log-file', 'l', '-', "File to log to, - for stdout"],
]
longdesc="apt-dht is a peer-to-peer downloader for apt users"
['log-file', 'l', '-', "File to log to, - for stdout"],
]
longdesc="apt-dht is a peer-to-peer downloader for apt users"
@@
-51,7
+51,9
@@
if __name__ == '__main__':
f = open(log_file, 'w')
log.startLogging(f, setStdout=1)
f = open(log_file, 'w')
log.startLogging(f, setStdout=1)
-config.read(DEFAULT_CONFIG_FILES + [config_file])
+log.msg("Loading config files: '%s'" % "', '".join(DEFAULT_CONFIG_FILES + [config_file]))
+config_read = config.read(DEFAULT_CONFIG_FILES + [config_file])
+log.msg("Successfully loaded config files: '%s'" % "', '".join(config_read))
if config.has_option('DEFAULT', 'username') and config.get('DEFAULT', 'username'):
uid,gid = pwd.getpwnam(config.get('DEFAULT', 'username'))[2:4]
else:
if config.has_option('DEFAULT', 'username') and config.get('DEFAULT', 'username'):
uid,gid = pwd.getpwnam(config.get('DEFAULT', 'username'))[2:4]
else: