From 66be1c780cb9e7e166fadb9586a8c06d73f13bc6 Mon Sep 17 00:00:00 2001 From: Alex Dupre Date: Wed, 6 Sep 2006 12:50:31 +0000 Subject: Add explicit support for comments and empty lines in ports.conf. PR: ports/102914 Submitted by: Hans Lambermont --- ports-mgmt/portconf/Makefile | 2 +- ports-mgmt/portconf/files/pkg-message.in | 2 ++ ports-mgmt/portconf/files/portconf.sh.in | 5 +---- 3 files changed, 4 insertions(+), 5 deletions(-) (limited to 'ports-mgmt/portconf') diff --git a/ports-mgmt/portconf/Makefile b/ports-mgmt/portconf/Makefile index 7fe720d2cff9..2ef7a2244422 100644 --- a/ports-mgmt/portconf/Makefile +++ b/ports-mgmt/portconf/Makefile @@ -8,7 +8,7 @@ # PORTNAME= portconf -PORTVERSION= 1.1 +PORTVERSION= 1.2 CATEGORIES= sysutils MASTER_SITES= # none DISTFILES= # none diff --git a/ports-mgmt/portconf/files/pkg-message.in b/ports-mgmt/portconf/files/pkg-message.in index 3858fba21893..859391f9f049 100644 --- a/ports-mgmt/portconf/files/pkg-message.in +++ b/ports-mgmt/portconf/files/pkg-message.in @@ -5,6 +5,7 @@ To set port-specific make variables, create the with the following syntax: --------------------------------------------------------- +# this is a comment editors/openoffice*: WITH_CCACHE|LOCALIZED_LANG=it www/firefox-i18n: WITHOUT_SWITCHER | FIREFOX_I18N=fr it x11/fakeport: CONFIGURE_ARGS=--with-modules="aaa bbb ccc" @@ -13,5 +14,6 @@ x11/fakeport: CONFIGURE_ARGS=--with-modules="aaa bbb ccc" Global port directory patterns and blanks around the pipe "|" symbol are allowed. Values shouldn't be quoted even if they contain spaces. +Lines beginning with a '#' are comments. ********************************************************* diff --git a/ports-mgmt/portconf/files/portconf.sh.in b/ports-mgmt/portconf/files/portconf.sh.in index 7f71512b76d2..7ac900d3c823 100644 --- a/ports-mgmt/portconf/files/portconf.sh.in +++ b/ports-mgmt/portconf/files/portconf.sh.in @@ -33,10 +33,7 @@ if [ ! -r "${_conf}" ]; then exit fi _pwd=`pwd` -cat "${_conf}" | while read _line; do - if [ -z "${_line}" ]; then - continue - fi +sed '/^#/d;/^[[:space:]]*$/d' "${_conf}" | while read _line; do _port=${_line%%:*} if [ "${_pwd%%${_port}}" != "${_pwd}" ]; then echo ${_line#*:} | sed -E 's/([A-Z0-9_]+)(=([^|]+))?/\1=\3/g;s/ *\| */|/g;s/ /%/g' -- cgit v1.2.3