From owner-freebsd-bugs@FreeBSD.ORG Mon Oct 6 10:30:13 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3BBA816A4B3 for ; Mon, 6 Oct 2003 10:30:13 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 68FC743FFD for ; Mon, 6 Oct 2003 10:30:09 -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 h96HU9FY057733 for ; Mon, 6 Oct 2003 10:30:09 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h96HU9GY057732; Mon, 6 Oct 2003 10:30:09 -0700 (PDT) (envelope-from gnats) Resent-Date: Mon, 6 Oct 2003 10:30:09 -0700 (PDT) Resent-Message-Id: <200310061730.h96HU9GY057732@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-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 D57D716A4B3 for ; Mon, 6 Oct 2003 10:25:12 -0700 (PDT) Received: from mx2.fillmore-labs.com (lima.fillmore-labs.com [62.138.193.83]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6950D43F93 for ; Mon, 6 Oct 2003 10:25:11 -0700 (PDT) (envelope-from eikemeier@fillmore-labs.com) Received: from pd958a39d.dip.t-dialin.net ([217.88.163.157] helo=fillmore-labs.com ident=33va3kvmtiwh2rof) by mx2.fillmore-labs.com with asmtp (TLSv1:AES256-SHA:256) (Exim 4.24; FreeBSD 4.9) id 1A6Z6c-0003ij-4D for FreeBSD-gnats-submit@FreeBSD.org; Mon, 06 Oct 2003 19:25:10 +0200 Message-Id: <3F81A574.80209@fillmore-labs.com> Date: Mon, 06 Oct 2003 19:25:08 +0200 From: Oliver Eikemeier To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/57653: [PATCH] bsd.port.mk: LIB_DEPENDS should not use libraries in ${LOCALBASE}/lib/compat/pkg X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Oct 2003 17:30:13 -0000 >Number: 57653 >Category: bin >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-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Oct 06 10:30:09 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: