Date: Thu, 28 Aug 2014 18:10:05 -0700 (PDT) From: Don Lewis <truckman@FreeBSD.org> To: freebsd-ports@FreeBSD.org Subject: Re: auditing port options and following default option value changes Message-ID: <201408290110.s7T1A51a069681@gw.catspoiler.org>
next in thread | raw e-mail | index | archive | help
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/emptyXXXXXXX` OPTIONDEFAULTS=`mktemp /tmp/optiondefaultsXXXXXX` OPTIONSETTINGS=`mktemp /tmp/optionsettingsXXXXXX` DEFAULTS=`mktemp /tmp/defaultsXXXXXX` SETTINGS=`mktemp /tmp/settingsXXXXXX` DESCR=`mktemp /tmp/descrXXXXXX` 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}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408290110.s7T1A51a069681>