diff --git a/libreoffice.changes b/libreoffice.changes index 8ac8f61..5229b6f 100644 --- a/libreoffice.changes +++ b/libreoffice.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jan 30 12:42:48 UTC 2014 - tchvatal@suse.com + +- Add safeguards around the posttrans/postun scripts. + ------------------------------------------------------------------- Wed Jan 29 12:04:16 UTC 2014 - tchvatal@suse.com diff --git a/libreoffice.spec b/libreoffice.spec index 2c0165d..235db1e 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -724,11 +724,18 @@ Provides additional %{langname} translations and resources for %{project}. \ \ %posttrans %{pkgname} \ rpm -ql %{pkgname} > %{_datadir}/libreoffice/%{pkgname}_list.txt || true \ -%{_datadir}/libreoffice/link-to-ooo-home %{_datadir}/libreoffice/%{pkgname}_list.txt || true \ +if [ -f %{_datadir}/libreoffice/%{pkgname}_list.txt ] ; then \ + %{_datadir}/libreoffice/link-to-ooo-home %{_datadir}/libreoffice/%{pkgname}_list.txt || true \ +else \ + echo "Unable to generate filelist" \ + rpm -ql %{pkgname} \ +fi \ \ %postun %{pkgname} \ -test "$1" = "0" && %{_datadir}/libreoffice/link-to-ooo-home --unlink %{_datadir}/libreoffice/%{pkgname}_list.txt \ -test "$1" = "0" && rm -f %{_datadir}/libreoffice/%{pkgname}_list.txt 2> /dev/null \ +if [ "$1" = "0" -a -f %{_datadir}/libreoffice/%{pkgname}_list.txt ]; then \ + %{_datadir}/libreoffice/link-to-ooo-home --unlink %{_datadir}/libreoffice/%{pkgname}_list.txt || true \ + rm -f %{_datadir}/libreoffice/%{pkgname}_list.txt 2> /dev/null || true \ +fi \ %{nil} %langpack -l af -n Afrikaans