Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Feb 2012 12:32:32 GMT
From:      Hiroto Kagotani <hiroto.kagotani@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/165419: Mk/bsd.port.mk: "make showconfig" to tell whether option values are same as the default
Message-ID:  <201202231232.q1NCWWqR044804@red.freebsd.org>
Resent-Message-ID: <201202231240.q1NCe8rb095246@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         165419
>Category:       misc
>Synopsis:       Mk/bsd.port.mk: "make showconfig" to tell whether option values are same as the default
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 23 12:40:08 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Hiroto Kagotani
>Release:        FreeBSD 8.1-RELEASE
>Organization:
>Environment:
FreeBSD myhost.mydomain 8.1-RELEASE-p5 FreeBSD 8.1-RELEASE-p5 #0: Tue Sep 27 16:18:26 UTC 2011     root@i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
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'
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

--- /usr/ports/Mk/bsd.port.mk.orig	2012-02-02 17:36:41.000000000 +0900
+++ /usr/ports/Mk/bsd.port.mk	2012-02-23 21:21:43.000000000 +0900
@@ -6093,8 +6093,10 @@
 		withoutval=$$(eval ${ECHO_CMD} $$\{$${withoutvar}\}); \
 		if [ ! -z "$${withval}" ]; then \
 			val=on; \
+			case "$${defaultval}" in on|ON|On) val="$${val} (same as default)";; esac; \
 		elif [ ! -z "$${withoutval}" ]; then \
 			val=off; \
+			case "$${defaultval}" in off|OFF|Off) val="$${val} (same as default)";; esac; \
 		else \
 			val="$${defaultval} (default)"; \
 		fi; \


>Release-Note:
>Audit-Trail:
>Unformatted:



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