rpmlint/rpmlint-0.84-distregex.patch
Ville Skyttä 0cf0e41b64 - 0.84, fixes #355861, #456304.
- Sync Fedora license list with Wiki revision "16:08, 18 July 2008".
- Rediff patches.
2008-07-26 19:04:08 +00:00

31 lines
1.8 KiB
Diff

diff -up rpmlint-0.84/TagsCheck.py.orig rpmlint-0.84/TagsCheck.py
--- rpmlint-0.84/TagsCheck.py.orig 2008-05-22 16:19:31.000000000 +0300
+++ rpmlint-0.84/TagsCheck.py 2008-07-26 21:54:06.000000000 +0300
@@ -398,6 +398,8 @@ packager_regex=re.compile(Config.getOpti
basename_regex=re.compile('/?([^/]+)$')
changelog_version_regex=re.compile('[^>]([^ >]+)\s*$')
changelog_text_version_regex=re.compile('^\s*-\s*((\d+:)?[\w\.]+-[\w\.]+)')
+dist_regex=Config.getOption('DistRegex')
+if dist_regex: dist_regex=re.compile(dist_regex)
release_ext=Config.getOption('ReleaseExtension')
extension_regex=release_ext and re.compile(release_ext + '$')
use_version_in_changelog=Config.getOption('UseVersionInChangelog', 1)
@@ -624,11 +626,13 @@ class TagsCheck(AbstractCheck.AbstractCh
srpm = pkg[rpm.RPMTAG_SOURCERPM] or ''
# only check when source name correspond to name
if srpm[0:-8] == '%s-%s-%s' % (name, version, release):
- expected=version + '-' + release
+ expected=[version + '-' + release]
if epoch is not None: # regardless of use_epoch
- expected=str(epoch) + ':' + expected
- if expected != ret.group(1):
- printWarning(pkg, 'incoherent-version-in-changelog', ret.group(1), expected)
+ expected[0]=str(epoch) + ':' + expected[0]
+ if dist_regex:
+ expected.append(dist_regex.sub('', expected[0]))
+ if ret.group(1) not in expected:
+ printWarning(pkg, 'incoherent-version-in-changelog', ret.group(1), expected[0])
if clt: changelog=changelog + clt
if use_utf8 and not Pkg.is_utf8_str(' '.join(changelog)):