SHA256
1
0
forked from pool/rpmlint
rpmlint/check-cron-dependency.diff

25 lines
1.2 KiB
Diff
Raw Normal View History

--- FilesCheck.py
+++ FilesCheck.py
@@ -837,6 +837,8 @@ class FilesCheck(AbstractCheck.AbstractCheck):
logrotate_file=res or logrotate_file
if res and res.group(1) != pkg.name:
printError(pkg, 'incoherent-logrotate-file', f)
+ if (f.startswith('/etc/cron.') or res) and not ('cron' in pkg.requires()):
+ printError(pkg, 'missing-dependency-to-cron', "for logrotate script", f)
link=enreg[3]
if link != '':
ext=compr_regex.search(link)
@@ -1468,6 +1470,12 @@ packaged as arch dependent, or something else. Verify what the case is, and
if there's no way to produce useful debuginfo out of it, disable creation of
the debuginfo package.''',
+'missing-dependency-to-cron',
+'''This package installs a file in /etc/logrotate.d/ or in /etc/cron.*/ but
+doesn't require cron to be installed. as cron is not part of the essential packages,
+your package should explicitely require cron to make sure that your logrotate
+or cron job is executed.''',
+
'read-error',
'''This file could not be read. A reason for this could be that the info about
it in the rpm header indicates that it is supposed to be a readable normal file