]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rpm: drop use of $FIRST_ARG in ceph-immutable-object-cache 42480/head
authorNathan Cutler <ncutler@suse.com>
Thu, 22 Jul 2021 20:52:39 +0000 (22:52 +0200)
committerNathan Cutler <ncutler@suse.com>
Sun, 25 Jul 2021 21:56:59 +0000 (23:56 +0200)
The use of $FIRST_ARG was probably required because the SUSE-specific
%service_* rpm 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 remain
unchanged after any rpm macro call.

Thanks to Franck Bui for providing the original patch
926433f5d45e557c42f050b43798ba29dc495e02 that this patch is modeled after.

NOTE: the use of FIRST_ARG had already been eliminated by
926433f5d45e557c42f050b43798ba29dc495e02 but was re-introduced later by
9466d7098573dafcfede5e9c852374fbbd99f9e7

Fixes: 9466d7098573dafcfede5e9c852374fbbd99f9e7
Fixes: https://tracker.ceph.com/issues/51797
Signed-off-by: Nathan Cutler <ncutler@suse.com>
(cherry picked from commit 1cb84a1160ed4108cae30100682b1e3ee7c7721d)

ceph.spec.in

index 5e2ffec7d3f13e1d2535c123665fda56e091f06d..84af9ace9a905018057f3ae97f5d59c5457b673a 100644 (file)
@@ -1990,9 +1990,8 @@ fi
 %endif
 
 %postun immutable-object-cache
-test -n "$FIRST_ARG" || FIRST_ARG=$1
 %systemd_postun ceph-immutable-object-cache@\*.service ceph-immutable-object-cache.target
-if [ $FIRST_ARG -ge 1 ] ; then
+if [ $1 -ge 1 ] ; then
   # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
   # "yes". In any case: if units are not running, do not touch them.
   SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph