From f2f3223eeb8840efd6857072d6f853d9ded1f6acfad62586d8e15c29d8f0d919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 17 Dec 2014 11:16:38 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/Base:System/netcfg?expand=0&rev=39 --- netcfg.spec | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/netcfg.spec b/netcfg.spec index 7816f25..8e013b4 100644 --- a/netcfg.spec +++ b/netcfg.spec @@ -79,11 +79,9 @@ ln -s %{_sysconfdir}/hostname %{buildroot}%{_sysconfdir}/HOSTNAME # REMOVE after SLE11/openSUSE-13.1 out of MIGRATION support if [ $1 -gt 1 ]; then if [ -f %{_sysconfdir}/HOSTNAME -a ! -L %{_sysconfdir}/HOSTNAME ]; then - tempfile=`mktemp` - cat %{_sysconfdir}/HOSTNAME > $tempfile + cat %{_sysconfdir}/HOSTNAME > %{_sysconfdir}/hostname.rpmsave rm -rf %{_sysconfdir}/HOSTNAME %{_sysconfdir}/hostname - cat $tempfile > %{_sysconfdir}/hostname - rm -rf $tempfile + touch %{_sysconfdir}/hostname ln -s %{_sysconfdir}/hostname %{_sysconfdir}/HOSTNAME fi fi @@ -92,8 +90,12 @@ exit 0 %post # If the defaultdomain changed just prune it, user is not interested in # 0 size file anyway -if [ -f etc/defaultdomain.rpmnew ]; then - rm -f etc/defaultdomain.rpmnew +if [ -f %{_sysconfdir}/defaultdomain.rpmnew ]; then + rm -f %{_sysconfdir}/defaultdomain.rpmnew +fi +if [ -f %{_sysconfdir}/hostname.rpmsave ]; then + cat %{_sysconfdir}/hostname.rpmsave > %{_sysconfdir}/hostname + rm -rf %{_sysconfdir}/HOSTNAME.rpmsave %{_sysconfdir}/hostname.rpmsave fi exit 0