Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Jun 2006 06:48:08 GMT
From:      Josh Carroll <josh.carroll@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/99168: portupgrade: pkgdb -F fails when pkgdb.db is missing
Message-ID:  <200606190648.k5J6m86V074898@www.freebsd.org>
Resent-Message-ID: <200606190650.k5J6oJPX045794@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200606190648.k5J6m86V074898>