From 65ab02c848ef9d7b28c3f3922c8c14f4c6da93ef Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: May 25 2015 12:21:38 +0000 Subject: ruby: Disable check for R: rubygem when %fedora > 20 (bz #1128094). --- diff --git a/plugins/ruby.py b/plugins/ruby.py index a3fc10b..cf59ab7 100644 --- a/plugins/ruby.py +++ b/plugins/ruby.py @@ -4,7 +4,7 @@ import re import rpm -from FedoraReview import CheckBase, RegistryBase +from FedoraReview import CheckBase, Mock, RegistryBase _GUIDELINES_URI = 'http://fedoraproject.org/wiki/Packaging:Ruby' _GUIDELINES_SECTION_URI = '%(uri)s#%%(section)s' % {'uri': _GUIDELINES_URI} @@ -342,8 +342,14 @@ class GemCheckRequiresRubygems(GemCheckBase): self.type = 'MUST' def run_on_applicable(self): - # it seems easier to check whether .gem is not present in rpms - # than to examine %files + try: + fedora_vers = int(Mock.get_macro("%fedora", self.spec, self.flags)) + except ValueError: + # EPEL? + fedora_vers = 20 + if fedora_vers > 20: + self.set_passed(self.NA) + return failed = [] for pkg_name in self.spec.packages: for suffix in ['-doc', '-fonts', '-devel']: