From: Michael Tremer Date: Sun, 13 Feb 2011 15:30:35 +0000 (+0100) Subject: Read system configuration files correctly. X-Git-Tag: 0.9.3~175 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afd1400d86bac786df28604a1877678cb57a05ad;p=pakfire.git Read system configuration files correctly. --- diff --git a/pakfire/config.py b/pakfire/config.py index e86a4137c..556ac7e4a 100644 --- a/pakfire/config.py +++ b/pakfire/config.py @@ -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) diff --git a/pakfire/constants.py b/pakfire/constants.py index 87b70773a..fef8ba698 100644 --- a/pakfire/constants.py +++ b/pakfire/constants.py @@ -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")