Bug 1275790 - spec file includes triggers with overlapping version intervals
spec file includes triggers with overlapping version intervals
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: cups (Show other bugs)
All Linux
low Severity low
: rc
: ---
Assigned To: Zdenek Dohnal
Petr Sklenar
: Patch
Depends On:
  Show dependency treegraph
Reported: 2015-10-27 14:18 EDT by Jiri Popelka
Modified: 2016-11-04 02:46 EDT (History)
5 users (show)

See Also:
Fixed In Version: cups-1.6.3-23.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-11-04 02:46:14 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jiri Popelka 2015-10-27 14:18:21 EDT
Trying to build with newer rpm version (in Fedora) results in:

error: line 601: Trigger fired by the same package is already defined in spec file: %triggerin -- samba-client

That's because we have two '%triggerun -- %{name}' with overlapping version intervals:

<spec snippet>
%triggerun -- %{name} < 1:1.5.0-22
# This package is allowed to autostart; however, the upgrade trigger
# in Fedora 16 final failed to actually do this.  Do it now as a
# one-off fix for bug #748841.
/bin/systemctl --no-reload enable %{name}.{service,socket,path} >/dev/null 2>&1 || :

%triggerun -- %{name} < 1:1.5-0.9
# Save the current service runlevel info
# User must manually run systemd-sysv-convert --apply cups
# to migrate them to systemd targets
%{_bindir}/systemd-sysv-convert --save %{name} >/dev/null 2>&1 || :

# This package is allowed to autostart:
/bin/systemctl --no-reload enable %{name}.{service,socket,path} >/dev/null 2>&1 || :

# Run these because the SysV package being removed won't do them
/sbin/chkconfig --del cups >/dev/null 2>&1 || :
/bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || :
</spec snippet>

The story behind these two triggers is bug #748841. Tim first fixed [1] the '< 1:1.5-0.9' trigger and then added [2] another trigger for already updated packages.

From bug #1247140, comment #1:
"Previously rpm didn't refuse to build packages with overlapping version intervals but rpm always set off only one trigger. So probably triggers in your package didn't work as you expected also in previous version of rpm."

So I think we should remove the '%triggerun -- %{name} < 1:1.5.0-22', because it might lead to some hard-to-reproduce problems when upgrading from RHEL-6.
We actually don't need it as the '< 1:1.5-0.9' trigger has already been correct.

[1] http://pkgs.fedoraproject.org/cgit/cups.git/commit/?id=d44ca3247c00727ecfc986027d847fe77c15250d
[2] http://pkgs.fedoraproject.org/cgit/cups.git/commit/?id=cb5964de441f16576888ef454b22a5ec5f7c1d83
Comment 1 Tim Waugh 2015-11-02 05:46:43 EST
Agreed, nice analysis.
Comment 7 errata-xmlrpc 2016-11-04 02:46:14 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.