Bug 165419 - [patch] Mk/bsd.port.mk: "make showconfig" to tell whether option values are same as the default
Summary: [patch] Mk/bsd.port.mk: "make showconfig" to tell whether option values are s...
Status: Closed Feedback Timeout
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Port Management Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-23 12:40 UTC by hiroto.kagotani
Modified: 2016-04-13 15:04 UTC (History)
0 users

See Also:


Attachments
file.diff (548 bytes, patch)
2012-02-23 12:40 UTC, hiroto.kagotani
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description hiroto.kagotani 2012-02-23 12:40:08 UTC
I sometimes want to identify installed packages whose option values are different from the default.  Though "make showconfig" and "make config" show the current option values, they don't tell which are same as or different from the default.  Instead, I need to compare values with the value of OPTION variable in Makefile.

My idea is to make "make showconfig" tell whether option values are same as the default.  The patch attached implements the idea.

Using this, I can easily find packages with non-default option values like this:
% make showconfig-recursive | grep -v 'same as default'

Fix: Patch attached with submission follows:
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2012-02-23 16:03:38 UTC
Responsible Changed
From-To: freebsd-bugs->portmgr

make this a ports PR and assign.
Comment 2 Baptiste Daroussin freebsd_committer freebsd_triage 2012-06-05 17:33:31 UTC
This will need a new patch as option framework as changed and is
slightly different thus this a desired feature.

regards,
Bapt
Comment 3 Bryan Drewery freebsd_committer freebsd_triage 2013-03-09 23:43:17 UTC
Here's a mockup.

http://people.freebsd.org/~bdrewery/bpm-show-default-options-in-showconfig.txt

> - (~/freebsd/ports/ports-mgmt/tinderbox) $ make showconfig
> ===> The following configuration options are available for tinderbox-4.0.0:
>  (default)  CHECK_ROOT=on: Check if ./tc is run by uid 0
>  (default)  EMAILS=on: Support for build failure/completion emails
>  (default)  LOG_COMPRESS=on: Support bzip'ing the logs
>             LSOF=off: For killMountProcesses() when using nullfs
> ====> Options available for the multi DB: you have to choose at least one of them
>             PGSQL=off: PostgreSQL database
>  (default)  MYSQL=on: MySQL database
>             SQLITE=off: SQLite database
> ====> Options available for the radio WEB: you can only select none or one of them
>  (default)  APACHE=on: Apache server
>             HIAWATHA=off: Hiawatha server
>             LIGHTTPD=off: Lighttpd server
>             NGINX=off: Nginx server
> ===> Use 'make config' to modify these settings


Note that LSOF here is OFF but it is ON by default. Since it doesn't
match it doesn't show (default).

Maybe it should just show a '*' and a note at the bottom that * means it
matches the default?

Regards,
Bryan Drewery
Comment 4 Bryan Drewery freebsd_committer freebsd_triage 2013-03-09 23:49:38 UTC
Another mockup with a *:

http://people.freebsd.org/~bdrewery/bpm-show-default-options-in-showconfig-star.txt

> - (~/freebsd/ports/ports-mgmt/tinderbox) $ make showconfig
> ===> The following configuration options are available for tinderbox-4.0.0:
>  (*)  CHECK_ROOT=on: Check if ./tc is run by uid 0
>  (*)  EMAILS=on: Support for build failure/completion emails
>  (*)  LOG_COMPRESS=on: Support bzip'ing the logs
>       LSOF=off: For killMountProcesses() when using nullfs
> ====> Options available for the multi DB: you have to choose at least one of them
>       PGSQL=off: PostgreSQL database
>  (*)  MYSQL=on: MySQL database
>       SQLITE=off: SQLite database
> ====> Options available for the radio WEB: you can only select none or one of them
>  (*)  APACHE=on: Apache server
>       HIAWATHA=off: Hiawatha server
>       LIGHTTPD=off: Lighttpd server
>       NGINX=off: Nginx server
> ===> * = The selected value matches the default
> ===> Use 'make config' to modify these settings

Regards,
Bryan
Comment 5 Baptiste Daroussin freebsd_committer freebsd_triage 2013-03-09 23:52:13 UTC
On Sat, Mar 09, 2013 at 05:43:17PM -0600, Bryan Drewery wrote:
> Here's a mockup.
> 
> http://people.freebsd.org/~bdrewery/bpm-show-default-options-in-showconfig.txt
> 
> > - (~/freebsd/ports/ports-mgmt/tinderbox) $ make showconfig
> > ===> The following configuration options are available for tinderbox-4.0.0:
> >  (default)  CHECK_ROOT=on: Check if ./tc is run by uid 0
> >  (default)  EMAILS=on: Support for build failure/completion emails
> >  (default)  LOG_COMPRESS=on: Support bzip'ing the logs
> >             LSOF=off: For killMountProcesses() when using nullfs
> > ====> Options available for the multi DB: you have to choose at least one of them
> >             PGSQL=off: PostgreSQL database
> >  (default)  MYSQL=on: MySQL database
> >             SQLITE=off: SQLite database
> > ====> Options available for the radio WEB: you can only select none or one of them
> >  (default)  APACHE=on: Apache server
> >             HIAWATHA=off: Hiawatha server
> >             LIGHTTPD=off: Lighttpd server
> >             NGINX=off: Nginx server
> > ===> Use 'make config' to modify these settings
> 
> 
> Note that LSOF here is OFF but it is ON by default. Since it doesn't
> match it doesn't show (default).
> 
> Maybe it should just show a '*' and a note at the bottom that * means it
> matches the default?


