]> git.ipfire.org Git - pakfire.git/commitdiff
Read system configuration files correctly.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 13 Feb 2011 15:30:35 +0000 (16:30 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 13 Feb 2011 15:30:35 +0000 (16:30 +0100)
pakfire/config.py
pakfire/constants.py

index e86a4137c61f293076bdd8272ba57d8ca3706f3f..556ac7e4a480f4d9102f88c23d32de52fe50d7c6 100644 (file)
@@ -39,7 +39,7 @@ class Config(object):
 
        def read(self, filename):
                # If filename does not exist we return silently
-               if not os.path.exists(filename):
+               if not filename or not os.path.exists(filename):
                        return
 
                filename = os.path.abspath(filename)
index 87b70773ac3b2e0550832ba30942163a441d2b61..fef8ba698d712b97cb01acfbbd4e434324446997 100644 (file)
@@ -3,6 +3,8 @@
 import os.path
 
 SYSCONFDIR = os.path.join(os.path.dirname(__file__), "..", "examples")
+if not os.path.exists(SYSCONFDIR):
+       SYSCONFDIR = "/etc"
 
 CONFIG_DIR = os.path.join(SYSCONFDIR, "pakfire.repos.d")
 CONFIG_FILE = os.path.join(SYSCONFDIR, "pakfire.conf")