From owner-freebsd-ports@FreeBSD.ORG Thu Apr 11 17:38:02 2013 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 26F3E82C for ; Thu, 11 Apr 2013 17:38:02 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-ie0-x22c.google.com (mail-ie0-x22c.google.com [IPv6:2607:f8b0:4001:c03::22c]) by mx1.freebsd.org (Postfix) with ESMTP id F0CADDEB for ; Thu, 11 Apr 2013 17:38:01 +0000 (UTC) Received: by mail-ie0-f172.google.com with SMTP id c10so2386896ieb.3 for ; Thu, 11 Apr 2013 10:38:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=rZRWfWvYmzMCrY+Lquhvli8gYKlFJB8zxJ+BjOjkIRY=; b=ILZnniWW74IM8BJDXgWWi7GSTysPL2ooZ9KD+RGcoYioNHkRcT/VqzRL6PfvX4YH2a O+AmBosPkYFB42+3bxDMm4Z5tvvQxj7NzslwkUJdXkzVKsZ0DX1POSLDVskh7d1ouAHl pWQCnwBsdO90EdnuxR8OCXWEvQYX1VfWT2P9iNuHG69GGLmKQts2wPgZKktKaUnxJZ3c NU62HKhQglMLPrW5esQBYadJeZZBfMIfaYvtiCrv7rFzMHhKTBbmmmyrUJ0EcNTc0mpT ZNFDgWWk1WAtMDHX1kT62R55NVOWz+YCCU2TSS3BrkZ2UpffPKuKr53dWSSflhdCVnH8 2wqA== MIME-Version: 1.0 X-Received: by 10.50.197.170 with SMTP id iv10mr16524606igc.62.1365701881723; Thu, 11 Apr 2013 10:38:01 -0700 (PDT) Received: by 10.64.58.52 with HTTP; Thu, 11 Apr 2013 10:38:01 -0700 (PDT) Received: by 10.64.58.52 with HTTP; Thu, 11 Apr 2013 10:38:01 -0700 (PDT) In-Reply-To: <5166BEB8.7060309@gmail.com> References: <20130411101916.GA3339@tinyCurrent> <51669B48.4050905@gmail.com> <5166BEB8.7060309@gmail.com> Date: Thu, 11 Apr 2013 18:38:01 +0100 Message-ID: Subject: Re: problems with half installed ports From: Chris Rees To: Vitaly Magerya Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: Matthias Apitz , FreeBSD Mailing List X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Apr 2013 17:38:02 -0000 On 11 Apr 2013 14:48, "Vitaly Magerya" wrote: > > Earlier I wrote: > > Anyway, the problem you're describing allows for another fix. If ports/A > > depends of file-B, port system could check not only that file-B exists, > > but if there is also a package that installed it (via 'pkg which'), and > > if not, install ports/B. This will of course slow down ports operations > > somewhat. > > Here's a patch to that effect. > > (Only tested with PKGNG; should work with old pkg tools, but some > tweaking may be required). > > Matthias, can you try to reproduce the situation you described, and see > if it will be resolved after applying this patch? > > diff -ruN Mk.orig/bsd.commands.mk Mk/bsd.commands.mk > --- Mk.orig/bsd.commands.mk 2013-03-19 11:27:52.000000000 +0200 > +++ Mk/bsd.commands.mk 2013-04-11 14:15:49.000000000 +0300 > @@ -128,6 +128,7 @@ > PKG_CREATE?= ${PKG_BIN} create > PKG_ADD?= ${PKG_BIN} add > PKG_QUERY?= ${PKG_BIN} query > +PKG_WHICH?= ${PKG_BIN} which > .else > .if exists(${LOCALBASE}/sbin/pkg_info) > PKG_CMD?= ${LOCALBASE}/sbin/pkg_create > @@ -135,12 +136,14 @@ > PKG_DELETE?= ${LOCALBASE}/sbin/pkg_delete > PKG_INFO?= ${LOCALBASE}/sbin/pkg_info > PKG_VERSION?= ${LOCALBASE}/sbin/pkg_version > +PKG_WHICH?= ${LOCALBASE}/sbin/pkg_info -W > .else > PKG_CMD?= /usr/sbin/pkg_create > PKG_ADD?= /usr/sbin/pkg_add > PKG_DELETE?= /usr/sbin/pkg_delete > PKG_INFO?= /usr/sbin/pkg_info > PKG_VERSION?= /usr/sbin/pkg_version > +PKG_WHICH?= /usr/sbin/pkg_info -W > .endif > .endif > > diff -ruN Mk.orig/bsd.port.mk Mk/bsd.port.mk > --- Mk.orig/bsd.port.mk 2013-03-30 07:31:29.000000000 +0200 > +++ Mk/bsd.port.mk 2013-04-11 16:35:42.000000000 +0300 > @@ -5063,6 +5063,9 @@ > if [ ${_DEPEND_ALWAYS} = 1 ]; then \ > ${ECHO_MSG} " (but building it anyway)"; \ > notfound=1; \ > + elif ! ${PKG_WHICH} "$$prog" >/dev/null; then \ > + ${ECHO_MSG} " (but not installed by any package)"; \ > + notfound=1; \ > else \ > notfound=0; \ > fi; \ > @@ -5104,6 +5107,9 @@ > if [ ${_DEPEND_ALWAYS} = 1 ]; then \ > ${ECHO_MSG} " (but building it anyway)"; \ > notfound=1; \ > + elif ! ${PKG_WHICH} `${WHICH} "$$prog"` >/dev/null; then \ > + ${ECHO_MSG} " (but not installed by any package)"; \ > + notfound=1; \ > else \ > notfound=0; \ > fi; \ > @@ -5141,11 +5147,19 @@ > dir=$${dir%%:*}; \ > fi; \ > ${ECHO_MSG} -n "===> ${PKGNAME} depends on shared library: $$lib"; \ > - if ${LDCONFIG} ${_LDCONFIG_FLAGS} -r | ${GREP} -vwF -e "${PKGCOMPATDIR}" | ${GREP} -qwE -e "-l$$pattern"; then \ > + libs=`${LDCONFIG} ${_LDCONFIG_FLAGS} -r | ${GREP} -vwF -e "${PKGCOMPATDIR}"`; \ > + if ${ECHO_CMD} "$$libs" | ${GREP} -qwE -e "-l$$pattern"; then \ > ${ECHO_MSG} " - found"; \ > if [ ${_DEPEND_ALWAYS} = 1 ]; then \ > ${ECHO_MSG} " (but building it anyway)"; \ > notfound=1; \ > + elif ${ECHO_CMD} "$$libs" | ${GREP} -wE -e "-l$$pattern" | ${SED} 's/.*=> //' | \ > + while read lib; do \ > + if ${PKG_WHICH} "$$lib" >/dev/null; then return 1; fi; \ > + done; \ > + then \ > + ${ECHO_MSG} " (but not installed by any package)"; \ > + notfound=1; \ > else \ > notfound=0; \ > fi; \ No thanks. Ports should be happy to use files whether they're installed by ports or not. Just don't interrupt installs, and you'll be OK! Stagedir will fix this problem correctly once it's implemented. Chris