I like this one with (default) because explicit, you can keep the '*' for the
pretty-print :)

regards,
Bapt
Comment 6 Baptiste Daroussin freebsd_committer freebsd_triage 2013-03-09 23:54:44 UTC
On Sat, Mar 09, 2013 at 05:43:17PM -0600, Bryan Drewery wrote:
> Here's a mockup.
> 
> http://people.freebsd.org/~bdrewery/bpm-show-default-options-in-showconfig.txt
> 
> > - (~/freebsd/ports/ports-mgmt/tinderbox) $ make showconfig
> > ===> The following configuration options are available for tinderbox-4.0.0:
> >  (default)  CHECK_ROOT=on: Check if ./tc is run by uid 0
> >  (default)  EMAILS=on: Support for build failure/completion emails
> >  (default)  LOG_COMPRESS=on: Support bzip'ing the logs
> >             LSOF=off: For killMountProcesses() when using nullfs
> > ====> Options available for the multi DB: you have to choose at least one of them
> >             PGSQL=off: PostgreSQL database
> >  (default)  MYSQL=on: MySQL database
> >             SQLITE=off: SQLite database
> > ====> Options available for the radio WEB: you can only select none or one of them
> >  (default)  APACHE=on: Apache server
> >             HIAWATHA=off: Hiawatha server
> >             LIGHTTPD=off: Lighttpd server
> >             NGINX=off: Nginx server
> > ===> Use 'make config' to modify these settings
> 
> 
> Note that LSOF here is OFF but it is ON by default. Since it doesn't
> match it doesn't show (default).
> 
> Maybe it should just show a '*' and a note at the bottom that * means it
> matches the default?
> 
> Regards,
> Bryan Drewery
> 


Approved with (default), please commit

regards,
Bapt
Comment 7 Bryan Drewery freebsd_committer freebsd_triage 2013-03-10 01:45:19 UTC
As we discussed privately, my patch was wrong. I had used
OPTIONS_DEFAULT, but had trouble with DOCS/EXAMPLES/NLS/IPV6 and ended
up incorrectly using PORT_OPTIONS. I've changed bsd.options.mk to
support ALL_OPTIONS_DEFAULT which includes these.

This now then compares the default value to the set value.

http://people.freebsd.org/~bdrewery/bpm-show-default-options-in-showconfig-all-defaults.txt


> - (~/freebsd/ports/Mk) $ make -C ../ports-mgmt/tinderbox showconfig
> ===> The following configuration options are available for tinderbox-4.0.0:
>  (default)  CHECK_ROOT=on: Check if ./tc is run by uid 0
>  (default)  EMAILS=on: Support for build failure/completion emails
>  (default)  LOG_COMPRESS=on: Support bzip'ing the logs
>  (default)  LSOF=off: For killMountProcesses() when using nullfs
> ====> Options available for the multi DB: you have to choose at least one of them
>  (default)  PGSQL=off: PostgreSQL database
>  (default)  MYSQL=on: MySQL database
>  (default)  SQLITE=off: SQLite database
> ====> Options available for the radio WEB: you can only select none or one of them
>  (default)  APACHE=on: Apache server
>  (default)  HIAWATHA=off: Hiawatha server
>  (default)  LIGHTTPD=off: Lighttpd server
>  (default)  NGINX=off: Nginx server
> ===> Use 'make config' to modify these settings

After changing by selecting SQLITE and switching to HIAWATHA:

> - (~/freebsd/ports/Mk) $ make -C ../ports-mgmt/tinderbox showconfig
> ===> The following configuration options are available for tinderbox-4.0.0:
>  (default)  CHECK_ROOT=on: Check if ./tc is run by uid 0
>  (default)  EMAILS=on: Support for build failure/completion emails
>  (default)  LOG_COMPRESS=on: Support bzip'ing the logs
>  (default)  LSOF=off: For killMountProcesses() when using nullfs
> ====> Options available for the multi DB: you have to choose at least one of them
>  (default)  PGSQL=off: PostgreSQL database
>  (default)  MYSQL=on: MySQL database
>             SQLITE=on: SQLite database
> ====> Options available for the radio WEB: you can only select none or one of them
>             APACHE=off: Apache server
>             HIAWATHA=on: Hiawatha server
>  (default)  LIGHTTPD=off: Lighttpd server
>  (default)  NGINX=off: Nginx server
> ===> Use 'make config' to modify these settings


It looks weird on the groups but does make sense IMHO.


Bryan
Comment 8 Mark Linimon freebsd_committer freebsd_triage 2014-06-02 02:52:49 UTC
Infrastructure PR.
Comment 9 Mathieu Arnold freebsd_committer freebsd_triage 2015-06-13 02:25:13 UTC
That last one looks fine, please commit :-)