On Sat, Jul 12, 2008 at 08:38:18PM +0000, Jacob Meuser wrote:
> On Sat, Jul 12, 2008 at 03:11:18PM -0400, Juan Miscaro wrote:
> > Hi, I have a script that I use to automate server installations.
> > Every time I come to the point of installing a port with a certain
> > flavor:
> > 
> > postfix with sasl2/mysql
> > 
> > I can never get it to work.
> > 
> > I thought I had it working before by putting in the Makefile:
> > 
> > FLAVORS=     sasl2 mysql
> > 
> > but this is ignored.
> > 
> > Putting the following in the script also barfs:
> > 
> > env FLAVOR="sasl2 mysql"
> > 
> > What am I missing?
> 
> instead of manually setting FLAVOR in your script (btw, FLAVORS is
> just a list of available FLAVORs, not what FLAVORs will be built)
> or mucking about in the ports Makefiles, you probably want to use
> SUBDIRLIST from the top of the ports directory.  for example:
> 
> $ echo 'mail/postfix/stable,sasl2,mysql' > /tmp/build-list
> $ echo 'another/port' >> /tmp/build-list
> $ echo 'one/more,flavored' >> /tmp/build-list
> $ echo 'still/another,-subpackage' >> /tmp/build-list
> $ cd /usr/ports
> $ BULK=Yes FETCH_PACKAGES=Yes SUBDIRLIST=/tmp/build-list make install
> 
> see bsd.port.mk(5) and packages-specs(7) for more info.
> 
> btw, you can generate a SUBDIRLIST from all installed packages:
> 
> $ pkg_info -fa | sed -ne 's/[EMAIL PROTECTED] subdir=\([^ ]*\) .*/\1/p' > 
> build-list
> 
> although, there is probably a better way to do this with perl.
> 

Duh moment.

Jacob, you should rtfm from time to time, you'd discover that pkg_info has
a -P option, that yields precisely the pkgpath info... ;-)


This is going to be *ways* faster than building the full list of all 
packing-lists (and no, pkg_info doesn't just display the file, it reads the 
file, parses it, builds internal structures and pretty-prints the result, 
which is interesting for several reasons, chief among them that it will 
tell you if a packing-list is bogus).

Reply via email to