- 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
|
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
|
Source102: services-create.pl
|
||||||
Source103: services_UPDATING
|
Source103: services_UPDATING
|
||||||
Patch0: services-suse.diff
|
Patch0: services-suse.diff
|
||||||
# FIXME: use proper Requires(pre/post/preun/...)
|
Requires(pre): coreutils
|
||||||
PreReq: aaa_base
|
Requires(post): coreutils
|
||||||
PreReq: coreutils
|
|
||||||
PreReq: permissions
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
@ -74,30 +72,34 @@ rm -f %{buildroot}%{_sysconfdir}/services.orig
|
|||||||
ln -s %{_sysconfdir}/hostname %{buildroot}%{_sysconfdir}/HOSTNAME
|
ln -s %{_sysconfdir}/hostname %{buildroot}%{_sysconfdir}/HOSTNAME
|
||||||
|
|
||||||
%pre
|
%pre
|
||||||
#/etc/HOSTNAME renamed to /etc/hostname [bnc#858908]
|
# HOSTNAME migration supported scenarios [bnc#858908]:
|
||||||
#On Tue, Jun 10, 2014 at 03:23:00PM +0200, Frederic Crozat wrote:
|
# /etc/HOSTNAME -> /etc/hostname content preservation.
|
||||||
#> So, it means netcfg should have a %pre which check if /etc/HOSTNAME is a
|
# If hostname and HOSTNAME both exist HOSTNAME wins.
|
||||||
#> filename (and not a symlink) and in that case, rename the file
|
# Nothing apart from content of the document is preserved
|
||||||
#> to /etc/hostname. This should ensure /etc/HOSTNAME is properly created
|
# REMOVE after SLE11/openSUSE-13.1 out of MIGRATION support
|
||||||
#> by RPM.
|
|
||||||
if [ "0$1" -ge "2" ]; then
|
if [ "0$1" -ge "2" ]; then
|
||||||
if [ -f /etc/HOSTNAME -a ! -L /etc/HOSTNAME ]; then
|
if [ -f /etc/HOSTNAME -a ! -L /etc/HOSTNAME ]; then
|
||||||
if [ -f /etc/hostname ]; then
|
cp /etc/HOSTNAME /etc/hostname.rpmsave
|
||||||
mv /etc/hostname /etc/hostname.rpmsave
|
rm /etc/HOSTNAME
|
||||||
fi
|
fi
|
||||||
ln -f /etc/HOSTNAME /etc/HOSTNAME.rpmsave
|
# 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
|
||||||
fi
|
fi
|
||||||
|
exit 0
|
||||||
|
|
||||||
%post
|
%post
|
||||||
# If the defaultdomain changed just prune it, user is not interested in
|
# If the defaultdomain changed just prune it, user is not interested in
|
||||||
# 0 size file anyway
|
# 0 size file anyway
|
||||||
if test -f etc/defaultdomain.rpmnew; then
|
if [ -f etc/defaultdomain.rpmnew ]; then
|
||||||
rm -f etc/defaultdomain.rpmnew
|
rm -f etc/defaultdomain.rpmnew
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f /etc/HOSTNAME.rpmsave -a ! -L /etc/HOSTNAME.rpmsave ]; then
|
# Put backuped HOSTNAME into the current hostname file
|
||||||
cp -a /etc/HOSTNAME.rpmsave /etc/hostname
|
if [ -f /etc/hostname.rpmsave ]; then
|
||||||
|
mv /etc/hostname.rpmsave /etc/hostname
|
||||||
fi
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user