#293 Fix bug in special subpackages bypass for CheckFullVerReqSub
Merged 6 years ago by leamas. Opened 6 years ago by eclipseo.

file modified
+2 -3
@@ -284,9 +284,8 @@

          for pkg in self.spec.packages:

              if pkg == self.spec.base_package:

                  continue

-             for pkg_end in ['debuginfo', '-javadoc', '-doc']:

-                 if pkg.endswith(pkg_end):

-                     continue

+             if pkg.endswith(('debuginfo', '-javadoc', '-doc')):

+                 continue

              reqs = ''.join(self.rpms.get(pkg).format_requires)

              if regex not in reqs:

                  bad_pkgs.append(pkg)

The current code for escaping special subpackages from CheckFullVerReqSub doesn't work because it's escabing the inner loop "for pkg_end in ['debuginfo', '-javadoc', '-doc']:" whereas for it to work, it needs to escape the outer loop for "pkg in self.spec.packages:". The fix removes the inner loop by taking advantage of the fact that .endswith can take tuple as input.

Pull-Request has been merged by leamas

6 years ago
Metadata