From b5576696b5bb2c2e12d5761ae334457bb091c2a0b6bde85b8e2caa834d11ae19 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 15 Sep 2020 06:21:02 +0000 Subject: [PATCH] Accepting request 833856 from home:1Antoine1:boo1175919 - Add migration code to handle upgrade from old version of the man package not supporting alternative path move (boo#1175919). Bug was reopened by someone who skipped the Tumbleweed snapshot that changed libexecdir. At this point, I don't think that encumbering spec file just to ensure migration path from older Tumbleweed upgrades worth it - Tumbleweed being fast moving with informed users. But it made me think that migration path from Leap to Tumbleweed is also broken; And the one from Leap 15.2 to the next Leap version (or whatever the name becomes) will be broken as well. So it might actually be good to add migration stuff. Feel free to decline though or do it differently, I'm not a fan of such things. I've tested only: - Upgrade from freshly installed old package (the one with old libexecdir and old update-alternatives calls, rebuilt here: https://build.opensuse.org/package/show/home:1Antoine1:branches:Base:System/man). - Upgrade from current man package freshly installed. OBS-URL: https://build.opensuse.org/request/show/833856 OBS-URL: https://build.opensuse.org/package/show/Base:System/man?expand=0&rev=122 --- man.changes | 6 ++++++ man.spec | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/man.changes b/man.changes index 45e3161..b508db9 100644 --- a/man.changes +++ b/man.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Sep 11 19:34:46 UTC 2020 - Antoine Belvire + +- Add migration code to handle upgrade from old version of the man + package not supporting alternative path move (boo#1175919). + ------------------------------------------------------------------- Sun Aug 30 17:39:08 UTC 2020 - Antoine Belvire diff --git a/man.spec b/man.spec index aed88f5..fb64718 100644 --- a/man.spec +++ b/man.spec @@ -295,6 +295,15 @@ test -d var/catman/ && rm -rf var/catman/ || true --slave %{_mandir}/man1/apropos.1%{?ext_man} apropos.1%{?ext_man} %{_mandir}/man1/apropos-db.1%{?ext_man} \ --slave %{_mandir}/man1/whatis.1%{?ext_man} whatis.1%{?ext_man} %{_mandir}/man1/whatis-db.1%{?ext_man} +# Old man packages did not apply the proper update-alternatives calls to ensure +# alternative path move. As a result, the alternative path move induced by +# libexecdir move breaks man wrapper (boo#1175919). Hence the following migration +# code for upgrades from Leap 15.2 or Tumbleweed snapshots older than 20200826. +# To be removed when support for upgrades from Leap 15.2 is dropped (dec. 2021). +if [ %{_libexecdir} != %{_prefix}/lib ] && [ -f %{_prefix}/lib/man-db/wrapper ] ; then + update-alternatives --quiet --remove man %{_prefix}/lib/man-db/wrapper +fi + %preun %if %{with sdtimer} %service_del_preun man-db-create.service