Skip to content

Instantly share code, notes, and snippets.

@scop
Created July 10, 2015 07:01
Show Gist options
  • Save scop/3080ec1b86fa24f5e012 to your computer and use it in GitHub Desktop.
Save scop/3080ec1b86fa24f5e012 to your computer and use it in GitHub Desktop.
diff -ur /usr/share/rpmlint/TagsCheck.py rpmlint/TagsCheck.py
--- /usr/share/rpmlint/TagsCheck.py 2006-06-28 23:10:02.000000000 +0200
+++ rpmlint/TagsCheck.py 2006-07-03 18:22:29.000000000 +0200
@@ -401,6 +401,9 @@
use_utf8=Config.getOption('UseUTF8', Config.USEUTF8_DEFAULT)
requires_in_usr_local_regex=re.compile('^/usr/local/bin')
max_line_len=79
+valid_devel_group=Config.getOption('DevelGroups')
+if valid_devel_group:
+ valid_devel_group_regex=re.compile(Config.getOption('DevelGroups'))
def spell_check(pkg, str, tagname):
for seq in string.split(str, ' '):
@@ -495,6 +498,12 @@
else:
if is_devel and not is_source:
base=is_devel.group(1)
+
+ group=pkg[rpm.RPMTAG_GROUP]
+ if group:
+ if valid_devel_group and not valid_devel_group_regex.search(group):
+ printError(pkg, 'invalid-devel-group', group)
+
dep=None
has_so=0
for f in pkg.files().keys():
@@ -758,6 +767,9 @@
'''The value of the Group tag in the package is not valid. Valid groups are:
%s''' % fill('"' + '", "'.join(VALID_GROUPS) + '".', 78),
+'invalid-devel-group',
+'''The package is named -devel but its group is not a development one.''',
+
'no-changelogname-tag',
'''There is no %changelog tag in your spec file. To insert it, just insert a
'%changelog' in your spec file and rebuild it.''',
diff -ur /usr/share/rpmlint/config rpmlint/config
--- /usr/share/rpmlint/config 2006-06-29 07:48:55.000000000 +0200
+++ rpmlint/config 2006-07-03 18:16:30.000000000 +0200
@@ -96,7 +96,7 @@
setOption('ValidGroups',mdv_valid_group)
setOption('ForbiddenWords', 'mandrake')
-
+setOption('DevelGroups','^Development/')
# Standard exceptions:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment