From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 10 21:11:46 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9726116A41C for ; Sun, 10 Jul 2005 21:11:46 +0000 (GMT) (envelope-from olivier.certner@free.fr) Received: from postfix4-2.free.fr (postfix4-2.free.fr [213.228.0.176]) by mx1.FreeBSD.org (Postfix) with ESMTP id 449C343D49 for ; Sun, 10 Jul 2005 21:11:46 +0000 (GMT) (envelope-from olivier.certner@free.fr) Received: from lon92-4-82-226-188-149.fbx.proxad.net (lon92-4-82-226-188-149.fbx.proxad.net [82.226.188.149]) by postfix4-2.free.fr (Postfix) with ESMTP id 47DAB3220BF for ; Sun, 10 Jul 2005 23:11:45 +0200 (CEST) From: Olivier Certner To: freebsd-hackers@freebsd.org Date: Sun, 10 Jul 2005 23:13:12 +0200 User-Agent: KMail/1.8.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200507102313.12719.olivier.certner@free.fr> Subject: Bug in portupgrade X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jul 2005 21:11:46 -0000 Hi, There is a bug with portupgrade when it is used to upgrade already compiled and installed ports for which some dependencies have been deleted in the package database. This causes a crash in the function 'deorigin' in pkgdb.rb. Since I don't know the internals of portupgrade, I don't know if it's normal to call 'deorigin' with its argument set to nil. If it is, then the patch below might be useful (beware, I don't know any ruby, I've just tried something and it works), if it is not, I only can provide the stack (see below) in order for maintainers to seek the faulty callers. Regards, Olivier --------------- /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:323:in `deorigin': cannot convert nil into String (PkgDB::DBError) from /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:916:in `tsort_build' from /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:915:in `each' from /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:915:in `tsort_build' from /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:907:in `each' from /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:907:in `tsort_build' from /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:929:in `sort_build' from /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:933:in `sort_build!' from /usr/local/sbin/portupgrade:674:in `main' from /usr/local/sbin/portupgrade:207:in `initialize' from /usr/local/sbin/portupgrade:207:in `new' from /usr/local/sbin/portupgrade:207:in `main' from /usr/local/sbin/portupgrade:1869 --------------- *** /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb~ Mon Jul 4 00:05:41 2005 --- /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb Mon Jul 4 00:09:34 2005 *************** *** 313,323 **** def deorigin(origin) open_db ! if str = @db['?' + origin] ! str.split else nil end rescue => e raise DBError, e.message end --- 313,328 ---- def deorigin(origin) open_db ! if origin != nil ! if str = @db['?' + origin] ! str.split ! else ! nil ! end else nil end + rescue => e raise DBError, e.message end