forked from pool/netcfg
Accepting request 263637 from Base:System
- Spec-cleanify the previous commit. - 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. - Remove the socket check from the defaultdomain checker as it was always false and thus not needed - Add comment explaining the reason for the code - Drop the scriptlet for the netgroup handling. It was caused by the aaa_base -> netcfg move, which I guess after 12 years is moot OBS-URL: https://build.opensuse.org/request/show/263637 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/netcfg?expand=0&rev=34
This commit is contained in:
commit
4df4ac759c
@ -1,3 +1,34 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Dec 1 16:56:09 UTC 2014 - tchvatal@suse.com
|
||||
|
||||
- Spec-cleanify the previous commit.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
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
|
||||
|
||||
- Remove the socket check from the defaultdomain checker as it was
|
||||
always false and thus not needed
|
||||
- Add comment explaining the reason for the code
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Dec 1 16:22:22 UTC 2014 - tchvatal@suse.com
|
||||
|
||||
- Drop the scriptlet for the netgroup handling. It was caused by
|
||||
the aaa_base -> netcfg move, which I guess after 12 years is moot
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Oct 2 18:49:01 UTC 2014 - pgajdos@suse.com
|
||||
|
||||
|
54
netcfg.spec
54
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(post): coreutils
|
||||
Requires(pre): coreutils
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildArch: noarch
|
||||
|
||||
@ -74,43 +72,41 @@ rm -f %{buildroot}%{_sysconfdir}/services.orig
|
||||
ln -s %{_sysconfdir}/hostname %{buildroot}%{_sysconfdir}/HOSTNAME
|
||||
|
||||
%pre
|
||||
# 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 we have a /etc/netgroup.rpmsave and no /etc/netgroup, copy
|
||||
# /etc/netgroup.rpmsave and use it later instead of the new one.
|
||||
if [ -f %{_sysconfdir}/netgroup.rpmsave -a ! -e %{_sysconfdir}/netgroup ]; then
|
||||
cp %{_sysconfdir}/netgroup.rpmsave %{_sysconfdir}/...netgroup.new.rpmnew
|
||||
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.
|
||||
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
|
||||
if [ -f %{_sysconfdir}/HOSTNAME -a ! -L %{_sysconfdir}/HOSTNAME ]; then
|
||||
cp %{_sysconfdir}/HOSTNAME %{_sysconfdir}/hostname.rpmsave
|
||||
rm %{_sysconfdir}/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 %{_sysconfdir}/hostname -a -f %{_sysconfdir}/hostname.rpmsave ]; then
|
||||
rm %{_sysconfdir}/hostname
|
||||
fi
|
||||
fi
|
||||
exit 0
|
||||
|
||||
%post
|
||||
test -f etc/defaultdomain.rpmnew -a ! -s etc/defaultdomain.rpmnew && rm -f etc/defaultdomain.rpmnew
|
||||
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
|
||||
# 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
|
||||
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 %{_sysconfdir}/hostname.rpmsave ]; then
|
||||
mv %{_sysconfdir}/hostname.rpmsave %{_sysconfdir}/hostname
|
||||
fi
|
||||
exit 0
|
||||
|
||||
%files
|
||||
%defattr(644,root,root,755)
|
||||
%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/hostname
|
||||
/etc/HOSTNAME
|
||||
%{_sysconfdir}/HOSTNAME
|
||||
%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/aliases
|
||||
%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/defaultdomain
|
||||
%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/ethers
|
||||
|
Loading…
Reference in New Issue
Block a user