ports/99168: portupgrade: pkgdb -F fails when pkgdb.db is missing

Josh Carroll josh.carroll at gmail.com
Mon Jun 19 06:50:20 UTC 2006


>Number:         99168
>Category:       ports
>Synopsis:       portupgrade: pkgdb -F fails when pkgdb.db is missing
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 19 06:50:19 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Josh Carroll
>Release:        6.1-RELEASE
>Organization:
n/a
>Environment:
FreeBSD pflog.net 6.1-RELEASE FreeBSD 6.1-RELEASE #0: Mon May  8 15:48:29 PDT 2006     root at pflog.net:/usr/obj/usr/src/sys/DEBLIN  i386

>Description:
When /var/db/pkg/pkgdb.db is missing, and portupgrade is built with WITH_BDB4, pkgdb -u and pkgdb -F fail with the following error:

[Rebuilding the pkgdb <format:dbm_hash> in /var/db/pkg ... can't convert String into Integer: Cannot update the pkgdb!]

On line 619 of /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb, it appears as though the call to DBM.open is passing the mode variable instead of the perm variable:

    db = DBM.open(@db_filebase, mode)

I think should be:

    db = DBM.open(@db_filebase, perm)

Changing it to perm works on this machine, though I am unfamiliar with the dbm package in ruby.

The versions of portupgrade, ruby and ruby-bdb are:

portupgrade-2.1.4_2,1
ruby-1.8.4_8,1
ruby18-bdb-0.5.9

Thanks,
Josh
>How-To-Repeat:
- Build portupgrade with WITH_BDB4 set (via make config).
- Remove or move /var/db/pkg/pkgdb.db
- Run pkgdb -F or pkgdb -u
>Fix:
Modify line 619 of /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb as follows:

Change:

    db = DBM.open(@db_filebase, mode)

to:

    db = DBM.open(@db_filebase, perm)

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



More information about the freebsd-ports-bugs mailing list