From owner-freebsd-questions@FreeBSD.ORG Wed Jul 1 23:09:31 2009 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 B710910656A6 for ; Wed, 1 Jul 2009 23:09:31 +0000 (UTC) (envelope-from bf1783@googlemail.com) Received: from mail-qy0-f186.google.com (mail-qy0-f186.google.com [209.85.221.186]) by mx1.freebsd.org (Postfix) with ESMTP id 70E5E8FC20 for ; Wed, 1 Jul 2009 23:09:31 +0000 (UTC) (envelope-from bf1783@googlemail.com) Received: by qyk16 with SMTP id 16so1400240qyk.3 for ; Wed, 01 Jul 2009 16:09:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=bw6ZrfLRFJS9SJZMGlaMGePzOQXpg/O2ZxWvDcnr3kA=; b=Uw6eJPDdJMowIiVo1HUOqhbi2RloNUxSM1U2USwfSCm8XYCpTzN14qqN8fh0cUPaB2 Zxa3rVZSwrRVhTpedUX571X8wJgdXI4qcZPIc/TsP1SBm/WieOfz7a+5aZQmDyXde22J Gjd1wJCqfNr/XcoJeoEOWDJciOlX+fjdWR5Eg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=jJqgE0t6r6PJ4SiuuKnkzc7NHdCNPEfTR3Z9YGwEhnP8sg39kRcTiGQ1Wsg1rJtT5o K1F/QET9eZyAoqNI9javLOq+0ZzGGuHYTpuNuOHwMWsNiQPY7CQEgj5dX3K97PRt44a/ ns8RPH/SoQvatFrMVhnj3h75TElhwxyONsdv8= MIME-Version: 1.0 Received: by 10.224.46.4 with SMTP id h4mr9669991qaf.86.1246489770756; Wed, 01 Jul 2009 16:09:30 -0700 (PDT) Date: Wed, 1 Jul 2009 23:09:30 +0000 Message-ID: From: "b. f." To: freebsd-questions@FreeBSD.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: invalid.pointer@gmail.com Subject: Re: Questions on portmaster 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: Wed, 01 Jul 2009 23:09:32 -0000 Manish Jain wrote: >...Does each child start 'make fetch' in the background ? make checksum, yes. >Further, how can portmaster be tuned to automatically ignore ports which >are actually marked as IGNORE in the port directory ? This is not >covered in the manpage. It respects IGNORE (it checks for it in the port Makefile, and also hands off to bsd.port.mk, which respects it). If you mean +IGNOREME, the others have answered your question. >While doing portmaster -a, I have only managed to stop portmaster from >building exactly one port specified with the -x option. Can I get to >stop multiple ports from being built ? Is there regular expression >support for the -x option ? Not in the sense that you mean, at least that I'm aware of. This one of the things that needs improvement. It is a bit awkward, because it uses the shell's built-in POSIX getopts to parse options, and then calls itself recursively. One way you could fix it would be to apply a patch like: --- portmaster.orig 2009-07-01 12:36:14.000000000 -0400 +++ portmaster 2009-07-01 18:55:59.000000000 -0400 @@ -9,7 +9,7 @@ if [ -z "$PARENT_PID" ]; then PARENT_PID=$$ : ${TMPDIR:=/tmp} - UPGRADE_TOOL=portmaster + UPGRADE_TOOL=$0 # /usr/local is needed in the path for make PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin @@ -788,7 +788,11 @@ u) UNATTENDED=uopt; ARGS="-u $ARGS" ;; v) PM_VERBOSE=vopt; ARGS="-v $ARGS" ;; w) SAVE_SHARED=wopt; ARGS="-w $ARGS" ;; - x) EXCL=$OPTARG ;; + x) if [ -z "${OPTARG%%-*}" ]; then + fail 'The -x option requires an argument' + else + EXCL="-x $OPTARG $EXCL" + fi ;; *) echo '' ; echo "===>>> Try ${0##*/} --help"; exit 1 ;; esac done @@ -810,10 +814,7 @@ [ -n "$FETCH_ONLY" -a -n "$NO_RECURSIVE_CONFIG" ] && fail "The -F and -G options are mutually exclusive" if [ -n "$EXCL" ]; then - case "$EXCL" in - -*) fail 'The -x option requires an argument' ;; - *) ARGS="-x $EXCL $ARGS" ;; - esac + ARGS="$EXCL $ARGS" fi #=============== Begin functions for getopts features and main =============== @@ -1461,14 +1462,17 @@ check_exclude () { [ -n "$EXCL" ] || return 0 - case "$1" in - *${EXCL}*) - if [ -n "$PM_VERBOSE" ]; then - echo "===>>> Skipping $1" - echo " because it matches the pattern: *${EXCL}*" - fi - return 1 ;; - esac + for pkgglob in `echo "$EXCL" | sed -e 's#-x##g'` + do + case "$1" in + *${pkgglob}*) + if [ -n "$PM_VERBOSE" ]; then + echo "===>>> Skipping $1" + echo " because it matches the pattern: *${pkgglob}*" + fi + return 1 ;; + esac ; + done return 0 } (Mind the whitespace because of my MUA.) Then you could just use repeated -x flags, each with one and only one package glob that you wanted to exclude. I changed the definition of UPGRADE_TOOL so that you could put this script in your path under another name, say "jainpmaster", and then call it independently of the original portmaster. As usual, I make no claim that this is the best, only, or most elegant way to do this. Regards, b.