From owner-freebsd-ports@FreeBSD.ORG Fri Aug 29 01:10:13 2014 Return-Path: Delivered-To: freebsd-ports@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 72983E5B for ; Fri, 29 Aug 2014 01:10:13 +0000 (UTC) Received: from gw.catspoiler.org (cl-1657.chi-02.us.sixxs.net [IPv6:2001:4978:f:678::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F27051C02 for ; Fri, 29 Aug 2014 01:10:12 +0000 (UTC) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id s7T1A51a069681 for ; Thu, 28 Aug 2014 18:10:09 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201408290110.s7T1A51a069681@gw.catspoiler.org> Date: Thu, 28 Aug 2014 18:10:05 -0700 (PDT) From: Don Lewis Subject: Re: auditing port options and following default option value changes To: freebsd-ports@FreeBSD.org MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Aug 2014 01:10:13 -0000 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: #!/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}