Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package systemd-rpm-macros for openSUSE:Factory checked in at 2021-02-17 18:09:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/systemd-rpm-macros (Old) and /work/SRC/openSUSE:Factory/.systemd-rpm-macros.new.28504 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "systemd-rpm-macros" Wed Feb 17 18:09:42 2021 rev:33 rq:871420 version:10 Changes: -------- --- /work/SRC/openSUSE:Factory/systemd-rpm-macros/systemd-rpm-macros.changes 2020-11-29 12:18:49.153419047 +0100 +++ /work/SRC/openSUSE:Factory/.systemd-rpm-macros.new.28504/systemd-rpm-macros.changes 2021-02-17 18:09:47.581854850 +0100 @@ -1,0 +2,35 @@ +Fri Feb 12 11:46:17 UTC 2021 - Franck Bui <[email protected]> + +- Bump version to 10 + +------------------------------------------------------------------- +Fri Feb 12 11:02:57 UTC 2021 - Franck Bui <[email protected]> + +- Make upstream %systemd_{pre,post,preun,postun} aliases to their SUSE + counterparts + + Packagers can now choose to use the upstream or the SUSE variants + indifferently. For consistency the SUSE variants should be preferred + since almost all SUSE packages already use them but the upstream + versions might be usefull in certain cases where packages need to + support multiple distros based on RPM. + +------------------------------------------------------------------- +Fri Feb 12 10:23:35 UTC 2021 - Franck Bui <[email protected]> + +- Improve the logic used to apply the presets (bsc#1177039) + + Before presests were applied at a) package installation b) new units + introduced via a package update (but after making sure that it was + not a SysV initscript being converted). + + The problem is that a) didn't handle package a renaming or split + properly since the package with the new name is installed rather + being updated and therefore the presets were applied even if they + were already with the old name. + + We now cover this case (and the other ones) by applying presets only + if the units are new and the services are not being migrated. This + regardless of whether this happens during an install or an update. + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ systemd-rpm-macros.spec ++++++ --- /var/tmp/diff_new_pack.bQHWUT/_old 2021-02-17 18:09:48.093855269 +0100 +++ /var/tmp/diff_new_pack.bQHWUT/_new 2021-02-17 18:09:48.093855269 +0100 @@ -1,7 +1,7 @@ # # spec file for package systemd-rpm-macros # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: systemd-rpm-macros -Version: 9 +Version: 10 Release: 0 Summary: RPM macros for systemd License: LGPL-2.1-or-later ++++++ macros.systemd ++++++ --- /var/tmp/diff_new_pack.bQHWUT/_old 2021-02-17 18:09:48.129855299 +0100 +++ /var/tmp/diff_new_pack.bQHWUT/_new 2021-02-17 18:09:48.129855299 +0100 @@ -1,9 +1,10 @@ -# -*- Mode: makefile; indent-tabs-mode: t -*- */ +# -*- Mode: rpm-spec; indent-tabs-mode: t -*- */ # RPM macros for packages installing systemd unit files # ### # -# When a package install systemd unit files, it should use the following macros: +# When a package install systemd unit files, it should use the +# following macros: # # add %systemd_requires in the specfile # @@ -20,6 +21,10 @@ # %service_del_postun demo.service # %service_del_postun_without_restart demo.service # +# Note: the upstream variants are also available and are aliases to +# their SUSE counterparts. However for consistency the SUSE macros +# should be preferred unless the package is intended to be portable +# across multiple distributions based on RPM. %_unitdir /usr/lib/systemd/system %_userunitdir /usr/lib/systemd/user @@ -68,8 +73,17 @@ fi \ %{nil} +# Figure out when presets need to be applied. This information is only +# recorded during %pre and is actually applied during %post. +# +# Presets might need to be applied during package install but also +# during package update. On update, packages might introduce new +# services but we need to make sure that's not happening during the +# migration of SysV initscripts. On package install, presets might +# have been already applied because of package renaming or split. +# %service_add_pre() \ -if [ $1 -gt 1 -a -x /usr/bin/systemctl ]; then \ +if [ -x /usr/bin/systemctl ]; then \ for service in %{?*} ; do \ if [ ! -e "/usr/lib/systemd/system/$service" ] && \ [ ! -e "/etc/init.d/${service%.*}" ]; then \ @@ -80,22 +94,18 @@ fi \ %{nil} -# On install, tell systemd to reload its unit files +# Apply the presets if %pre told us to do so. # %service_add_post() \ if [ -x /usr/bin/systemctl ]; then \ - if [ $1 -eq 1 ]; then \ - /usr/bin/systemctl preset %{?*} || : \ - else \ - for service in %{?*} ; do \ - if [ -e "/run/systemd/rpm/needs-preset/$service" ]; then \ - /usr/bin/systemctl preset "$service" || : \ - fi \ - done \ - rm -fr /run/systemd/rpm/needs-preset \ - \ - /usr/lib/systemd/systemd-sysv-convert --apply %{?*} || : \ - fi \ + for service in %{?*} ; do \ + if [ -e "/run/systemd/rpm/needs-preset/$service" ]; then \ + /usr/bin/systemctl preset "$service" || : \ + rm -f /run/systemd/rpm/needs-preset/$service \ + else \ + /usr/lib/systemd/systemd-sysv-convert --apply %{?*} || : \ + fi \ + done \ fi \ %{nil} @@ -156,22 +166,14 @@ # Upstream variants # -%systemd_post() \ -if [ $1 -eq 1 -a -x /usr/bin/systemctl ] ; then \ - # Initial installation \ - /usr/bin/systemctl --no-reload preset %{?*} || : \ -fi \ -%{nil} +%systemd_pre() %{expand::%%service_add_pre %{?**}} +%systemd_post() %{expand::%%service_add_post %{?**}} +%systemd_preun() %{expand::%%service_del_preun %{?**}} +%systemd_postun() %{expand::%%service_del_postun_without_restart %{?**}} +%systemd_postun_with_restart() %{expand::%%service_del_postun %{?**}} %systemd_user_post() %{expand:%systemd_post \\--global %%{?*}} -%systemd_preun() \ -if [ $1 -eq 0 -a -x /usr/bin/systemctl ]; then \ - # Package removal, not upgrade \ - /usr/bin/systemctl --no-reload disable --now %{?*} || : \ -fi \ -%{nil} - %systemd_user_preun() \ if [ $1 -eq 0 -a -x /usr/bin/systemctl ]; then \ # Package removal, not upgrade \ @@ -179,25 +181,9 @@ fi \ %{nil} -%systemd_postun() \ -if [ -x /usr/bin/systemctl ]; then \ - /usr/bin/systemctl daemon-reload || : \ -fi \ -%{nil} - %systemd_user_postun() %{nil} %systemd_user_postun_with_restart() %{nil} -%systemd_postun_with_restart() \ -if [ -x /usr/bin/systemctl ]; then \ - /usr/bin/systemctl daemon-reload || : \ -fi \ -if [ $1 -ge 1 -a -x /usr/bin/systemctl ]; then \ - # Package upgrade, not uninstall \ - /usr/bin/systemctl try-restart %{?*} || : \ -fi \ -%{nil} - %udev_hwdb_update() \ [ -x /usr/bin/udevadm ] && /usr/bin/udevadm hwdb --update || : \ %{nil}
