ports/81088: portupgrade-20041226_2 unnecessarily update pkgdb

Yoshiaki Kasahara kasahara at nc.kyushu-u.ac.jp
Mon May 16 04:00:30 UTC 2005


>Number:         81088
>Category:       ports
>Synopsis:       portupgrade-20041226_2 unnecessarily update pkgdb
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 16 04:00:28 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Yoshiaki Kasahara
>Release:        FreeBSD 5.4-RELEASE i386
>Organization:
Kyushu University
>Environment:
System: FreeBSD elvenbow.nc.kyushu-u.ac.jp 5.4-RELEASE FreeBSD 5.4-RELEASE #0: Thu May 12 11:13:40 JST 2005 root at elvenbow.nc.kyushu-u.ac.jp:/usr/obj/usr/src/sys/ELVENBOW i386


	
>Description:
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.

	
>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.

	
>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).

	

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list