X-Git-Url: https://git.jankratochvil.net/?a=blobdiff_plain;f=captive.spec.in;h=5398db144e3dea7aa7f82630826ff402e8230653;hb=04ce4dc0ef16efb6c5804f079ae56cc9dd3b92eb;hp=6b53248c18bcfdaa0ec4770841c77b7c5699a367;hpb=8568853afcf071283a35382bf20898542947bdc1;p=captive.git diff --git a/captive.spec.in b/captive.spec.in index 6b53248..5398db1 100644 --- a/captive.spec.in +++ b/captive.spec.in @@ -238,21 +238,30 @@ touch %{_var}/lock/subsys/@PACKAGE@ %if ! %{static} %preun fuse %endif -/usr/lib/lsb/remove_initd @PACKAGE@ 2>/dev/null || \ - /sbin/chkconfig --del @PACKAGE@ -%{_initrddir}/@PACKAGE@ stop -rm -f %{_var}/lock/subsys/@PACKAGE@ +# Only on real erase, not on upgrade: +if [ $1 = 0 ];then + /usr/lib/lsb/remove_initd @PACKAGE@ 2>/dev/null || \ + /sbin/chkconfig --del @PACKAGE@ + %{_initrddir}/@PACKAGE@ stop + rm -f %{_var}/lock/subsys/@PACKAGE@ +fi %if ! %{static} %preun install %endif -%{_sbindir}/captive-install-fstab --remove +# Only on real erase, not on upgrade: +if [ $1 = 0 ];then + %{_sbindir}/captive-install-fstab --remove +fi %postun /sbin/ldconfig -# Remove stale sandbox chroot directories owned by 'captive.captive': -rm -rf %{_var}/lib/@PACKAGE@/s-* -rm -rf %{_var}/lib/@PACKAGE@/tmp/* +# Only on real erase, not on upgrade: +if [ $1 = 0 ];then + # Remove stale sandbox chroot directories owned by 'captive.captive': + rm -rf %{_var}/lib/@PACKAGE@/s-* + rm -rf %{_var}/lib/@PACKAGE@/tmp/* +fi %files %defattr(-,root,root)