gnewsense-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnewsense-dev] Debderive


From: Stayvoid
Subject: Re: [Gnewsense-dev] Debderive
Date: Sun, 26 Feb 2012 04:43:21 +0300

> 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()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]