Skip to content

Commit

Permalink
TagsCheck: restore space exclusion to license_exception_regex
Browse files Browse the repository at this point in the history
In 7d707f7 (TagsCheck: handle license exception in grouping,
2023-03-03), the regex lost the exclusion of space characters.  This
isn't immediately noticeable because we strip the strings generated by
the regex before use, but it's better to keep the regex more precise.

Suggested-by: Daniel Garcia Moreno <daniel.garcia@suse.com>
  • Loading branch information
tmzullinger committed Mar 20, 2023
1 parent baf5da0 commit 48aa148
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rpmlint/checks/TagsCheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
leading_space_regex = re.compile(r'^\s+')
pkg_config_regex = re.compile(r'^/usr/(?:lib\d*|share)/pkgconfig/')
license_regex = re.compile(r'\(([^)]+)\)|\s(?:and|or|AND|OR)\s')
license_exception_regex = re.compile(r'(\S+)\s(?:WITH|with)\s([^)]+)')
license_exception_regex = re.compile(r'(\S+)\s(?:WITH|with)\s([^)\s]+)')
invalid_version_regex = re.compile(r'([0-9](?:rc|alpha|beta|pre).*)', re.IGNORECASE)
# () are here for grouping purpose in the regexp
tag_regex = re.compile(r'^((?:Auto(?:Req|Prov|ReqProv)|Build(?:Arch(?:itectures)?|Root)|(?:Build)?Conflicts|(?:Build)?(?:Pre)?Requires|Copyright|(?:CVS|SVN)Id|Dist(?:ribution|Tag|URL)|DocDir|(?:Build)?Enhances|Epoch|Exclu(?:de|sive)(?:Arch|OS)|Group|Icon|License|Name|No(?:Patch|Source)|Obsoletes|Packager|Patch\d*|Prefix(?:es)?|Provides|(?:Build)?Recommends|Release|RHNPlatform|Serial|Source\d*|(?:Build)?Suggests|Summary|(?:Build)?Supplements|(?:Bug)?URL|Vendor|Version)(?:\([^)]+\))?:)\s*\S', re.IGNORECASE)
Expand Down

0 comments on commit 48aa148

Please sign in to comment.