Re: auditing port options and following default option value changes

2014-08-28 Thread Matthew Seaman
On 28/08/2014 04:56, Adam McDougall wrote:
 On 08/27/2014 21:12, Don Lewis wrote:
 I'm pretty much ready to throw in the towel on upgrading ports in place
 with portupgrade and I'm planning on switching to poudriere.  As part of
 this conversion, I'd like to figure out what ports have non-default
 options and which options are set to non-default values.  Then I can
 figure out whether I want to set each option back to default or
 propagate the non-default value to poudriere.

 Also, since the option files for each port contain the values for all
 the options, if I have a port with one non-default option value set, how
 can I follow updates to the default values of the other options?
 
 This may help:
 http://docs.freebsd.org/cgi/mid.cgi?53FDE021.5030108
 
 I have not abandoned all my options files yet, I've eliminated some over
 time as I switch to defining options in make.conf.  I'll probably get
 burned some day and finish it off.

poudriere options creates a directory structure under
/usr/local/etc/poudriere.d/options [*] identical to what's under
/var/db/ports
so you can just make a link...

# cd /usr/local/etc/poudriere.d
# ls -la options
lrwxr-xr-x  1 root  wheel  13 Dec 24  2012 options@ - /var/db/ports

If you also set up /usr/ports as your default ports tree:

# poudriere ports -l
PORTSTREE METHOD TIMESTAMP   PATH
default   svn2014-08-27 07:55:55 /usr/ports

then you end up being able to ad-hoc compile anything from ports on
demand, and you can just add it to your poudriere builds after the fact.
 Obviously, this is only of much use directly on your poudriere build
box, so limited to small-scale setups.

Cheers,

Matthew

[*] Possibly modified to include jail or ports tree names in case you
want different options for different package sets.

-- 
Dr Matthew J Seaman MA, D.Phil.
PGP: http://www.infracaninophile.co.uk/pgpkey




signature.asc
Description: OpenPGP digital signature


Re: auditing port options and following default option value changes

2014-08-28 Thread Don Lewis
On 28 Aug, Matthew Seaman wrote:
 On 28/08/2014 04:56, Adam McDougall wrote:
 On 08/27/2014 21:12, Don Lewis wrote:
 I'm pretty much ready to throw in the towel on upgrading ports in place
 with portupgrade and I'm planning on switching to poudriere.  As part of
 this conversion, I'd like to figure out what ports have non-default
 options and which options are set to non-default values.  Then I can
 figure out whether I want to set each option back to default or
 propagate the non-default value to poudriere.

 Also, since the option files for each port contain the values for all
 the options, if I have a port with one non-default option value set, how
 can I follow updates to the default values of the other options?
 
 This may help:
 http://docs.freebsd.org/cgi/mid.cgi?53FDE021.5030108

That's an interesting way of handling local patches that I hadn't
thought of.  I just have mine scattered around the ports tree under
files/ like the official patches.  I can take inventory by running svn
status and looking for '?'.

I definitely want to switch to from individual option files to
make.conf, but issue for me is trying to figure out what all should go
in there from my current option files.

 I have not abandoned all my options files yet, I've eliminated some over
 time as I switch to defining options in make.conf.  I'll probably get
 burned some day and finish it off.
 
 poudriere options creates a directory structure under
 /usr/local/etc/poudriere.d/options [*] identical to what's under
 /var/db/ports
 so you can just make a link...
 
 # cd /usr/local/etc/poudriere.d
 # ls -la options
 lrwxr-xr-x  1 root  wheel  13 Dec 24  2012 options@ - /var/db/ports

I noticed that, but I figure this is a good opportunity to clean out all
the cruft that accumulated.  Off the top of my head, I can think of only
a small handful of things that I don't want at their default settings,
and I suspect that can mostly be handled by setting them in make.conf.
I just want to make sure that I'm not overlooking something in those 509
option files ...

 If you also set up /usr/ports as your default ports tree:
 
 # poudriere ports -l
 PORTSTREE METHOD TIMESTAMP   PATH
 default   svn2014-08-27 07:55:55 /usr/ports
 
 then you end up being able to ad-hoc compile anything from ports on
 demand, and you can just add it to your poudriere builds after the fact.
  Obviously, this is only of much use directly on your poudriere build
 box, so limited to small-scale setups.

I'm already doing that to handle various local patches as well as allow
me to use poudriere to test build the ports that I maintain.

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: auditing port options and following default option value changes

