[packages/setup] preserve /etc/mtab as rpmsave if it was file

glen glen at pld-linux.org
Tue Jun 18 06:18:35 CEST 2013


commit c06b68d04ea31d59d6cb35d18b124d626695fe23
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Tue Jun 18 07:15:07 2013 +0300

    preserve /etc/mtab as rpmsave if it was file
    
    2.8.0 converts /etc/mtab to /proc/self/mounts symlink. in some
    situations /proc symlink may be unwanted (vbox, hidden mounts (mount
    -n)). preserve it for easier restoring.

 setup.spec | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/setup.spec b/setup.spec
index 6926abb..aee3d71 100644
--- a/setup.spec
+++ b/setup.spec
@@ -3,9 +3,8 @@
 # - make some README.PLD with system features description
 #
 %bcond_with	diet
-#
-%define	iana_etc_ver	2.30
 
+%define	iana_etc_ver	2.30
 Summary:	Simple setup files
 Summary(de.UTF-8):	Einfache Setup-Dateien
 Summary(es.UTF-8):	Varios archivos básicos de configuración
@@ -16,7 +15,7 @@ Summary(pt_BR.UTF-8):	Vários arquivos básicos de configuração
 Summary(tr.UTF-8):	Basit kurulum dosyaları
 Name:		setup
 Version:	2.8.5
-Release:	1
+Release:	2
 License:	Public Domain, partially BSD-like
 Group:		Base
 Source0:	%{name}-%{version}.tar.bz2
@@ -110,7 +109,6 @@ cp -a %{SOURCE3} iana-etc/port-numbers.iana
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT%{_sysconfdir}/shrc.d
-
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT
 
@@ -122,6 +120,9 @@ cp -a iana-etc/{services,protocols} $RPM_BUILD_ROOT%{_sysconfdir}
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%triggerprein -p /sbin/postshell -- %{name} < %{version}-%{release}
+-/bin/sh -c '/usr/bin/test -L /etc/mtab || /bin/mv -v /etc/mtab /etc/mtab.rpmsave'
+
 %triggerpostun -p /sbin/postshell -- %{name} < %{version}-%{release}
 %{_sbindir}/joinpasswd
 %{_sbindir}/delpasswd -g ttyS cdwrite
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/setup.git/commitdiff/c06b68d04ea31d59d6cb35d18b124d626695fe23



More information about the pld-cvs-commit mailing list