repodb: Do not check compatibility if distro info is not included

Check distro name if specified in index file. If distro release is also
specified, check it for compatibility in addition to distro name.
This commit is contained in:
Fatih Aşıcı
2010-05-30 19:41:26 +00:00
parent 62403a40c4
commit 43f01c4989
+10 -3
View File
@@ -247,10 +247,17 @@ class RepoDB(lazydb.LazyDB):
return
dist_name = self.get_distribution(name)
dist_release = self.get_distribution_release(name)
if dist_name is None:
return
if dist_name != ctx.config.values.general.distribution or \
dist_release != ctx.config.values.general.distribution_release:
compatible = dist_name == ctx.config.values.general.distribution
dist_release = self.get_distribution_release(name)
if dist_release is not None:
compatible &= \
dist_release == ctx.config.values.general.distribution_release
if not compatible:
self.deactivate_repo(name)
raise IncompatibleRepoError(
_("Repository '%s' is not compatible with your "