2014-08-28 Thread Don Lewis
On 28 Aug, Don Lewis wrote:
 On 28 Aug, Matthew Seaman wrote:

 poudriere options creates a directory structure under
 /usr/local/etc/poudriere.d/options [*] identical to what's under
 /var/db/ports
 so you can just make a link...
 
 # cd /usr/local/etc/poudriere.d
 # ls -la options
 lrwxr-xr-x  1 root  wheel  13 Dec 24  2012 options@ - /var/db/ports
 
 I noticed that, but I figure this is a good opportunity to clean out all
 the cruft that accumulated.  Off the top of my head, I can think of only
 a small handful of things that I don't want at their default settings,
 and I suspect that can mostly be handled by setting them in make.conf.
 I just want to make sure that I'm not overlooking something in those 509
 option files ...

I discovered make showconfig and used it to hack together this script
that prints out port options that are set to non-default values:
http://people.freebsd.org/~truckman/portoptions

#!/bin/sh
PORTSDIR=/usr/ports

EMPTYPORTDBDIR=`mktemp -d /tmp/emptyXXX`
OPTIONDEFAULTS=`mktemp /tmp/optiondefaultsXX`
OPTIONSETTINGS=`mktemp /tmp/optionsettingsXX`
DEFAULTS=`mktemp /tmp/defaultsXX`
SETTINGS=`mktemp /tmp/settingsXX`
DESCR=`mktemp /tmp/descrXX`

FILTEREXP=/^=== Use 'make config'/d;s/The following configuration options are 
available for//;s/^ *//
for port in `pkg info -ao | awk '{print $2;}' | sort`; do
  if [ -d ${PORTSDIR}/${port} ]; then
(cd ${PORTSDIR}/${port}   \
 make PORT_DBDIR=${EMPTYPORTDIR} showconfig |   \
 sed -e ${FILTEREXP}  ${OPTIONDEFAULTS})
(cd ${PORTSDIR}/${port}   \
 make showconfig |  \
 sed -e ${FILTEREXP}  ${OPTIONSETTINGS})
  fi
done
FILTEREXP2='s/^===.*/
/;s/^([^[:space:]]+=[^[:space:]]*):[[:space:]].*/\1
/;s/().*/\1/'
sed -E -e ${FILTEREXP2}  ${OPTIONDEFAULTS}  ${DEFAULTS}
sed -E -e ${FILTEREXP2}  ${OPTIONSETTINGS}  ${SETTINGS}
sed -E -e 's/^[^[:space:]]+=[^[:space:]]+:[[:space:]]*//'  ${OPTIONDEFAULTS}  
${DESCR}
echo Default   Current Setting
paste ${DEFAULTS} ${SETTINGS} ${DESCR} | awk '{if ($1 != $2) print $0;}'
rmdir ${EMPTYPORTDBDIR}
rm ${OPTIONDEFAULTS}
rm ${OPTIONSETTINGS}
rm ${DEFAULTS}
rm ${SETTINGS}
rm ${DESCR}

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


auditing port options and following default option value changes

2014-08-27 Thread Don Lewis
I'm pretty much ready to throw in the towel on upgrading ports in place
with portupgrade and I'm planning on switching to poudriere.  As part of
this conversion, I'd like to figure out what ports have non-default
options and which options are set to non-default values.  Then I can
figure out whether I want to set each option back to default or
propagate the non-default value to poudriere.

Also, since the option files for each port contain the values for all
the options, if I have a port with one non-default option value set, how
can I follow updates to the default values of the other options?

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: auditing port options and following default option value changes

2014-08-27 Thread Adam McDougall
On 08/27/2014 21:12, Don Lewis wrote:
 I'm pretty much ready to throw in the towel on upgrading ports in place
 with portupgrade and I'm planning on switching to poudriere.  As part of
 this conversion, I'd like to figure out what ports have non-default
 options and which options are set to non-default values.  Then I can
 figure out whether I want to set each option back to default or
 propagate the non-default value to poudriere.
 
 Also, since the option files for each port contain the values for all
 the options, if I have a port with one non-default option value set, how
 can I follow updates to the default values of the other options?

This may help:
http://docs.freebsd.org/cgi/mid.cgi?53FDE021.5030108

I have not abandoned all my options files yet, I've eliminated some over
time as I switch to defining options in make.conf.  I'll probably get
burned some day and finish it off.
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org