Package: mock
Version: 1.2.3-1
Mock fails to track installed packages properly due to the rpm package
changing the default rpmdb directory to ~/.rpmdb from /var/lib/rpm.
There is an existing patch to remove the extra /buildroot/.rpmdb dir that
gets created during the install, but we actually want the rpmdb to be in
/var/lib/rpm
To see an example of the problem, try:
/usr/bin/mock --init
followed by
/usr/bin/mock --yum-cmd -- -C list installed
It will show an empty list of packages because it can't find the rpmdb.
This means that yum will attempt to reinstall packages that are already
installed when doing rpm builds leading to subtle differences in dependency
ordering when building on another distro.
I have tried passing in the correct macro using -D:
/usr/bin/mock -D '_dbpath %{_var}/lib/rpm' --init
I have tried editing my user's .rpmmacros to add:
%_dbpath %{_var}/lib/rpm
Neither of these works.
Editing /usr/lib/rpm/macros to manually undo the .rpmdb patch works:
%_dbpath %{_var}/lib/rpm
I'm not sure what the best fix is here. This may also need to be reported
against rpm, because the best option might be to remove the patch to
/usr/lib/rpm/macros and instead document how a user could manually add the
change to their .rpmmacros if they want it to include:
%_dbpath %(echo $HOME)/.rpmdb
Vish