Hello community, here is the log from the commit of package systemd-rpm-macros for openSUSE:Factory checked in at 2019-03-14 22:42:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/systemd-rpm-macros (Old) and /work/SRC/openSUSE:Factory/.systemd-rpm-macros.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "systemd-rpm-macros" Thu Mar 14 22:42:15 2019 rev:28 rq:684199 version:4 Changes: -------- --- /work/SRC/openSUSE:Factory/systemd-rpm-macros/systemd-rpm-macros.changes 2019-03-04 09:08:35.184725895 +0100 +++ /work/SRC/openSUSE:Factory/.systemd-rpm-macros.new.28833/systemd-rpm-macros.changes 2019-03-14 22:42:18.794641678 +0100 @@ -1,0 +2,24 @@ +Tue Mar 12 08:17:25 UTC 2019 - Franck Bui <[email protected]> + +- $1 can never be empty or it's an rpm bug + +------------------------------------------------------------------- +Tue Mar 12 08:03:45 UTC 2019 - Franck Bui <[email protected]> + +- Get rid of $FIRST_ARG + + $FIRST_ARG was probably introduced because the %service_* macros + were playing tricks on the shell positional parameters. This is bad + practice and error prone so let's assume that no macros should do + that anymore and hence it's safe to assume that positional + parameters remains unchanged after any rpm macro call. + + All users of $FIRST_ARG should have been fixed by now and in most + cases the use of the variable was unneeded (since the macros don't + change the shell parameters) and thus confusing. + + 'net-snmp' has a different use of FIRST_ARG though as it tried to + fake an update during a package installation. Fortunately this could + have been fixed too. + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ macros.systemd ++++++ --- /var/tmp/diff_new_pack.DDvPij/_old 2019-03-14 22:42:19.466641445 +0100 +++ /var/tmp/diff_new_pack.DDvPij/_new 2019-03-14 22:42:19.466641445 +0100 @@ -72,10 +72,9 @@ %{nil} %service_add_pre() \ -test -n "$FIRST_ARG" || FIRST_ARG="$1" \ # disable migration if initial install under systemd \ [ -d /var/lib/systemd/migrated ] || mkdir -p /var/lib/systemd/migrated || : \ -if [ "$FIRST_ARG" -eq 1 ]; then \ +if [ $1 -eq 1 ]; then \ for service in %{?*} ; do \ sysv_service="${service%%.*}" \ touch "/var/lib/systemd/migrated/$sysv_service" || : \ @@ -105,18 +104,17 @@ # On install, tell systemd to reload its unit files %service_add_post() \ -test -n "$FIRST_ARG" || FIRST_ARG="$1" \ [ -d /var/lib/systemd/migrated ] || mkdir -p /var/lib/systemd/migrated || : \ \ if [ -x /usr/bin/systemctl ]; then \ /usr/bin/systemctl daemon-reload || : \ fi \ \ -if [ "$FIRST_ARG" -eq 1 ]; then \ +if [ $1 -eq 1 ]; then \ if [ -x /usr/bin/systemctl ]; then \ /usr/bin/systemctl preset %{?*} || : \ fi \ -elif [ "$FIRST_ARG" -gt 1 ]; then \ +elif [ $1 -gt 1 ]; then \ for service in %{?*} ; do \ if [ ! -e "/run/rpm-%{name}-update-$service-new-in-upgrade" ]; then \ continue \ @@ -150,8 +148,7 @@ # variable if not found use the value read from /etc/sysconfig/services # %service_del_preun(fn) \ -test -n "$FIRST_ARG" || FIRST_ARG="$1" \ -if [ "$FIRST_ARG" -eq 0 -a -x /usr/bin/systemctl ]; then \ +if [ $1 -eq 0 -a -x /usr/bin/systemctl ]; then \ # Package removal, not upgrade \ /usr/bin/systemctl --no-reload disable %{?*} || : \ %{expand:%%_stop_on_removal%{-f:_force}%{!-f:%{-n:_never}} %{?*}} \ @@ -162,8 +159,7 @@ # On update, tell systemd to reload its unit files but don't restart service. # %service_del_postun_without_restart() \ -test -n "$FIRST_ARG" || FIRST_ARG="$1" \ -if [ "$FIRST_ARG" -eq 0 ]; then \ +if [ $1 -eq 0 ]; then \ # Package removal \ for service in %{?*} ; do \ sysv_service="${service%.*}" \ @@ -184,9 +180,8 @@ # variable if not found use the value read from /etc/sysconfig/services # %service_del_postun(fn) \ -test -n "$FIRST_ARG" || FIRST_ARG="$1" \ %service_del_postun_without_restart %{?*} \ -if [ "$FIRST_ARG" -ge 1 ]; then \ +if [ $1 -ge 1 ]; then \ # Package upgrade, not uninstall \ if [ -x /usr/bin/systemctl ]; then \ %{expand:%%_restart_on_update%{-f:_force}%{!-f:%{-n:_never}} %{?*}} \ @@ -215,7 +210,7 @@ # variable if not found use the value read from /etc/sysconfig/services # %systemd_preun(fn) \ -if [ "$1" -eq 0 -a -x /usr/bin/systemctl ]; then \ +if [ $1 -eq 0 -a -x /usr/bin/systemctl ]; then \ # Package removal, not upgrade \ /usr/bin/systemctl --no-reload disable %{?*} || : \ %{expand:%%_stop_on_removal%{-f:_force}%{!-f:%{-n:_never}} %{?*}} \ @@ -223,7 +218,7 @@ %{nil} %systemd_user_preun() \ -if [ "$1" -eq 0 -a -x /usr/bin/systemctl ]; then \ +if [ $1 -eq 0 -a -x /usr/bin/systemctl ]; then \ # Package removal, not upgrade \ /usr/bin/systemctl --global disable %{?*} || : \ fi \ @@ -242,7 +237,7 @@ if [ -x /usr/bin/systemctl ]; then \ /usr/bin/systemctl daemon-reload || : \ fi \ -if [ "$1" -ge 1 -a -x /usr/bin/systemctl ]; then \ +if [ $1 -ge 1 -a -x /usr/bin/systemctl ]; then \ # Package upgrade, not uninstall \ /usr/bin/systemctl try-restart %{?*} || : \ fi \
