Remove the old wireshark binary during RPM upgrades.

If we have a pre-alternatives wireshark binary out there (e.g., because
we're upgrading from wireshark-1.10 to wireshark-1.12), get rid of it
in the %pre script.  Otherwise the binary gets left there (because it's
listed as a %ghost in the new spec file).

Change-Id: I5828fcff486af3d269bad8dfe544c7659179bf5e
Reviewed-on: https://code.wireshark.org/review/3332
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
This commit is contained in:
Jeff Morriss 2014-08-01 14:51:53 -04:00
parent fb526204f8
commit c93297c750
1 changed files with 7 additions and 1 deletions

View File

@ -246,10 +246,16 @@ desktop-file-validate %{buildroot}/usr/share/applications/wireshark.desktop
%clean
rm -rf $RPM_BUILD_ROOT
%if %{use_wireshark_group}
%pre
%if %{use_wireshark_group}
getent group wireshark >/dev/null || groupadd -r wireshark
%endif
# If we have a pre-alternatives wireshark binary out there, get rid of it.
# (With 'alternatives' %{_bindir}/wireshark should be a symlink.)
if [ -f %{_bindir}/wireshark ]
then
rm -f %{_bindir}/wireshark
fi
%post -p /sbin/ldconfig