From 8507b0836cf5d89003bd75bfb3decc2eeef8361811ad28c74281fe85dace8726 Mon Sep 17 00:00:00 2001 From: Jochen Keil Date: Mon, 10 Aug 2015 12:29:31 +0000 Subject: [PATCH] - Move update logic to proper scriptlet * Replace 'etc' with %{_sysconfdir} macro OBS-URL: https://build.opensuse.org/package/show/server:proxy/squid?expand=0&rev=84 --- squid.changes | 6 ++++++ squid.spec | 21 +++++++++++---------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/squid.changes b/squid.changes index 82149db..204251f 100644 --- a/squid.changes +++ b/squid.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Aug 10 12:26:30 UTC 2015 - jkeil@suse.de + +- Move update logic to proper scriptlet + * Replace 'etc' with %{_sysconfdir} macro + ------------------------------------------------------------------- Wed Aug 5 21:20:28 UTC 2015 - chris@computersalat.de diff --git a/squid.spec b/squid.spec index 0e5e0e7..90ddc2d 100644 --- a/squid.spec +++ b/squid.spec @@ -1,7 +1,7 @@ # # spec file for package squid # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -312,6 +312,16 @@ if [ -e etc/%{name}/%{name}.conf ]; then sed -i '/emulate_httpd_log/d' /etc/%{name}/%{name}.conf fi +# update mode? +if [ "$1" -gt "1" ]; then + if [ -e %{_sysconfdir}/%{name}.conf -a ! -L %{_sysconfdir}/%{name}.conf -a ! -e %{_sysconfdir}/%{name}/%{name}.conf ]; then + echo "moving %{_sysconfdir}/%{name}.conf to %{_sysconfdir}/%{name}/%{name}.conf" + mv /%{_sysconfdir}/%{name}.conf /%{_sysconfdir}/%{name}/%{name}.conf + fi + # default group changed from nogroup to squid + %{_sbindir}/usermod -g %{name} %{name} +fi + %if 0%{?has_systemd} %service_add_pre %{name}.service %endif @@ -327,15 +337,6 @@ fi %run_permissions %endif %endif -# update mode? -if [ "$1" -gt "1" ]; then - if [ -e etc/%{name}.conf -a ! -L etc/%{name}.conf -a ! -e etc/%{name}/%{name}.conf ]; then - echo "moving %{_sysconfdir}/%{name}.conf to %{_sysconfdir}/%{name}/%{name}.conf" - mv /etc/%{name}.conf /etc/%{name}/%{name}.conf - fi - # default group changed from nogroup to squid - %{_sbindir}/usermod -g %{name} %{name} -fi %if 0%{?has_systemd} %service_add_post squid.service