diff --git a/init_buildsystem b/init_buildsystem index a7c4cd7c7..703079d31 100755 --- a/init_buildsystem +++ b/init_buildsystem @@ -275,7 +275,12 @@ init_db() echo initializing rpm db... if ! test -e $BUILD_ROOT/usr/lib/rpm/cpuinfo.yaml; then # rpm v5 does not have initdb - chroot $BUILD_ROOT rpm --initdb || cleanup_and_exit 1 + # rpmdb --initdb is recommended and exists since SL9 + if [ -x $BUILD_ROOT/usr/bin/rpmdb ]; then + chroot $BUILD_ROOT /usr/bin/rpmdb --initdb || cleanup_and_exit 1 + else + chroot $BUILD_ROOT rpm --initdb || cleanup_and_exit 1 + fi fi # hack: add nofsync to db config to speed up install mkdir -p $BUILD_ROOT/root @@ -1415,7 +1420,11 @@ fi if test -x $BUILD_ROOT/bin/rpm -a ! -f $BUILD_ROOT/var/lib/rpm/packages.rpm -a ! -f $BUILD_ROOT/var/lib/rpm/Packages ; then echo "initializing rpm db..." - chroot $BUILD_ROOT rpm --initdb || cleanup_and_exit 1 + if [ -x $BUILD_ROOT/usr/bin/rpmdb ]; then + chroot $BUILD_ROOT /usr/bin/rpmdb --initdb || cleanup_and_exit 1 + else + chroot $BUILD_ROOT rpm --initdb || cleanup_and_exit 1 + fi # create provides index chroot $BUILD_ROOT rpm -q --whatprovides rpm >/dev/null 2>&1 fi