From 48179b333d9f751987789b9a3f90884ff62f48d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serdar=20Dalg=C4=B1=C3=A7?= Date: Fri, 11 Dec 2009 21:16:09 +0000 Subject: [PATCH] Check individual packages' Distribution Release and architecture properties before installing them. --- ChangeLog | 4 ++++ pisi/operations/install.py | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/ChangeLog b/ChangeLog index f6c2e9ae..7e672bfc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-12-11 Serdar Dalgıç + * pisi/operations/install.py: Check individual packages' Distribution + Release and architecture properties before installing them. + 2009-12-09 Serdar Dalgıç * pisi/specfile.py: Raise meaningful warning when translations.xml has invalid XML, closes bug #8969 diff --git a/pisi/operations/install.py b/pisi/operations/install.py index de2c6b19..0fd08f7d 100644 --- a/pisi/operations/install.py +++ b/pisi/operations/install.py @@ -156,6 +156,17 @@ def install_pkg_files(package_URIs, reinstall = False): d_t[name] = package.metadata.package dfn[name] = x + # check packages' DistributionReleases and Architecture + config = pisi.configfile.ConfigurationFile("/etc/pisi/pisi.conf") + for x in d_t.keys(): + pkg = d_t[x] + if pkg.distributionRelease != config.get("general", "distribution_release"): + raise Exception(_('Package %s is not compatible with your distribution release %s %s.') \ + % (x, config.get("general", "distribution"), config.get("general", "distribution_release"))) + if pkg.architecture != config.get("general", "architecture"): + raise Exception(_('Package %s (%s) is not compatible with your %s architecture.') \ + % (x, pkg.architecture, config.get("general", "architecture"))) + def satisfiesDep(dep): # is dependency satisfied among available packages # or packages to be installed?