ports/125936: portupgrade -R fails if BUILD_DEP's are not installed.
Michael Schout
mschout at gkg.net
Thu Jul 24 16:20:04 UTC 2008
>Number: 125936
>Category: ports
>Synopsis: portupgrade -R fails if BUILD_DEP's are not installed.
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Thu Jul 24 16:20:03 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator: Michael Schout
>Release: FreeBSD 6.2-RELEASE-p5 i386
>Organization:
GKG.NET, Inc
>Environment:
System: FreeBSD bu1.gkg.net 6.2-RELEASE-p5 FreeBSD 6.2-RELEASE-p5 #0: Fri Jun 29 23:27:37 CDT 2007 mschout at bu1.gkg.net:/usr/obj/usr/src/sys/GKGGENERIC-SMP i386
>Description:
If any BUILD_DEP's of a package have been removed, running portupgrade -R pkgname will fail
with an exception. For example, if postgresql74-server is built, it has BUILD_DEP's that include
bison and m4. If you then remove bison and m4 (because they are not runtime dependencies), then later
try to portupgrade -R postgresql-server, then portupgrade fails like this:
[Gathering depends for databases/postgresql74-server ... done]
[Exclude up-to-date packages ...... done]
/usr/local/lib/ruby/site_ruby/1.8/pkginfo.rb:74:in `initialize': : Not in due form: <name>-<version> (ArgumentError)
from /usr/local/sbin/portupgrade:931:in `new'
from /usr/local/sbin/portupgrade:931:in `do_upgrade'
from /usr/local/sbin/portupgrade:815:in `main'
from /usr/local/sbin/portupgrade:811:in `each'
from /usr/local/sbin/portupgrade:811:in `main'
from /usr/local/lib/ruby/1.8/optparse.rb:785:in `initialize'
from /usr/local/sbin/portupgrade:229:in `new'
from /usr/local/sbin/portupgrade:229:in `main'
from /usr/local/sbin/portupgrade:2208
This error is raised because of this section in portupgrade:
if $upward_recursive || $config
dep = []
get_all_depends(origin).each do |d|
dep << $pkgdb.deorigin(d).to_s
end
depends |= dep if $upward_recursive
end
The problem is that $pkgdb.deorigin(d).to_s returns an empty string if the dependency is not
installed, which means you end up with a blank entry in the "depends" array.
>How-To-Repeat:
Build any port that has BUILD_DEP's, then uninstall one or more of the BUILD_DEP's,
and do portupgrade -Rf portname
>Fix:
Probably add the missing build deps to the install tasks.
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list