I've had some time to test your patches.
Sam Geeraerts wrote:
Stayvoid wrote:
(Maybe we shouldn't use IOError for this purpose. I'm not sure.)
Indeed. Every exception should be caught, so raising one in the main
code is not good practice.
+ # Check if `/etc/debderiver' already exists
+ # Create it if the dir doesn't exist
+ if not os.path.exists('/etc/debderiver'):
+ print 'Creating `/etc/debderiver\'...'
+ os.makedirs('/etc/debderiver')
+ print 'Done.'
This should also be handled by the installation procedure. I guess it's
good to have this in for now. It should also check if there's a
configuration file. If it's not there, it should suggest to copy the
example file and edit it.
It should be possible to run debderive as a regular user. That directory
can only be created by root. The error message in the parse method
("Unable to load %s") is sufficient to tell the user what's going, I think.
+ # Check for reprepro
+ if not os.path.exists('/usr/bin/reprepro'):
+ raise IOError, 'Missing dependency: install reprepro and try
again.'
+
CONF_DIR_PATH = '/etc/debderiver'
conf = parse(CONF_DIR_PATH)
I merged this into our main branch.
If you're interested, I added a few more items to TODO.
_______________________________________________
gNewSense-dev mailing list
gNewSense-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/gnewsense-dev