public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/inn] epel10.3: Coalesce systemd scriptlets
Date: Wed, 26 Aug 2026 08:55:21 GMT	[thread overview]
Message-ID: <178773452154.1.13053887146977235220.rpms-inn-611716ce4d99@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/inn
            Branch : epel10.3
            Commit : 611716ce4d99a7eb779cd5ee76d9bac80aba50b1
            Author : Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
            Date   : 2021-03-02T15:45:45+01:00
            Stats  : +8/-22 in 1 file(s)
            URL    : https://src.fedoraproject.org/rpms/inn/c/611716ce4d99a7eb779cd5ee76d9bac80aba50b1?branch=epel10.3

            Log:
            Coalesce systemd scriptlets

It is more efficient to do callout just once.

Also, call the scriptlets for all units. For some units the scriptlets
are noops, but it's more future-proof to call them anyway.

---
diff --git a/inn.spec b/inn.spec
index 9c37e4e..faa4c8a 100644
--- a/inn.spec
+++ b/inn.spec
@@ -263,6 +263,9 @@ install -pm644 %{S:30} %{buildroot}%{_sysconfdir}/rsyslog.d/inn.conf
 %check
 LD_LIBRARY_PATH=%{buildroot}%{_libdir} make -C tests test
 
+%global inn_units_with_restart innd.service innd-expire.timer innd-nntpsend.timer innd-rnews.timer
+%global inn_units innd-expire.service innd-nntpsend.service innd-rnews.service
+
 %pre -n inews
 getent group news >/dev/null || groupadd -g 13 -r news
 getent passwd news >/dev/null || \
@@ -289,29 +292,15 @@ exit 0
 su -m news -c '/usr/libexec/news/makedbz -i -o'
 
 umask 002
-touch /var/log/news/news.notice
-touch /var/log/news/news.crit
-touch /var/log/news/news.err
+touch /var/log/news/news.notice /var/log/news/news.crit /var/log/news/news.err
 chown -R news:news /var/log/news*
 
-%systemd_post innd.service
-
-%systemd_post innd-expire.timer
-%systemd_post innd-nntpsend.timer
-%systemd_post innd-rnews.timer
+%systemd_post %{inn_units_with_restart} %{inn_units}
 
 %ldconfig_scriptlets libs
 
 %preun
-%systemd_preun innd.service
-
-%systemd_preun innd-expire.service
-%systemd_preun innd-nntpsend.service
-%systemd_preun innd-rnews.service
-
-%systemd_preun innd-expire.timer
-%systemd_preun innd-nntpsend.timer
-%systemd_preun innd-rnews.timer
+%systemd_preun %{inn_units_with_restart} %{inn_units}
 
 if [ $1 = 0 ]; then
     if [ -f /var/lib/news/history.dir ]; then
@@ -320,11 +309,8 @@ if [ $1 = 0 ]; then
 fi
 
 %postun
-%systemd_postun_with_restart innd.service
-
-%systemd_postun_with_restart innd-expire.timer
-%systemd_postun_with_restart innd-nntpsend.timer
-%systemd_postun_with_restart innd-rnews.timer
+%systemd_postun_with_restart %{inn_units}
+%systemd_postun %{inn_units}
 
 %files
 %license doc/GPL

                 reply	other threads:[~2026-08-26  8:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178773452154.1.13053887146977235220.rpms-inn-611716ce4d99@fedoraproject.org \
    --to=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox