From e029153846749ba9d1b0805ee9ae22ea77abfda2c711a079e212551a3c040eb0 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 24 Jun 2021 21:48:23 +0000 Subject: [PATCH] - Remove real directory of %{python_sitelib}/pytz/zoneinfo when upgrading, before it is replaced by a symlink (bsc#1185748). OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pytz?expand=0&rev=98 --- python-pytz.changes | 6 ++++++ python-pytz.spec | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/python-pytz.changes b/python-pytz.changes index 7c82528..f0215e1 100644 --- a/python-pytz.changes +++ b/python-pytz.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jun 24 21:46:08 UTC 2021 - Matej Cepl + +- Remove real directory of %{python_sitelib}/pytz/zoneinfo when + upgrading, before it is replaced by a symlink (bsc#1185748). + ------------------------------------------------------------------- Fri May 28 09:56:44 UTC 2021 - pgajdos@suse.com diff --git a/python-pytz.spec b/python-pytz.spec index fbf4e2a..f800269 100644 --- a/python-pytz.spec +++ b/python-pytz.spec @@ -82,6 +82,11 @@ ln -s %{_datadir}/zoneinfo %{buildroot}%{$python_sitelib}/pytz/zoneinfo %check %pyunittest discover -v +%pre +if [ $1 -gt 1 ] ; then +[ "$(readlink -e %{python_sitelib}/pytz/zoneinfo)" == "%{python_sitelib}/pytz/zoneinfo" ] && rm -rf %{python_sitelib}/pytz/zoneinfo +fi || : + %files %{python_files} %license LICENSE.txt %doc README.rst