Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 May 2013 01:27:23 GMT
From:      "John W. O'Brien" <john@saltant.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/178762: [patch] Mk/bsd.port.mk: Store options alphabetically
Message-ID:  <201305190127.r4J1RN0w029052@oldred.FreeBSD.org>
Resent-Message-ID: <201305190130.r4J1U24D063927@freefall.freebsd.org>

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

>Number:         178762
>Category:       ports
>Synopsis:       [patch] Mk/bsd.port.mk: Store options alphabetically
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 19 01:30:02 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     John W. O'Brien
>Release:        9.1-STABLE
>Organization:
Saltant Solutions
>Environment:
FreeBSD XXXX.saltant.net 9.1-STABLE FreeBSD 9.1-STABLE #0 r248078: Fri Mar  8 20:36:00 EST 2013     root@XXXX.saltant.net:/usr/obj/usr/src/sys/NIPPL  amd64

>Description:
I keep /var/db/ports (or at least the options file therein) under revision control. After any update to ports when I am prompted to select or update options, I rsync the stored options into the repo and commit any changes along with reminders to my future self if I went with the maintainer's defaults or not, and sometimes why.

The problem is that the order in which options are written to OPTIONSFILE is dependent on things that don't matter to the configuration management task, like (I guess) the order in which the maintainer wants options to appear in the config dialog. This often introduces superfluous diffs, which I would like to prevent.
>How-To-Repeat:
Go look at /var/db/ports/*/options right now. Are the lines in alphabetical order by option? It depends. net/wireshark, x11/xorg-apps, ftp/wget, and devel/gvfs are likely candidates.
>Fix:
The attached patch teaches bsd.port.mk to use the ":O" variable expansion modifier when writing TMPOPTIONSFILE.

Patch attached with submission follows:

Index: Mk/bsd.port.mk
===================================================================
--- Mk/bsd.port.mk	(revision 318467)
+++ Mk/bsd.port.mk	(working copy)
@@ -6129,8 +6129,8 @@
 	${ECHO_CMD} "# This file is auto-generated by 'make config'." > $${TMPOPTIONSFILE}; \
 	${ECHO_CMD} "# Options for ${PKGNAME}" >> $${TMPOPTIONSFILE}; \
 	${ECHO_CMD} "_OPTIONS_READ=${PKGNAME}" >> $${TMPOPTIONSFILE}; \
-	${ECHO_CMD} "_FILE_COMPLETE_OPTIONS_LIST=${COMPLETE_OPTIONS_LIST}" >> $${TMPOPTIONSFILE}; \
-	for i in ${COMPLETE_OPTIONS_LIST}; do \
+	${ECHO_CMD} "_FILE_COMPLETE_OPTIONS_LIST=${COMPLETE_OPTIONS_LIST:O}" >> $${TMPOPTIONSFILE}; \
+	for i in ${COMPLETE_OPTIONS_LIST:O}; do \
 		if ${ECHO_CMD} $${SELOPTIONS} | ${GREP} -qw $${i}; then \
 			${ECHO_CMD} "OPTIONS_FILE_SET+=$${i}" >> $${TMPOPTIONSFILE}; \
 		else \


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



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