From 60978f55d4e2023e2ff03d10b31d2000a37bb278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serdar=20Dalg=C4=B1=C3=A7?= Date: Wed, 23 Dec 2009 12:42:43 +0000 Subject: [PATCH] add --ignore-check to pisi install command too, to get rid of architecture and distribution checks --- pisi/cli/install.py | 2 ++ pisi/operations/install.py | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/pisi/cli/install.py b/pisi/cli/install.py index 4673a193..703ee904 100644 --- a/pisi/cli/install.py +++ b/pisi/cli/install.py @@ -49,6 +49,8 @@ expanded to package names. help=_("Do not take build no into account.")) group.add_option("--reinstall", action="store_true", default=False, help=_("Reinstall already installed packages")) + group.add_option("--ignore-check", action="store_true", + default=False, help=_("Skip distribution release and architecture check")) group.add_option("--ignore-file-conflicts", action="store_true", default=False, help=_("Ignore file conflicts")) group.add_option("--ignore-package-conflicts", action="store_true", diff --git a/pisi/operations/install.py b/pisi/operations/install.py index 533a6f49..2a2ca969 100644 --- a/pisi/operations/install.py +++ b/pisi/operations/install.py @@ -157,15 +157,16 @@ def install_pkg_files(package_URIs, reinstall = False): dfn[name] = x # check packages' DistributionReleases and Architecture - for x in d_t.keys(): - pkg = d_t[x] - if pkg.distributionRelease != ctx.config.values.get("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"): - raise Exception(_('Package %s (%s) is not compatible with your %s architecture.') \ - % (x, pkg.architecture, ctx.config.values.get("general", "architecture"))) + 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"): + 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"): + raise Exception(_('Package %s (%s) is not compatible with your %s architecture.') \ + % (x, pkg.architecture, ctx.config.values.get("general", "architecture"))) def satisfiesDep(dep): # is dependency satisfied among available packages