From: Michael Tremer Date: Fri, 23 Mar 2012 12:21:00 +0000 (+0100) Subject: Merge branch 'signatures' X-Git-Tag: 0.9.22~60 X-Git-Url: http://git.ipfire.org/?p=people%2Fms%2Fpakfire.git;a=commitdiff_plain;h=6b25d4f18aa9c3ed9ed3664fd178009d0c64cba9 Merge branch 'signatures' Conflicts: po/pakfire.pot --- 6b25d4f18aa9c3ed9ed3664fd178009d0c64cba9 diff --cc python/pakfire/base.py index ee9f6857,d193102f..73cf237c --- a/python/pakfire/base.py +++ b/python/pakfire/base.py @@@ -25,8 -25,10 +25,9 @@@ import strin import actions import builder -import config import distro import filelist + import keyring import logger import packages import repository @@@ -75,23 -74,24 +76,26 @@@ class Pakfire(object) if self.path == "/": self.check_is_ipfire() - # Read configuration file(s) - self.config = config.Config(type=mode) - for filename in configs: - self.config.read(filename) - # Assume, that all other keyword arguments are configuration - # parameters. - self.config.update(kwargs) + # Get the configuration. + if config: + assert configs is None, "You cannot pass configs and config." + self.config = config + else: + # Read configuration file(s). + self.config = Config(files=configs) - # Setup the logger - logger.setup_logging(self.config) + # Dump the configuration. self.config.dump() + # Initialize the keyring. + self.keyring = keyring.Keyring(self) + # Get more information about the distribution we are running # or building - self.distro = distro.Distribution(self, distro_config) + self.distro = distro.Distribution(self) + if arch: + self.distro.arch = arch + self.pool = satsolver.Pool(self.distro.arch) self.repos = repository.Repositories(self, enable_repos=enable_repos, disable_repos=disable_repos) diff --cc python/pakfire/cli.py index c2e2dfb3,a96c3b86..df8cb061 --- a/python/pakfire/cli.py +++ b/python/pakfire/cli.py @@@ -20,10 -20,9 +20,11 @@@ ############################################################################### import argparse + import datetime import os +import shutil import sys +import tempfile import pakfire.api as pakfire diff --cc python/pakfire/constants.py index 2c091e42,7567185c..caa6c100 --- a/python/pakfire/constants.py +++ b/python/pakfire/constants.py @@@ -33,10 -30,12 +33,12 @@@ PAKFIRE_HUB = "https://pakfirehub.ipfir SYSCONFDIR = "/etc" 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") +CONFIG_DIR = os.path.join(SYSCONFDIR, "pakfire") +CONFIG_REPOS_DIR = os.path.join(CONFIG_DIR, "repos") +CONFIG_DISTRO_DIR = os.path.join(CONFIG_DIR, "distros") + KEYRING_DIR = os.path.join(SYSCONFDIR, "pakfire.d", "gnupg") + CACHE_DIR = "/var/cache/pakfire" CCACHE_CACHE_DIR = os.path.join(CACHE_DIR, "ccache") CACHE_ENVIRON_DIR = os.path.join(CACHE_DIR, "environments") diff --cc python/pakfire/repository/index.py index ef0d9dfe,9dda6bb9..ec60f5d6 --- a/python/pakfire/repository/index.py +++ b/python/pakfire/repository/index.py @@@ -52,13 -52,6 +52,10 @@@ class Index(object) def __repr__(self): return "<%s %s>" % (self.__class__.__name__, self.repo) - def __len(self): - return len(self.repo) - + @property + def distro(self): + return self.repo.distro + @property def cache(self): return self.repo.cache