That allows us to rename files that should not be loaded.
if not files:
# Return system configuration files
files += [CONFIG_FILE]
- files += [os.path.join(CONFIG_DIR, f) for f in os.listdir(CONFIG_DIR)]
+
+ for f in os.listdir(CONFIG_DIR):
+ # Skip all files with wrong extensions.
+ if not f.endswith(CONFIG_DIR_EXT):
+ continue
+
+ # Create absolute path.
+ f = os.path.join(CONFIG_DIR, f)
+ files.append(f)
return files
SCRIPT_DIR = "/usr/lib/pakfire"
CONFIG_DIR = os.path.join(SYSCONFDIR, "pakfire.repos.d")
+CONFIG_DIR_EXT = ".repo"
CONFIG_FILE = os.path.join(SYSCONFDIR, "pakfire.conf")
CACHE_DIR = "/var/cache/pakfire"