From owner-freebsd-ports@FreeBSD.ORG Fri Apr 4 15:25:54 2014 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A39652A for ; Fri, 4 Apr 2014 15:25:54 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF1BDC64 for ; Fri, 4 Apr 2014 15:25:53 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s34FPrER052365 for ; Fri, 4 Apr 2014 15:25:53 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s34FPruc052363 for freebsd-ports@freebsd.org; Fri, 4 Apr 2014 15:25:53 GMT (envelope-from bdrewery) Received: (qmail 63023 invoked from network); 4 Apr 2014 10:25:50 -0500 Received: from unknown (HELO roundcube.xk42.net) (10.10.5.5) by sweb.xzibition.com with SMTP; 4 Apr 2014 10:25:50 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Fri, 04 Apr 2014 10:25:50 -0500 From: Bryan Drewery To: Volodymyr Kostyrko Subject: Re: working with port options from commandline Organization: FreeBSD In-Reply-To: <533EC11A.3030600@b1t.name> References: <533D293D.1050902@b1t.name> <533E91E9.3080305@FreeBSD.org> <533EC11A.3030600@b1t.name> Message-ID: X-Sender: bdrewery@FreeBSD.org User-Agent: Roundcube Webmail/0.9.5 Cc: FreeBSD Ports X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 15:25:54 -0000 On 2014-04-04 09:26, Volodymyr Kostyrko wrote: > 04.04.2014 14:05, Bryan Drewery написав(ла): >> On 4/3/2014 4:26 AM, Volodymyr Kostyrko wrote: >>> Hi all. >>> >>> I'm all about automation. I'd like to automate most tasks so I can >>> schedule them or write a script with which everything would be done >>> automatically. >>> >>> I have some difficulties with current port options framework: >>> >>> 1. Is there a good way to set/unset any option from command line >>> without >>> firing up dialog? Something like 'make -C port/dir -DSET=OPT1,OPT2 >>> -DUNSET=OPT3 updateconfig'. >> >> This should work: >> make ... OPTIONS_SET="OPT OPT OPT" OPTIONS_UNSET="OPT OPT OPT" >> BATCH=1 > > I know but my target is to manage different machines with different > options remotely. I'm currently experimenting with sysutils/py-salt > and I found it already has required functionality in ports.config - I > can remotely update ports configuration without building them. The > given line actually doesn't change port configuration, it just makes > port behave differently in the current run. > > Why I didn't like this is because it works only on current port but > not on the ports required by this one. Imagine you have a number of > _differently_ configured machines and you want to manage updates > remotely. Poudriere doesn't help as packages actually may very from > system to system, Poudriere handles that situation fine. You setup sets for each configuration you want. Your options can either be in the /var/db/ports format or in a make.conf with OPTIONS_SET/OPTIONS_UNSET/uniquename_OPTIONS... poudriere bulk -j JAIL -z SET This will use: /usr/local/etc/poudriere.d/SET-make.conf /usr/local/etc/poudriere.d/make.conf /usr/local/etc/poudriere.d/SET-options So with 1 jail you can build package sets for each target machine. You can use poudriere options to configure these in the /var/db/ports format which automatically creates the SET-options dir: poudriere options -z SET Poudriere will rebuild packages when the selected options change or new defaults are added. > what I need is number of command line tools to > inspect what should be build, inspect what options should be changed, > update options from central datastore and rebuild ports - without > using a GUI. > >>> 2. Is there a good way to query for option updates? You know when you >>> are building a port the option dialog will still be shown if there >>> are >>> new options not present in current config. Can I get those options >>> somehow like 'make -C port/dir changedconfig'? >> >> The current handling uses: >> make -V NEWOPTIONS > > Exactly what I needed. > >> You can also use 'make pretty-print-config' for a parseable output. > > Nice thing, I'll remember this one. -- Regards, Bryan Drewery