diff options
author | roam <roam@FreeBSD.org> | 2009-03-18 19:12:04 +0800 |
---|---|---|
committer | roam <roam@FreeBSD.org> | 2009-03-18 19:12:04 +0800 |
commit | 72fd40a643084cdcf84c98d8a8bb2ffa52692338 (patch) | |
tree | f77ea7d0855c56ae9495f90aee584a44e059f15e /textproc/confget | |
parent | 0f638a745b0fbadb99a2950fb1c8eab3a57d9791 (diff) | |
download | freebsd-ports-gnome-72fd40a643084cdcf84c98d8a8bb2ffa52692338.tar.gz freebsd-ports-gnome-72fd40a643084cdcf84c98d8a8bb2ffa52692338.tar.zst freebsd-ports-gnome-72fd40a643084cdcf84c98d8a8bb2ffa52692338.zip |
Add a port of confget-1.01, a simple tool to read variables from
configuration files and display their values in a way suitable for
use in shell scripts.
Diffstat (limited to 'textproc/confget')
-rw-r--r-- | textproc/confget/Makefile | 38 | ||||
-rw-r--r-- | textproc/confget/distinfo | 3 | ||||
-rw-r--r-- | textproc/confget/files/patch-t--09-regexp.t | 20 | ||||
-rw-r--r-- | textproc/confget/pkg-descr | 14 |
4 files changed, 75 insertions, 0 deletions
diff --git a/textproc/confget/Makefile b/textproc/confget/Makefile new file mode 100644 index 000000000000..7770f13bae65 --- /dev/null +++ b/textproc/confget/Makefile @@ -0,0 +1,38 @@ +# New ports collection makefile for: confget +# Date created: 18 March 2009 +# Whom: Peter Pentchev <roam@FreeBSD.org> +# +# $FreeBSD$ +# + +PORTNAME= confget +PORTVERSION= 1.01 +CATEGORIES= textproc +MASTER_SITES= http://devel.ringlet.net/textproc/confget/ + +MAINTAINER= roam@FreeBSD.org +COMMENT= Read variables from INI-style configuration files + +OPTIONS= PCRE "Regular expression support" on + +.include <bsd.port.pre.mk> + +.if defined(WITH_PCRE) +LIB_DEPENDS= pcre.0:${PORTSDIR}/devel/pcre +.else +MAKE_ENV+= PCRE_CFLAGS= PCRE_LIBS= +.endif + +USE_GMAKE= yes + +MAKE_ENV+= CFLAGS_CONF=-DHAVE_FGETLN + +MAN1= confget.1 +MANCOMPRESSED= yes + +PLIST_FILES= bin/confget + +test: build + cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} test + +.include <bsd.port.post.mk> diff --git a/textproc/confget/distinfo b/textproc/confget/distinfo new file mode 100644 index 000000000000..f0413db6e1a1 --- /dev/null +++ b/textproc/confget/distinfo @@ -0,0 +1,3 @@ +MD5 (confget-1.01.tar.gz) = a9ade693ef1a8a9d781fca4aebd86fee +SHA256 (confget-1.01.tar.gz) = e3bb7f836cc07dd377f197dcd4e808cb8bfb5382a9e9b2e48f83e6afde0888c7 +SIZE (confget-1.01.tar.gz) = 14211 diff --git a/textproc/confget/files/patch-t--09-regexp.t b/textproc/confget/files/patch-t--09-regexp.t new file mode 100644 index 000000000000..13b9f69cc4da --- /dev/null +++ b/textproc/confget/files/patch-t--09-regexp.t @@ -0,0 +1,20 @@ +Do not fail the regexp tests if confget was compiled without regexp support. +This patch has already been applied to the confget upstream Subversion repo. + +--- t/09-regexp.t.orig ++++ t/09-regexp.t +@@ -38,6 +38,14 @@ + exit 255 + fi + ++v=`$CONFGET -f "$T1" -s a -x key1 2>&1` ++if [ "$v" = 'confget: No regular expression support in this confget build' ]; then ++ for i in 1 2 3 4 5 6 7 8; do ++ echo "ok $i # skip No regular expression support in confget" ++ done ++ exit 0 ++fi ++ + unset cfg_key1 cfg_key2 cfg_key3 cfg_key6 + eval `$CONFGET -f "$T1" -S -p cfg_ -s a -L -x 'key[23]'` + if [ "$cfg_key1" = '' ]; then echo 'ok 1'; else echo "not ok 1 cfg_key1 is '$cfg_key1'"; fi diff --git a/textproc/confget/pkg-descr b/textproc/confget/pkg-descr new file mode 100644 index 000000000000..be55ee3a813d --- /dev/null +++ b/textproc/confget/pkg-descr @@ -0,0 +1,14 @@ +The confget utility examines a INI-style configuration file and retrieves +the value of the specified variables from the specified section. +Its intended use is to let shell scripts use the same INI-style +configuration files as other programs, to avoid duplication of data. + +The confget utility may retrieve the values of one or more variables, +list all the variables in a specified section, list only those whose names +or values match a specified pattern (shell glob or regular expression), or +check if a variable is present in the file at all. It has a "shell-quoting" +output mode that quotes the variable values in a way suitable for passing +them directly to a Bourne-style shell. + +WWW: http://devel.ringlet.net/textproc/confget/ +Author: Peter Pentchev <roam@ringlet.net> |