From 95079dcb818941d266cd282ac77bc3717b7acf4a8d00557e0c16ee4d46527505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 30 Jan 2014 12:42:54 +0000 Subject: [PATCH] - Add safeguards around the posttrans/postun scripts. OBS-URL: https://build.opensuse.org/package/show/LibreOffice:Factory/libreoffice?expand=0&rev=101 --- libreoffice.changes | 5 +++++ libreoffice.spec | 13 ++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) 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