Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Mar 2014 22:21:27 -0400
From:      Randy Pratt <bsd-unix@embarqmail.com>
To:        "John W. O'Brien" <john@saltant.com>
Cc:        FreeBSD Ports <freebsd-ports@freebsd.org>
Subject:   Re: Discover stored options different from port defaults/defines
Message-ID:  <20140330222127.a9175c2b48147295ee06cb0a@embarqmail.com>
In-Reply-To: <533888EB.2060503@saltant.com>
References:  <533888EB.2060503@saltant.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 30 Mar 2014 17:13:15 -0400
"John W. O'Brien" <john@saltant.com> wrote:

> Hello ports@,
> 
> In the bad old days before poudriere and various improvements to
> OptionsNG came to town, when I was using portmaster* to handle upgrades,
> I cobbled together a configuration management practice that involved
> using rsync and git to store /var/db/ports in a repository. The usual
> workflow looked roughly like this:
> 
>     svn up /usr/ports
>     portmaster -dga
>     # handle changes to OPTIONS_DEFINE and its brethren here
>     rsync -rpt --del --exclude distfiles /var/db/ports/ /path/to/repo
>     cd /path/to/repo
>     git commit -a -m "Store options that changed"
> 
> A downside of this approach is that it couldn't distinguish between
> options I care about ("Always do this" and "Never do this") and options
> I don't care about ("Do what the maintainer thinks is best"). The only
> upstream changes that would bubble to the surface of their own accord
> were NEW_OPTIONS when OPTIONS_DEFINE changed.
> 
> When I switched from portmaster to poudriere+pkgng, I migrated
> /var/db/ports to /usr/local/etc/poudriere.d/$jail-$ports-$set-options
> and that worked OK for a little while. However, this compounded the old
> problem in that now even NEW_OPTIONS would arrive silently.
> 
> The first part of my solution to these problems is to store only the
> options that I know I care about. That is, I know I need to find out
> where a stored option disagrees with the default.
> 
> I couldn't figure out how to use the stock tools to peel apart currently
> stored options from current default options, so I wrote a
> ``nondefaultconfig`` target for Mk/bsd.port.mk (see attached), set all
> the common options (DOCS, IPv6, etc) explicitly in /etc/make.conf using
> OPTIONS_SET/OPTIONS_UNSET, and ran the new target against all of my
> installed ports, replacing a subtree full of options files with a
> single, quite modest make.conf. To make this more generally-useful, it
> would need to behave more like NEW_OPTIONS.
> 
>    cd /usr/ports
>    pkg info -aoq | sort | xargs -n1 make nondefaultconfig -C \
>         >> /usr/local/etc/poudriere.d/$jail-make.conf
>    rm -fr /usr/local/etc/poudriere.d/$jail-$ports-$set-options
> 
> At this point, any option not configured by $jail-make.conf will be
> allowed to vary according to the whims of the maintainer. The next part
> of the problem that I would like to solve is learning about options that
> I don't yet know I care about (OPTIONS_DEFINE gains a member), and
> secondarily to learn when an option is past caring (OPTIONS_DEFINE loses
> a member that I used to care about), so that I can update
> $jail-make.conf in an orderly fashion.
> 
> I welcome any comments on my approach so far, or suggestions about how I
> might proceed.

I found this posting useful to find OPTIONS:

http://docs.freebsd.org/cgi/mid.cgi?CAOjFWZ45ACYnaByYxxrGoyqTOeS7_EDV6MwoH98-GtDe-F3Yug

The mailing list archives seem to be missing for the past month PR187557
so here an excerpt from my notes:

> On 3/4/2014 9:40 AM, Thierry Thomas wrote:
> from within a port's directory,
>
> make showconfig
>
> will show you the current options set and
>
> make __MAKE_CONF=/dev/null PORT_DBDIR=/var/empty showconfig
>
> will show you the defaults.

See make(1)'s -C option for specifying ports pathname.

It shouldn't take too much to write a small script and find
the diff in the output for each command.

HTH,

Randy
  





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140330222127.a9175c2b48147295ee06cb0a>