SHA256
3
0
forked from pool/netcfg

- move /etc/HOSTNAME to /etc/hostname during update

OBS-URL: https://build.opensuse.org/package/show/Base:System/netcfg?expand=0&rev=22
This commit is contained in:
Petr Gajdos 2014-06-11 09:24:00 +00:00 committed by Git OBS Bridge
parent 10c67627c8
commit 2052abef7f
2 changed files with 20 additions and 0 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Jun 11 08:47:56 UTC 2014 - pgajdos@suse.com
- move /etc/HOSTNAME to /etc/hostname during update
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Jun 4 10:36:22 UTC 2014 - pgajdos@suse.com Wed Jun 4 10:36:22 UTC 2014 - pgajdos@suse.com

View File

@ -81,6 +81,21 @@ if [ "0$1" -ge "2" ]; then
cp %{_sysconfdir}/netgroup.rpmsave %{_sysconfdir}/...netgroup.new.rpmnew cp %{_sysconfdir}/netgroup.rpmsave %{_sysconfdir}/...netgroup.new.rpmnew
fi fi
fi fi
#/etc/HOSTNAME renamed to /etc/hostname [bnc#858908]
#On Tue, Jun 10, 2014 at 03:23:00PM +0200, Frederic Crozat wrote:
#> So, it means netcfg should have a %pre which check if /etc/HOSTNAME is a
#> filename (and not a symlink) and in that case, rename the file
#> to /etc/hostname. This should ensure /etc/HOSTNAME is properly created
#> by RPM.
set -x
if [ "0$1" -ge "2" ]; then
if [ -f /etc/HOSTNAME -a ! -h /etc/HOSTNAME ]; then
if [ -f /etc/hostname ]; then
mv /etc/hostname /etc/hostname.rpmsave
fi
mv /etc/HOSTNAME /etc/hostname
fi
fi
%post %post
test -f etc/defaultdomain.rpmnew -a ! -s etc/defaultdomain.rpmnew && rm -f etc/defaultdomain.rpmnew test -f etc/defaultdomain.rpmnew -a ! -s etc/defaultdomain.rpmnew && rm -f etc/defaultdomain.rpmnew