Bug 707596

Summary: Rpmlint shows error when there's comment after %postun
Product: [Fedora] Fedora Reporter: Jan Kaluža <jkaluza>
Component: rpmlintAssignee: Tom "spot" Callaway <tcallawa>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: a.badger, manuel.wolfshant, rebus, tcallawa, tmz
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-25 17:20:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan Kaluža 2011-05-25 13:27:27 UTC
Description of problem:

If I create comment between "%postun -p /sbin/ldconfig" and next section, rpmlint shows following error when executed on the final .rpm package:

libircclient-qt.x86_64: E: postun-without-ldconfig /usr/lib64/libircclient-qt.so.0.5.0
libircclient-qt.x86_64: E: non-empty-%postun /sbin/ldconfig

Spec file fragment:
%postun -p /sbin/ldconfig

# ------------------------------ libircclient-qt -----------------------------

%files

Version-Release number of selected component (if applicable):

rpm.x86_64                          4.8.1-5.fc14              @fedora           
rpm-build.x86_64                    4.8.1-5.fc14              @fedora           
rpm-cron.noarch                     4.8.1-5.fc14              @fedora           
rpm-libs.x86_64                     4.8.1-5.fc14              @fedora           
rpm-python.x86_64                   4.8.1-5.fc14              @fedora           
rpmdevtools.noarch                  7.10-1.fc14               @fedora           
rpmlint.noarch                      1.2-1.fc14                @updates          
rpmorphan.noarch                    1.7-4.fc14                @updates

How reproducible:
always


Steps to Reproduce:
1. Create .spec file as described in description
2. Build package
3. Run RPM lint on that package
  
Actual results:
rpmlint shows:

libircclient-qt.x86_64: E: postun-without-ldconfig /usr/lib64/libircclient-qt.so.0.5.0
libircclient-qt.x86_64: E: non-empty-%postun /sbin/ldconfig

Expected results:
Those errors won't be showed.

Additional info:
I'm not sure if it's bug in rpmlint or rpmbuild. Maybe it's not bug at all, but I would expected that this syntax is allowed from what I've read.

Comment 1 Ville Skyttä 2011-05-25 17:20:23 UTC
There are two bugs in your package:

> libircclient-qt.x86_64: E: postun-without-ldconfig
> /usr/lib64/libircclient-qt.so.0.5.0

Without seeing the complete specfile, I guess you have a libircclient-qt subpackage with shared libs in it.  You need to add a %postun script for that subpackage; the fragment you posted does it only for the main package.

> libircclient-qt.x86_64: E: non-empty-%postun /sbin/ldconfig

run "rpm -qp --scripts" on the binary package to show the scriptlet contents.  rpm ends up passing your "# --------..." to /sbin/ldconfig as a script which was a common source of breakage some time ago when ldconfig didn't tolerate that.  The fix is to remove the comment.

Comment 2 Michal Ambroz 2018-03-23 02:29:47 UTC
I like these visual separators as well and run into same issue.
Workaround is to move that comment to the next section (where it really belongs)

So instead of:
# ========== files =================
%files

To have for example:
%files
# ========== files =================