From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Oct 6 11:00:36 2003 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 42AE816A4BF for ; Mon, 6 Oct 2003 11:00:36 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id A37FD43FF9 for ; Mon, 6 Oct 2003 11:00:26 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h96I0QFY059396 for ; Mon, 6 Oct 2003 11:00:26 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h96I0Qf4059395; Mon, 6 Oct 2003 11:00:26 -0700 (PDT) (envelope-from gnats) Resent-Date: Mon, 6 Oct 2003 11:00:26 -0700 (PDT) Resent-Message-Id: <200310061800.h96I0Qf4059395@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, Oliver Eikemeier Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 631CE16A4B3 for ; Mon, 6 Oct 2003 10:53:18 -0700 (PDT) Received: from mx2.fillmore-labs.com (lima.fillmore-labs.com [62.138.193.83]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8862643FEA for ; Mon, 6 Oct 2003 10:53:17 -0700 (PDT) (envelope-from eikemeier@fillmore-labs.com) Received: from pd958a39d.dip.t-dialin.net ([217.88.163.157] helo=fillmore-labs.com ident=srvzpyipy6mlgh3j) by mx2.fillmore-labs.com with asmtp (TLSv1:AES256-SHA:256) (Exim 4.24; FreeBSD 4.9) id 1A6ZXn-0003kN-V0 for FreeBSD-gnats-submit@FreeBSD.org; Mon, 06 Oct 2003 19:53:16 +0200 Message-Id: <3F81AC08.2030004@fillmore-labs.com> Date: Mon, 06 Oct 2003 19:53:12 +0200 From: Oliver Eikemeier To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/57665: [PATCH] bsd.port.mk: LIB_DEPENDS should not use libraries in ${LOCALBASE}/lib/compat/pkg X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Oct 2003 18:00:36 -0000 >Number: 57665 >Category: ports >Synopsis: [PATCH] bsd.port.mk: LIB_DEPENDS should not use libraries in ${LOCALBASE}/lib/compat/pkg >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Oct 06 11:00:25 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Oliver Eikemeier >Release: FreeBSD 5.1-CURRENT i386 >Organization: Fillmore Labs - http://www.fillmore-labs.com >Environment: System: FreeBSD nuuk.fillmore-labs.com 5.1-CURRENT >Description: When using port sysutils/portupgrade to manage port installation, it is possible for stale libraries to end up in ${LOCALBASE}/lib/compat/pkg. Even though portupgrade does its best to clean them up, they can persist when the library changes its version number (libintl.so.4 => libintl.so.5), or the upgrade process is interrupted by ctrl-C. ldconfig -r (and bsd.port.mk) finds these libraries, assuming the whole port needed for LIB_DEPENDS (including headers) is installed, which it isn't. This patch aborts building if a needed library is found only in ${LOCALBASE}/lib/compat/pkg. The initial bug report came from Thomas Fritz , thanks for the help in tracking it down. >How-To-Repeat: # portinstall net/openldap21-client [...] # pkg_deinstall -P 'openldap-*' [...] ---> Preserving /usr/local/lib/libldap.so.2 as /usr/local/lib/compat/pkg/libldap.so.2 [...] # portinstall net/openldap21-server [...] ===> openldap-server-2.1.22_2 depends on shared library: ldap.2 - found [...] # pkg_glob 'openldap-*' Stale dependency: openldap-server-2.1.22_2 --> openldap-client-2.1.22 -- manually run 'pkgdb -F' to fix, or specify -O to force. The usage of `pkg_deinstall -P' may seem artificial, but this is exactly the command used by portupgrade if used without the `-u' option. >Fix: --- bsd.port.mk.patch begins here --- --- bsd.port.mk.orig 3 Sep 2003 19:50:24 -0000 +++ bsd.port.mk 6 Oct 2003 16:51:09 -0000 @@ -1009,6 +1009,8 @@ PREFIX?= ${LOCALBASE} .endif +PKGCOMPATDIR?= ${LOCALBASE}/lib/compat/pkg + .if !defined(PERL_LEVEL) && defined(PERL_VERSION) perl_major= ${PERL_VERSION:C|^([1-9]+).*|\1|} _perl_minor= 00${PERL_VERSION:C|^([1-9]+)\.([0-9]+).*|\2|} @@ -3894,9 +3896,9 @@ @for i in ${LIB_DEPENDS}; do \ lib=$${i%%:*}; \ case $$lib in \ - *.*.*) pattern=$$lib ;;\ + *.*.*) pattern="`${ECHO_CMD} $$lib | ${SED} -e 's/\./\\./g'`" ;;\ *.*) pattern="$${lib%%.*}\.$${lib#*.}" ;;\ - *) pattern=$$lib ;;\ + *) pattern="$$lib" ;;\ esac; \ dir=$${i#*:}; \ target=$${i##*:}; \ @@ -3941,6 +3943,11 @@ ${FALSE}; \ fi; \ fi; \ + fi; \ + if ${LDCONFIG} -r | ${GREP} -wE -e "-l$$pattern" | ${HEAD} -n 1 | grep -qwF -e "${PKGCOMPATDIR}"; then \ + ${ECHO_MSG} "Error: stale library \"$$lib\" found in ${PKGCOMPATDIR}."; \ + ${ECHO_MSG} "Please clean out ${PKGCOMPATDIR} manually."; \ + ${FALSE}; \ fi; \ done .endif --- bsd.port.mk.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: