Skip to content

Commit 1c04a49

Browse files
danigmConan-Kudo
authored andcommitted
Remove post-without-tmpfile-creation warning
This warning is not needed anymore. %tmpfiles macro nowadays is a noop since it is done via triggers in the systemd package. Fix #1374
1 parent 6b2fcd1 commit 1c04a49

File tree

3 files changed

+0
-25
lines changed

3 files changed

+0
-25
lines changed

rpmlint/checks/TmpFilesCheck.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ def check(self, pkg):
3030
continue
3131

3232
self._check_pre_tmpfile(fname, pkg)
33-
self._check_post_tmpfile(fname, pkg)
3433
self._check_tmpfile_in_filelist(pkgfile, pkg)
3534

3635
def _check_pre_tmpfile(self, fname, pkg):
@@ -49,22 +48,6 @@ def _check_pre_tmpfile(self, fname, pkg):
4948
if pre and tmpfiles_regex.search(pre):
5049
self.output.add_info('W', pkg, 'pre-with-tmpfile-creation', fname)
5150

52-
def _check_post_tmpfile(self, fname, pkg):
53-
"""
54-
Check if the %post section contains 'systemd-tmpfiles --create' call.
55-
56-
Print a warning if there is no such call in the %post section.
57-
"""
58-
post = pkg[rpm.RPMTAG_POSTIN]
59-
60-
basename = Path(fname).name
61-
tmpfiles_regex = re.compile(r'systemd-tmpfiles --create .*%s'
62-
% re.escape(basename))
63-
64-
if post and tmpfiles_regex.search(post):
65-
return
66-
self.output.add_info('W', pkg, 'post-without-tmpfile-creation', fname)
67-
6851
def _check_tmpfile_in_filelist(self, pkgfile, pkg):
6952
"""
7053
Check if the tmpfile is listed in the filelist and marked as %ghost.

rpmlint/descriptions/TmpFilesCheck.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ pre-with-tmpfile-creation="""
22
%pre section contains %tmpfiles_create macro that should be in the
33
%post section instead.
44
"""
5-
post-without-tmpfile-creation="""
6-
Please use the %tmpfiles_create macro in %post for each of your
7-
tmpfiles.d files if you expect this file or directory to be
8-
available after package installation (and before reboot).
9-
"""
105
tmpfile-not-regular-file="""
116
Files in tmpfiles.d need to be regular files.
127
"""

test/test_tmp_files.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ def test_tmpfiles(package, tmpfilescheck):
2525
out = output.print_results(output.results)
2626

2727
assert 'W: pre-with-tmpfile-creation ' not in out
28-
assert 'W: post-without-tmpfile-creation /usr/lib/tmpfiles.d/krb5.conf' in out
2928
assert 'W: tmpfile-not-in-filelist /var/lib/kerberos' in out
3029
assert 'W: tmpfile-not-regular-file /usr/lib/tmpfiles.d/symlink.conf' in out
3130

@@ -37,7 +36,6 @@ def test_tmpfiles2(package, tmpfilescheck):
3736
out = output.print_results(output.results)
3837

3938
assert 'W: pre-with-tmpfile-creation /usr/lib/tmpfiles.d/systemd-tmpfiles.conf' in out
40-
assert 'W: post-without-tmpfile-creation' in out
4139
assert 'W: tmpfile-not-in-filelist /run/my_new_directory' in out
4240
assert 'W: tmpfile-not-regular-file' not in out
4341

@@ -49,6 +47,5 @@ def test_tmpfiles_correct(package, tmpfilescheck):
4947
out = output.print_results(output.results)
5048

5149
assert 'W: pre-with-tmpfile-creation' not in out
52-
assert 'W: post-without-tmpfile-creation' not in out
5350
assert 'W: tmpfile-not-regular-file' not in out
5451
assert 'W: tmpfile-not-in-filelist' not in out

0 commit comments

Comments
 (0)