From owner-freebsd-questions@FreeBSD.ORG Mon Mar 1 21:11:57 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B72E91065679 for ; Mon, 1 Mar 2010 21:11:57 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (gate6.infracaninophile.co.uk [IPv6:2001:8b0:151:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 21E198FC0C for ; Mon, 1 Mar 2010 21:11:56 +0000 (UTC) Received: from seedling.black-earth.co.uk (seedling.black-earth.co.uk [81.187.76.163]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.4/8.14.4) with ESMTP id o21LBpOS045402 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Mon, 1 Mar 2010 21:11:52 GMT (envelope-from m.seaman@infracaninophile.co.uk) Message-ID: <4B8C2D97.70808@infracaninophile.co.uk> Date: Mon, 01 Mar 2010 21:11:51 +0000 From: Matthew Seaman Organization: Infracaninophile User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-GB; rv:1.9.1.8) Gecko/20100216 Thunderbird/3.0.2 MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <86zl2tkrrv.fsf@blue.stonehenge.com> <6201873e1002281349n2bcfd16dte6fdce53cd14c1db@mail.gmail.com> <86iq9hkoxf.fsf@blue.stonehenge.com> <6201873e1002281738o35444a7ahcc184951f712f0a7@mail.gmail.com> <86ocj8kee0.fsf@blue.stonehenge.com> <6201873e1002281742i687c2d41y44e3e0f97f35166f@mail.gmail.com> <86k4twke6h.fsf@blue.stonehenge.com> <4B8B8EF4.9040806@infracaninophile.co.uk> <86pr3ohs9f.fsf@blue.stonehenge.com> <4B8C0538.3090309@infracaninophile.co.uk> In-Reply-To: <4B8C0538.3090309@infracaninophile.co.uk> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.95.3 at happy-idiot-talk.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_ADSP_ALL, SPF_FAIL autolearn=no version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on happy-idiot-talk.infracaninophile.co.uk Subject: Re: how do I tell ports that perl5.8 should never be installed? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2010 21:11:57 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 01/03/2010 18:19:36, Matthew Seaman wrote: > On second thoughts, writing a small wrapper around pkg_add(1) that greps > through the @pkgdep lines in the +CONTENTS file from the package tarball > and bails if it finds the wrong version of perl would be a much cleaner > approach. The -M (--master) and -S (--slave) flags to pkg_add look > interesting in this context. Arrgh. This is so nearly workable. Unfortunately, -M or -S don't play nicely with options like -r or -v -- seems you're meant to have local copies of all of the dependencies already downloaded and in a directory on $PKG_PATH in that case. Given that, then this script will reject any attempt to install a pkg that depends on perl-5.8: #!/bin/sh PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin ; export PATH IFS=' ' ; export IFS umask 022 reject='^@pkgdep perl-5.8' TMPFILE=$(mktemp -t mypkgadd) || exit 1 trap "rm $TMPFILE" KILL HUP EXIT if pkg_add -M ${1+$@} | sed -n -e '/^\/var\/tmp\/instmp/,$p' | \ tee $TMPFILE | grep "$reject" 2>&1 >/dev/null ; then echo "Error: found forbidden package dependency $reject" exit 1 fi pkg_add -S < $TMPFILE && rm -rf $( head -1 $TMPFILE ) # # That's All Folks! # Now, the only missing bit is 'pkg_add -r -S' not fetching dependency pkgs from the remote site. Also options like -r and -v seem to cause bogons to be emitted to stdout which screws up the -M action, but that has been worked around. Cheers, Matthew - -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.14 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkuMLZcACgkQ8Mjk52CukIwWeQCfSPZQBpoB1cM0ondxT0PfJYXF nZAAn3g18cY1mfa223gQzZDtusU1moxq =WbEf -----END PGP SIGNATURE-----