]> git.pld-linux.org Git - packages/rpm.git/blame - dbupgrade.sh
- reset/cleanup rpmdb only if the current backend is bdb, sqlite backend uses differe...
[packages/rpm.git] / dbupgrade.sh
CommitLineData
f993b86c
JR
1#!/bin/sh
2
c0f7e1e6
JR
3ROOTDIR=
4if [ "$1" = "-r" ]; then
5 shift
6 ROOTDIR="$1"
7
8 if [ ! -d "$ROOTDIR" ]; then
9 echo "Specified root directory ($ROOTDIR) does not exist!"
10 echo "Bailing out!"
11 exit
12 fi
13fi
14
c70db203
JR
15if [ -f "$ROOTDIR"/var/lib/rpm/Packages ]; then
16 if ! /usr/lib/rpm/rpmdb_reset -r lsn "$ROOTDIR"/var/lib/rpm/Packages ; then
d076ae46
JR
17 echo
18 echo "rpm database conversion failed!"
d076ae46 19 echo
c70db203
JR
20 echo "You have to run:"
21 echo
22 echo " /usr/lib/rpm/rpmdb_reset -r lsn /var/lib/rpm/Packages"
23 echo " /bin/rm -f /var/lib/rpm/__db.00*"
24 echo " /bin/rm -rf /var/lib/rpm/log"
25 echo " /usr/bin/rpmdb --rebuilddb"
26 echo
27 exit
d076ae46 28 fi
c70db203
JR
29
30 /bin/rm --interactive=never -f "$ROOTDIR"/var/lib/rpm/__db.00* >/dev/null 2>/dev/null || :
31 /bin/rm --interactive=never -rf "$ROOTDIR"/var/lib/rpm/log >/dev/null 2>/dev/null || :
32 /bin/rm --interactive=never -rf "$ROOTDIR"/var/lib/rpm/tmp >/dev/null 2>/dev/null || :
33fi
34
35if ! /usr/bin/rpmdb --rebuilddb ${ROOTDIR:+--root="$ROOTDIR"}; then
36 echo
37 echo "rpm database conversion failed!"
38 echo "You have to run /usr/bin/rpmdb manually"
39 echo
f993b86c 40fi
This page took 0.104562 seconds and 4 git commands to generate.