[packages/rpm] - create database backup before converting

baggins baggins at pld-linux.org
Wed Sep 19 14:48:35 CEST 2012


commit 8383afc396e279a1ce2596c7d314b59fa6bc0095
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Wed Sep 19 14:48:04 2012 +0200

    - create database backup before converting

 rpm.spec | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/rpm.spec b/rpm.spec
index b614db3..af8ae03 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -1123,6 +1123,11 @@ fi
 %posttrans
 if [ -x %{_rpmlibdir}/bin/rpmdb_checkversion ] && \
 		! %{_rpmlibdir}/bin/rpmdb_checkversion -h /var/lib/rpm -d /var/lib/rpm ; then
+	if %{__cp} -a /var/lib/rpm /var/lib/rpm.rpmbackup ; then
+		echo
+		echo "Backup of the rpm database has been created in /var/lib/rpm.rpmbackup"
+		echo
+	fi
 	[ -x %{_rpmlibdir}/bin/dbconvert ] && %{_rpmlibdir}/bin/dbconvert --rebuilddb
 fi
 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rpm.git/commitdiff/180166367996bd0d464f130c4b1f544224bf138d



More information about the pld-cvs-commit mailing list