From c7e0ba777bc1060768118559217bd7a672116044 Mon Sep 17 00:00:00 2001 From: Jonathan Billings Date: Wed, 23 Apr 2014 11:59:13 -0400 Subject: misc/bcfg2.spec Remove duplicate checks for systemd in RPM scriptlets In the RPM scriptlets, there's first a check for fedora 18 or greater, then if that's not true, a check for fedora 16 or greater. Due to some bug in how nested %if statements work in RPM scriptlets, the second test is evaluating true even on non-Fedora systems, which is leading to systemd commands being put in RHEL6 RPM scriptlets. This change removes the second check. If there needed to be a check for versions of Fedora 16 and 17, they will no longer work, but since neither of those are supported versions of Fedora, I suspect we don't need to include logic for them. --- misc/bcfg2.spec | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'misc/bcfg2.spec') diff --git a/misc/bcfg2.spec b/misc/bcfg2.spec index 6a4153472..f79483858 100644 --- a/misc/bcfg2.spec +++ b/misc/bcfg2.spec @@ -558,8 +558,6 @@ sed "s@http://www.w3.org/2001/xml.xsd@file://$(pwd)/schemas/xml.xsd@" \ # Initial installation %if 0%{?suse_version} %fillup_and_insserv -f bcfg2 - %else %if 0%{?fedora} >= 16 - /bin/systemctl daemon-reload >/dev/null 2>&1 || : %else /sbin/chkconfig --add bcfg2 %endif %endif @@ -574,8 +572,6 @@ sed "s@http://www.w3.org/2001/xml.xsd@file://$(pwd)/schemas/xml.xsd@" \ # Initial installation %if 0%{?suse_version} %fillup_and_insserv -f bcfg2-server - %else %if 0%{?fedora} >= 16 - /bin/systemctl daemon-reload >/dev/null 2>&1 || : %else /sbin/chkconfig --add bcfg2-server %endif %endif @@ -590,9 +586,6 @@ sed "s@http://www.w3.org/2001/xml.xsd@file://$(pwd)/schemas/xml.xsd@" \ # Package removal, not upgrade %if 0%{?suse_version} %stop_on_removal bcfg2 - %else %if 0%{?fedora} >= 16 - /bin/systemctl --no-reload disable bcfg2.service > /dev/null 2>&1 || : - /bin/systemctl stop bcfg2.service > /dev/null 2>&1 || : %else /sbin/service bcfg2 stop &>/dev/null || : /sbin/chkconfig --del bcfg2 @@ -609,9 +602,6 @@ sed "s@http://www.w3.org/2001/xml.xsd@file://$(pwd)/schemas/xml.xsd@" \ %if 0%{?suse_version} %stop_on_removal bcfg2-server %stop_on_removal bcfg2-report-collector - %else %if 0%{?fedora} >= 16 - /bin/systemctl --no-reload disable bcfg2-server.service > /dev/null 2>&1 || : - /bin/systemctl stop bcfg2-server.service > /dev/null 2>&1 || : %else /sbin/service bcfg2-server stop &>/dev/null || : /sbin/chkconfig --del bcfg2-server @@ -630,8 +620,6 @@ sed "s@http://www.w3.org/2001/xml.xsd@file://$(pwd)/schemas/xml.xsd@" \ # Package upgrade, not uninstall %if 0%{?suse_version} %insserv_cleanup - %else %if 0%{?fedora} >= 16 - /bin/systemctl try-restart bcfg2.service >/dev/null 2>&1 || : %else /sbin/service bcfg2 condrestart &>/dev/null || : %endif %endif @@ -642,16 +630,9 @@ sed "s@http://www.w3.org/2001/xml.xsd@file://$(pwd)/schemas/xml.xsd@" \ %if 0%{?fedora} >= 18 %systemd_postun bcfg2-server.service %else - %if 0%{?fedora} >= 16 - /bin/systemctl daemon-reload >/dev/null 2>&1 || : - %endif if [ $1 -ge 1 ] ; then # Package upgrade, not uninstall - %if 0%{?fedora} >= 16 - /bin/systemctl try-restart bcfg2-server.service >/dev/null 2>&1 || : - %else /sbin/service bcfg2-server condrestart &>/dev/null || : - %endif fi %if 0%{?suse_version} if [ $1 -eq 0 ]; then -- cgit v1.2.3-1-g7c22 From 58196c146e2df70e0dfb3af31fff9776912600e5 Mon Sep 17 00:00:00 2001 From: Jonathan Billings Date: Wed, 23 Apr 2014 13:05:35 -0400 Subject: misc/bcfg2.spec: Remove second, unnecessary %endif --- misc/bcfg2.spec | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'misc/bcfg2.spec') diff --git a/misc/bcfg2.spec b/misc/bcfg2.spec index f79483858..4e90e94a1 100644 --- a/misc/bcfg2.spec +++ b/misc/bcfg2.spec @@ -560,7 +560,7 @@ sed "s@http://www.w3.org/2001/xml.xsd@file://$(pwd)/schemas/xml.xsd@" \ %fillup_and_insserv -f bcfg2 %else /sbin/chkconfig --add bcfg2 - %endif %endif + %endif fi %endif @@ -574,7 +574,7 @@ sed "s@http://www.w3.org/2001/xml.xsd@file://$(pwd)/schemas/xml.xsd@" \ %fillup_and_insserv -f bcfg2-server %else /sbin/chkconfig --add bcfg2-server - %endif %endif + %endif fi %endif @@ -589,7 +589,7 @@ sed "s@http://www.w3.org/2001/xml.xsd@file://$(pwd)/schemas/xml.xsd@" \ %else /sbin/service bcfg2 stop &>/dev/null || : /sbin/chkconfig --del bcfg2 - %endif %endif + %endif fi %endif @@ -605,7 +605,7 @@ sed "s@http://www.w3.org/2001/xml.xsd@file://$(pwd)/schemas/xml.xsd@" \ %else /sbin/service bcfg2-server stop &>/dev/null || : /sbin/chkconfig --del bcfg2-server - %endif %endif + %endif fi %endif @@ -622,7 +622,7 @@ sed "s@http://www.w3.org/2001/xml.xsd@file://$(pwd)/schemas/xml.xsd@" \ %insserv_cleanup %else /sbin/service bcfg2 condrestart &>/dev/null || : - %endif %endif + %endif fi %endif -- cgit v1.2.3-1-g7c22 From 49ad7e5039b96a3d849924c5748fde6e1ea7e8bc Mon Sep 17 00:00:00 2001 From: Jonathan Billings Date: Wed, 23 Apr 2014 13:12:13 -0400 Subject: misc/bcfg2.spec: Bumped release and added a changelog entry --- misc/bcfg2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'misc/bcfg2.spec') diff --git a/misc/bcfg2.spec b/misc/bcfg2.spec index 4e90e94a1..12be59fd1 100644 --- a/misc/bcfg2.spec +++ b/misc/bcfg2.spec @@ -30,7 +30,7 @@ Name: bcfg2 Version: 1.3.4 -Release: 1%{?_pre_rc}%{?dist} +Release: 2%{?_pre_rc}%{?dist} Summary: A configuration management system %if 0%{?suse_version} @@ -768,6 +768,9 @@ sed "s@http://www.w3.org/2001/xml.xsd@file://$(pwd)/schemas/xml.xsd@" \ %changelog +* Wed Apr 23 2014 Jonathan S. Billings - 1.3.4-2 +- Fixed RPM scriptlet logic for el6 vs. Fedora init commands + * Sun Apr 6 2014 John Morris - 1.3.4-1 - New upstream release -- cgit v1.2.3-1-g7c22