> 5) show an error message instead of raising an exception; > 6) Check if configuration file exists.
Pastebin copy: http://pastebin.com/raw.php?i=2509t1dd --- debderiver +++ debderiver_patch3_2.py @@ -478,13 +478,18 @@ if __name__ == "__main__": - # Check for reprepro - if not os.path.exists('/usr/bin/reprepro'): - raise IOError, 'Missing dependency: install reprepro and try again.' - + try: + open('/usr/bin/reprepro') + except IOError: + sys.stderr.write('Missing dependency: install reprepro and try again\n') + CONF_DIR_PATH = '/etc/debderiver' - + + try: + open('%s/debderiver.yaml' % CONF_DIR_PATH) + except IOError: + sys.stderr.write('Copy "debderiver.yaml" to "%s" and edit it to suit your needs\n' % CONF_DIR_PATH) conf = parse(CONF_DIR_PATH) rr = Reprepro(conf) - rr.configure() + rr.configure() rr.update() _______________________________________________ gNewSense-dev mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/gnewsense-dev
