When using tools of the portupgrade package including portupgrade, portinstall, portversion etc, the package db file is frequently updated unnecessarily even when there is no update in the package list... like this: ---> Backing up the old version [Updating the pkgdb <format:bdb1_btree> in /var/db/pkg ... - 812 packages found (-0 +0) done] ---> Uninstalling the old version [Updating the pkgdb <format:bdb1_btree> in /var/db/pkg ... - 812 packages found (-0 +0) done] ---> Deinstalling 'smartmontools-5.32' I believe this behavior started to appear after the latest patch to fix a vulnerability of portupgrade. Fix: pkgdb.rb checks the timestamp of db_dir (/var/db/pkg) against db_file to determine whether updating pkgdb.db is needed. After the fix for the vulnerability, pkgdb.fixme is created inside /var/db/pkg, so the deletion of the file also alters the timestamp of the directory. It causes extra update of pkgdb.db. Please place pkgdb.fixme file elsewhere, or change logic of pkgdb.rb (I don't fully understand the logic, so I cannot tell the detail). How-To-Repeat: Run portversion (which doesn't modify installed packages) then run pkgdb -u to see it updates pkgdb.db even when there is no change.
Responsible Changed From-To: freebsd-ports-bugs->simon Simon broke it http://www.freebsd.org/cgi/query-pr.cgi?pr=81088 Simon did this: http://people.freebsd.org/~simon/patches/port-portupgrade-CAN-2005-0610_3.patch
State Changed From-To: open->analyzed The following patch, which I expect to be commited very soon, should fix the problem: http://people.freebsd.org/~simon/patches/port-portupgrade-CAN-2005-0610_3.patch
On Wed, 18 May 2005 22:05:22 GMT, "Simon L. Nielsen" <simon@FreeBSD.org> said: > The following patch, which I expect to be commited very soon, > should fix the problem: > > http://people.freebsd.org/~simon/patches/port-portupgrade-CAN-2005-0610_3.patch The 'pkgdb.fixme' file is shared among commands of portupgrade. For example, if 'pkgdb -u' is interrupted before finish, 'pkgdb.fixme' is remained. Subsequent invocation of commands will notice it and try to re-run 'pkgdb -u' before doing their main task. So, everytime creating different tmpdir will break them too, I believe.
On 2005.05.19 02:00:25 +0000, Yoshiaki Kasahara wrote: > On Wed, 18 May 2005 22:05:22 GMT, > "Simon L. Nielsen" <simon@FreeBSD.org> said: > > > The following patch, which I expect to be commited very soon, > > should fix the problem: > > > > http://people.freebsd.org/~simon/patches/port-portupgrade-CAN-2005-0610_3.patch > > The 'pkgdb.fixme' file is shared among commands of portupgrade. For > example, if 'pkgdb -u' is interrupted before finish, 'pkgdb.fixme' is > remained. Subsequent invocation of commands will notice it and try to > re-run 'pkgdb -u' before doing their main task. > > So, everytime creating different tmpdir will break them too, I believe. Hmm, I suspect that you are right :-/. -- Simon L. Nielsen
On Sun, 22 May 2005 01:11:04 +0200, "Simon L. Nielsen" <simon@freebsd.org> said: > Could you try the attached patch and see if it works for you? It works fine for me. Thank you very much! -- kasahara@nc.kyushu-u.ac.jp
State Changed From-To: analyzed->closed This should now been fixed with portupgrade-20041226_3. Thanks for the report!