def clean_hints(p, hints, strict_lvl, warnings):
#
# fix some common defects in the hints
#
# don't allow a redundant 'package:' or 'package - ' at start of sdesc
#
# match case-insensitively, and use a base package name (trim off any
# leading 'lib' from package name, remove any soversion or 'devel'
# suffix)
#
if 'sdesc' in hints:
colon = re.match(r'^"(.*?)(\s*:|\s+-)', hints['sdesc'])
if colon:
package_basename = re.sub(r'^lib(.*?)(|-devel|\d*)$', r'\1', p)
if package_basename.upper().startswith(colon.group(1).upper()):
logging.log(strict_lvl, "package '%s' sdesc starts with '%s'; this is redundant as the UI will show both the package name and sdesc" % (p, ''.join(colon.group(1, 2))))
warnings = True
return warnings
#
# read a single package
#
评论列表
文章目录