From 6999bae2b7bd424bc75f71c478f177a508c4066b Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Thu, 28 Jan 2010 12:55:12 +0000 Subject: [PATCH] get arch,dist and dist_release of pisi.conf from variables --- pisi/actionsapi/variables.py | 3 ++- pisi/operations/install.py | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pisi/actionsapi/variables.py b/pisi/actionsapi/variables.py index 4e4eb00f..e36145ad 100644 --- a/pisi/actionsapi/variables.py +++ b/pisi/actionsapi/variables.py @@ -95,7 +95,8 @@ class Generals: def __init__(self): self.values = ctx.config.values self.architecture = self.values.general.architecture - + self.distribution = self.values.general.distribution + self.distribution_release = self.values.general.distribution_release # As we import this module from build.py, we can't init glb as a # singleton here. Or else Python will bug us with NoneType errors diff --git a/pisi/operations/install.py b/pisi/operations/install.py index 2a2ca969..db1d2280 100644 --- a/pisi/operations/install.py +++ b/pisi/operations/install.py @@ -160,13 +160,13 @@ def install_pkg_files(package_URIs, reinstall = False): if not ctx.get_option('ignore_check'): for x in d_t.keys(): pkg = d_t[x] - if pkg.distributionRelease != ctx.config.values.get("general", "distribution_release"): + if pkg.distributionRelease != ctx.config.values.general.distribution_release: raise Exception(_('Package %s is not compatible with your distribution release %s %s.') \ - % (x, ctx.config.values.get("general", "distribution"), \ - ctx.config.values.get("general", "distribution_release"))) - if pkg.architecture != ctx.config.values.get("general", "architecture"): + % (x, ctx.config.values.general.distribution, \ + ctx.config.values.general.distribution_release)) + if pkg.architecture != ctx.config.values.general.architecture: raise Exception(_('Package %s (%s) is not compatible with your %s architecture.') \ - % (x, pkg.architecture, ctx.config.values.get("general", "architecture"))) + % (x, pkg.architecture, ctx.config.values.general.architecture)) def satisfiesDep(dep): # is dependency satisfied among available packages