commit f993b86cea1d73e2819c410f7507070f4095af95
Author: Jan RÄ™korajski <[email protected]>
Date:   Fri Nov 23 14:41:36 2012 +0100

    - add script to automate rpm db upgrade/downgrade

 dbupgrade.sh | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
---
diff --git a/dbupgrade.sh b/dbupgrade.sh
new file mode 100755
index 0000000..8d5dcc0
--- /dev/null
+++ b/dbupgrade.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+if [ ! -x /usr/bin/db5.2_load ]; then
+       echo "This script needs /usr/bin/db5.2_load to operate."
+       exit
+fi
+
+if /usr/bin/db5.2_load -r lsn /var/lib/rpm/Packages ; then
+       /bin/rm --interactive=never -f /var/lib/rpm/__db.00* >/dev/null 
2>/dev/null || :
+       /bin/rm --interactive=never -f /var/lib/rpm/log/* >/dev/null 
2>/dev/null || :
+else
+       echo
+       echo "rpm database conversion failed!"
+       echo
+       echo "You have to run:"
+       echo
+       echo "  /usr/bin/db5.2_load -r lsn /var/lib/rpm/Packages"
+       echo "  /bin/rm -f /var/lib/rpm/__db.00*"
+       echo "  /bin/rm -f /var/lib/rpm/log/*"
+       echo "  /usr/lib/rpm/bin/dbconvert --rebuilddb"
+       echo
+
+fi
+
+if ! /usr/lib/rpm/bin/dbconvert --rebuilddb; then
+       echo
+       echo "rpm database conversion failed!"
+       echo "You have to run  /usr/lib/rpm/bin/dbconvert manually"
+       echo
+fi
================================================================

---- gitweb:

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

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to