From 64816733924c0bb62d4e8f01eb297025ed396ecc3b9757fa8cfe67aad0c127ee Mon Sep 17 00:00:00 2001 From: Petr Gajdos Date: Fri, 25 Jul 2014 10:50:00 +0000 Subject: [PATCH] - resolve some update scenarios [bnc#883999], [bnc#886443] (private) with regard to /etc/HOSTNAME -> /etc/hostname change OBS-URL: https://build.opensuse.org/package/show/Base:System/netcfg?expand=0&rev=25 --- netcfg.changes | 6 ++++++ netcfg.spec | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/netcfg.changes b/netcfg.changes index 2b2b033..bd7bac7 100644 --- a/netcfg.changes +++ b/netcfg.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Jul 25 10:46:20 UTC 2014 - pgajdos@suse.com + +- resolve some update scenarios [bnc#883999], [bnc#886443] (private) + with regard to /etc/HOSTNAME -> /etc/hostname change + ------------------------------------------------------------------- Wed Jun 11 08:47:56 UTC 2014 - pgajdos@suse.com diff --git a/netcfg.spec b/netcfg.spec index 11af4e2..c0d6999 100644 --- a/netcfg.spec +++ b/netcfg.spec @@ -88,11 +88,12 @@ fi #> to /etc/hostname. This should ensure /etc/HOSTNAME is properly created #> by RPM. if [ "0$1" -ge "2" ]; then - if [ -f /etc/HOSTNAME -a ! -h /etc/HOSTNAME ]; then + if [ -f /etc/HOSTNAME -a ! -L /etc/HOSTNAME ]; then if [ -f /etc/hostname ]; then mv /etc/hostname /etc/hostname.rpmsave fi - mv /etc/HOSTNAME /etc/hostname + ln -f /etc/HOSTNAME /etc/HOSTNAME.rpmsave + rm /etc/HOSTNAME fi fi @@ -102,6 +103,9 @@ if [ -f etc/...netgroup.new.rpmnew ]; then test ! -f etc/netgroup.rpmnew && cp etc/netgroup etc/netgroup.rpmnew mv etc/...netgroup.new.rpmnew etc/netgroup fi +if [ -f /etc/HOSTNAME.rpmsave -a ! -L /etc/HOSTNAME.rpmsave ]; then + cp -a /etc/HOSTNAME.rpmsave /etc/hostname +fi exit 0 %files