forked from pool/netcfg
- Redo the HOSTNAME -> hostname migration to support smallest
possible step. Thus ensuring the migration is done just once and finished: # HOSTNAME migration supported scenarios [bnc#858908]: # /etc/HOSTNAME -> /etc/hostname content preservation. # If hostname and HOSTNAME both exist HOSTNAME wins. # Nothing apart from content of the document is preserved - Solves bnc#858908 and bnc#899506 while moves bnc#887039 to unsupported scenarios. OBS-URL: https://build.opensuse.org/package/show/Base:System/netcfg?expand=0&rev=33
This commit is contained in:
parent
6cfb9c1674
commit
37158b5f9b
@ -1,3 +1,16 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Dec 1 16:37:41 UTC 2014 - tchvatal@suse.com
|
||||
|
||||
- Redo the HOSTNAME -> hostname migration to support smallest
|
||||
possible step. Thus ensuring the migration is done just once and
|
||||
finished:
|
||||
# HOSTNAME migration supported scenarios [bnc#858908]:
|
||||
# /etc/HOSTNAME -> /etc/hostname content preservation.
|
||||
# If hostname and HOSTNAME both exist HOSTNAME wins.
|
||||
# Nothing apart from content of the document is preserved
|
||||
- Solves bnc#858908 and bnc#899506 while moves bnc#887039 to
|
||||
unsupported scenarios.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Dec 1 16:26:03 UTC 2014 - tchvatal@suse.com
|
||||
|
||||
|
36
netcfg.spec
36
netcfg.spec
@ -44,10 +44,8 @@ Source101: services-compare.sh
|
||||
Source102: services-create.pl
|
||||
Source103: services_UPDATING
|
||||
Patch0: services-suse.diff
|
||||
# FIXME: use proper Requires(pre/post/preun/...)
|
||||
PreReq: aaa_base
|
||||
PreReq: coreutils
|
||||
PreReq: permissions
|
||||
Requires(pre): coreutils
|
||||
Requires(post): coreutils
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildArch: noarch
|
||||
|
||||
@ -74,30 +72,34 @@ rm -f %{buildroot}%{_sysconfdir}/services.orig
|
||||
ln -s %{_sysconfdir}/hostname %{buildroot}%{_sysconfdir}/HOSTNAME
|
||||
|
||||
%pre
|
||||
#/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.
|
||||
# HOSTNAME migration supported scenarios [bnc#858908]:
|
||||
# /etc/HOSTNAME -> /etc/hostname content preservation.
|
||||
# If hostname and HOSTNAME both exist HOSTNAME wins.
|
||||
# Nothing apart from content of the document is preserved
|
||||
# REMOVE after SLE11/openSUSE-13.1 out of MIGRATION support
|
||||
if [ "0$1" -ge "2" ]; then
|
||||
if [ -f /etc/HOSTNAME -a ! -L /etc/HOSTNAME ]; then
|
||||
if [ -f /etc/hostname ]; then
|
||||
mv /etc/hostname /etc/hostname.rpmsave
|
||||
fi
|
||||
ln -f /etc/HOSTNAME /etc/HOSTNAME.rpmsave
|
||||
cp /etc/HOSTNAME /etc/hostname.rpmsave
|
||||
rm /etc/HOSTNAME
|
||||
fi
|
||||
# As some people are really on pills and did the link themselves other
|
||||
# way around ensure the package will install for them.
|
||||
if [ -f /etc/hostname -a -f /etc/hostname.rpmsave ]; then
|
||||
rm /etc/hostname
|
||||
fi
|
||||
fi
|
||||
exit 0
|
||||
|
||||
%post
|
||||
# If the defaultdomain changed just prune it, user is not interested in
|
||||
# 0 size file anyway
|
||||
if test -f etc/defaultdomain.rpmnew; then
|
||||
if [ -f etc/defaultdomain.rpmnew ]; then
|
||||
rm -f etc/defaultdomain.rpmnew
|
||||
fi
|
||||
|
||||
if [ -f /etc/HOSTNAME.rpmsave -a ! -L /etc/HOSTNAME.rpmsave ]; then
|
||||
cp -a /etc/HOSTNAME.rpmsave /etc/hostname
|
||||
# Put backuped HOSTNAME into the current hostname file
|
||||
if [ -f /etc/hostname.rpmsave ]; then
|
||||
mv /etc/hostname.rpmsave /etc/hostname
|
||||
fi
|
||||
exit 0
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user