Hello community,

here is the log from the commit of package systemd-presets-branding-CAASP for 
openSUSE:Factory checked in at 2017-12-09 20:25:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/systemd-presets-branding-CAASP (Old)
 and      /work/SRC/openSUSE:Factory/.systemd-presets-branding-CAASP.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "systemd-presets-branding-CAASP"

Sat Dec  9 20:25:13 2017 rev:7 rq:555170 version:15.0

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/systemd-presets-branding-CAASP/systemd-presets-branding-CAASP.changes
    2017-08-12 19:34:04.454800627 +0200
+++ 
/work/SRC/openSUSE:Factory/.systemd-presets-branding-CAASP.new/systemd-presets-branding-CAASP.changes
       2017-12-09 20:25:18.603773277 +0100
@@ -1,0 +2,6 @@
+Fri Dec  8 07:49:36 UTC 2017 - [email protected]
+
+- Fix %pre/%post preset calls
+- Copy branding-preset-states script from main branding package
+
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ systemd-presets-branding-CAASP.spec ++++++
--- /var/tmp/diff_new_pack.N5zq2K/_old  2017-12-09 20:25:20.387688307 +0100
+++ /var/tmp/diff_new_pack.N5zq2K/_new  2017-12-09 20:25:20.415686973 +0100
@@ -23,16 +23,8 @@
 %endif
 
 %define generic_name systemd-presets-branding
-%define systemd_preset_pre if [ $1 -gt 1 -a -x 
%{_prefix}/lib/%{generic_name}/branding-preset-states ] ; then \
-        %{_prefix}/lib/%{generic_name}/branding-preset-states save \
-fi
-%define systemd_preset_post if [ $1 -gt 1 ] ; then \
-        %{_prefix}/lib/%{generic_name}/branding-preset-states apply-changes \
-fi
-%define systemd_preset_posttrans /bin/true
-
 Name:           systemd-presets-branding-CAASP
-Version:        12.2
+Version:        15.0
 Release:        0
 Summary:        Systemd default presets for SUSE CaaS Platform
 License:        MIT
@@ -45,7 +37,7 @@
 PreReq:         coreutils
 Provides:       systemd-presets-branding = %{version}
 Supplements:    packageand(systemd:branding-CAASP)
-Conflicts:      otherproviders(systemd-presets-branding)
+Conflicts:      systemd-presets-branding
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildArch:      noarch
 
@@ -58,28 +50,39 @@
 %build
 
 %install
+mkdir -p %{buildroot}%{_prefix}/lib/%{generic_name}
 mkdir -p %{buildroot}/usr/lib/systemd/system-preset
 install -m644 %{SOURCE0}  %{buildroot}/usr/lib/systemd/system-preset/
 install -m644 %{SOURCE1}  %{buildroot}/usr/lib/systemd/system-preset/
-# Copy default presets
+# Copy default presets and script
 install -m644 /usr/lib/systemd/system-preset/90-default-%theme.preset 
%{buildroot}/usr/lib/systemd/system-preset/
+install -m755  %{_prefix}/lib/%{generic_name}/branding-preset-states 
%{buildroot}%{_prefix}/lib/%{generic_name}/
 
-%pre -p /bin/bash
-%systemd_preset_pre
+%pre
+# On initial installation, branding-preset-states does not yet exist,
+# which is why we also check for the file to be present/executable
+if [ $1 -gt 1 -a -x %{_prefix}/lib/%{generic_name}/branding-preset-states ] ; 
then
+        #
+        # Save the old state so we can detect which package have its
+        # default changed later.
+        #
+        # Note: the old version of the script is used here.
+        #
+        %{_prefix}/lib/%{generic_name}/branding-preset-states save
+fi
 
 %post
-systemctl daemon-reload >/dev/null 2>&1 || :
-
-%postun
-if [ $1 -eq 0 ]; then
-systemctl daemon-reload >/dev/null 2>&1 || :
+if [ $1 -gt 1 ] ; then
+        #
+        # Now that the updated presets are installed, find the ones
+        # that have been changed and apply "systemct preset" on them.
+        #
+        %{_prefix}/lib/%{generic_name}/branding-preset-states apply-changes
 fi
 
-%posttrans -p /bin/bash
-%systemd_preset_posttrans
-
 %files
 %defattr(-,root,root)
+%{_prefix}/lib/%{generic_name}/
 /usr/lib/systemd/system-preset/*
 
 %changelog


Reply via email to