]> git.pld-linux.org Git - packages/rpm.git/blame - dbupgrade.sh
- add -Werror=trampoline to prevent GCC from generating code that require executable...
[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
15if ! /usr/lib/rpm/bin/rpmdb_reset -r lsn "$ROOTDIR"/var/lib/rpm/Packages ; then
f993b86c
JR
16 echo
17 echo "rpm database conversion failed!"
18 echo
19 echo "You have to run:"
20 echo
f1901814 21 echo " /usr/lib/rpm/bin/rpmdb_reset -r lsn /var/lib/rpm/Packages"
f993b86c
JR
22 echo " /bin/rm -f /var/lib/rpm/__db.00*"
23 echo " /bin/rm -f /var/lib/rpm/log/*"
24 echo " /usr/lib/rpm/bin/dbconvert --rebuilddb"
25 echo
d076ae46 26else
c0f7e1e6
JR
27 /bin/rm --interactive=never -f "$ROOTDIR"/var/lib/rpm/__db.00* >/dev/null 2>/dev/null || :
28 /bin/rm --interactive=never -f "$ROOTDIR"/var/lib/rpm/log/* >/dev/null 2>/dev/null || :
f993b86c 29
c0f7e1e6 30 if ! /usr/lib/rpm/bin/dbconvert --rebuilddb ${ROOTDIR:+--root="$ROOTDIR"}; then
d076ae46
JR
31 echo
32 echo "rpm database conversion failed!"
33 echo "You have to run /usr/lib/rpm/bin/dbconvert manually"
34 echo
35 fi
f993b86c 36fi
This page took 0.067779 seconds and 4 git commands to generate.