From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Aug 30 18:40:06 2009 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFFD7106566B for ; Sun, 30 Aug 2009 18:40:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id AE4658FC1F for ; Sun, 30 Aug 2009 18:40:03 +0000 (UTC) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n7UIe3YZ011439 for ; Sun, 30 Aug 2009 18:40:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n7UIe34Y011438; Sun, 30 Aug 2009 18:40:03 GMT (envelope-from gnats) Resent-Date: Sun, 30 Aug 2009 18:40:03 GMT Resent-Message-Id: <200908301840.n7UIe34Y011438@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dan Lukes Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 073EF106568D for ; Sun, 30 Aug 2009 18:36:45 +0000 (UTC) (envelope-from dan@dual.ms.mff.cuni.cz) Received: from dual.ms.mff.cuni.cz (www.freebsd.cz [IPv6:2001:718:1e03:801::6]) by mx1.freebsd.org (Postfix) with ESMTP id 8E7E78FC12 for ; Sun, 30 Aug 2009 18:36:44 +0000 (UTC) Received: (from root@localhost) by kulesh.obluda.cz (8.14.3/8.14.3/Submit) id n7TJP9d2001262; Sat, 29 Aug 2009 21:25:09 +0200 (CEST) (envelope-from dan) Message-Id: <200908291925.n7TJP9d2001262@kulesh.obluda.cz> Date: Sat, 29 Aug 2009 21:25:09 +0200 (CEST) From: Dan Lukes To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/138356: pkgdb -F + ALT_PKGDEP => broken logic X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Dan Lukes List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Aug 2009 18:40:06 -0000 >Number: 138356 >Category: ports >Synopsis: pkgdb -F + ALT_PKGDEP => broken logic >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: Sun Aug 30 18:40:03 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Dan Lukes >Release: FreeBSD >Organization: Obludarium >Environment: System: FreeBSD 7.2-STABLE but exact OS version is not relevant portupgrade 2.4.6_3,2 >Description: pkgdb -F deletes dependencies as irrelevant even they aren't >How-To-Repeat: Imagine you have a system with databases/php5-mysqli and databases/mysql50-client installed. The php5-mysqli depends on MySQL. Then upgrade MySQL 5.0 to MySQL 5.1 Such upgrade is properly recorded in pkgtools.conf, e.g.: ALT_PKGDEP = { 'databases/mysql50-client' => 'databases/mysql51-client', 'databases/mysql50-server' => 'databases/mysql51-server', } Now, the php5-mysqli has unsatisfied dependency to (missing) databases/mysql50-client. pkgdb -F needs to be run Unfortunately, it claim the missing dependency as irrelevant and delete it. It's example, of course. Simmilar problem can be seen on other cross-port upgrades, e.g. lang/perl5.8 -> lang/perl5.10, lang/python25->lang/python26 and more. >Fix: There are two problems: [1] the pkgdb search the ALT_PKGDEP only for package names, not for origins. The second example on pkgtools.conf/ALT_PKGDEP claims the origins can be used, but pkgdb ignore such variant. The databases/mysql50-client is NOT recognized when searching for mysql-client-5.0.75 port Because the pkgdb found no regular nor alternative dependency to mysql-client-5.0.75 for php5-mysqli the dependency is deleted. pkgdb should use both package name and origin when searching ALT_PKGDEP definition so current call to alt(dep) needs to be replaced with alt(dep,origin) [2] even in the case the pkgdb correctly identified the alternative dependency (because it's written using package name, not origin) it misinterpret such information. In that acse the pkgdb SKIP further processing of the package, leaving it in uncorrected state. The pkgdb should continue to repair the missing dependency of the package. The fix is simple, because the code can correct the dependency correctly - only unnecesarry SKIP block them to do it. The attached patch corrects both problems. --- patch-DAN-bin-pkgdb begins here --- --- bin/pkgdb.orig 2009-08-28 23:47:36.000000000 +0200 +++ bin/pkgdb 2009-08-28 23:48:23.000000000 +0200 @@ -647,11 +647,12 @@ puts "Stale dependency: #{pkgname} -> #{dep} (#{origin}):" if !$omit_check && !get_real_run_deps(pkgname).values.include?(origin) # Ignore dependencies which exist in ALG_PKGDEP - next if alt_dep(dep) + unless alt_dep(dep, origin) puts "-> Deleted. (irrelevant)" modify_pkgdep(pkgname, dep, :delete) next + end end if config_held?(pkgname) && !$force --- patch-DAN-bin-pkgdb ends here --- >Release-Note: >Audit-Trail: >Unformatted: