rpmlint/rpmlint-0.77-distregex.patch
Ville Skyttä 269ccb0e35 - 0.77, fixes #194466, #195962, #196008, #196985.
- Make "disttag" configurable using the DistRegex config file option.
- Sync standard users and groups with the FC setup package.
- Disable MenuCheck by default, it's currently Mandriva specific.
- Use upstream default valid License tag list, fixes #191078.
- Use upstream default valid Group tag list (dynamically retrieved from the
    GROUPS file shipped with rpm).
- Allow /usr/libexec, fixes #195992.
2006-06-29 20:29:40 +00:00

32 lines
1.7 KiB
Diff

Index: TagsCheck.py
===================================================================
--- TagsCheck.py (revision 1215)
+++ TagsCheck.py (working copy)
@@ -380,6 +380,8 @@
packager_regex=re.compile(Config.getOption('Packager'))
basename_regex=re.compile('/?([^/]+)$')
changelog_version_regex=re.compile('[^>]([^ >]+)\s*$')
+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)
@@ -591,11 +593,13 @@
srpm=pkg[rpm.RPMTAG_SOURCERPM]
# 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])
clt=pkg[rpm.RPMTAG_CHANGELOGTEXT]
if clt: changelog=changelog + clt