summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authordillo <dillo>2005-05-31 11:05:31 +0000
committerdillo <dillo>2005-05-31 11:05:31 +0000
commitada14f2061774a6a0d075d3a94c7343768798033 (patch)
tree93fb1405b5ed4f1565c3a391342533d007a58bc8 /regress
parentd7009cc4fa1ec488a4b08ed966ac47dd55dfa3b2 (diff)
downloadpkgsrc-ada14f2061774a6a0d075d3a94c7343768798033.tar.gz
To ease cleanup of the options namespace, add code to support legacy
option names: PKG_OPTIONS_LEGACY_OPTS+= old:new If PKG_DEFAULT_OPTIONS or PKG_OPTIONS.foo contains option old (or -old) it is rewritten to new (or -new) and a warning is issued by the supported-options-message target.
Diffstat (limited to 'regress')
-rw-r--r--regress/pkg-options/Makefile4
-rw-r--r--regress/pkg-options/files/legacy-opt.mk17
-rw-r--r--regress/pkg-options/files/legacy-opt.out1
3 files changed, 20 insertions, 2 deletions
diff --git a/regress/pkg-options/Makefile b/regress/pkg-options/Makefile
index 539411f1702..127874567b8 100644
--- a/regress/pkg-options/Makefile
+++ b/regress/pkg-options/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2005/05/28 12:16:43 dillo Exp $
+# $NetBSD: Makefile,v 1.4 2005/05/31 11:05:31 dillo Exp $
#
DISTNAME= regress-pkg-options-1.0
@@ -8,7 +8,7 @@ DISTFILES= # empty
MAINTAINER= rillig@NetBSD.org
COMMENT= Test bsd.options.mk framework
-REGRESS_TESTS= all order simple unsupported
+REGRESS_TESTS= all legacy-opt order simple unsupported
do-test:
.for t in ${REGRESS_TESTS}
diff --git a/regress/pkg-options/files/legacy-opt.mk b/regress/pkg-options/files/legacy-opt.mk
new file mode 100644
index 00000000000..47c8c9218b7
--- /dev/null
+++ b/regress/pkg-options/files/legacy-opt.mk
@@ -0,0 +1,17 @@
+# $NetBSD: legacy-opt.mk,v 1.1 2005/05/31 11:05:31 dillo Exp $
+#
+# This file test a very simple options configuration.
+#
+
+MAKECONF= /dev/null
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.foo
+PKG_SUPPORTED_OPTIONS= new
+PKG_OPTIONS_LEGACY_OPTS+= old:new
+PKG_OPTIONS.foo= old
+
+.include "../../mk/bsd.options.mk"
+
+.PHONY: test
+test:
+ echo ${PKG_OPTIONS:M*:Q}
diff --git a/regress/pkg-options/files/legacy-opt.out b/regress/pkg-options/files/legacy-opt.out
new file mode 100644
index 00000000000..3e757656cf3
--- /dev/null
+++ b/regress/pkg-options/files/legacy-opt.out
@@ -0,0 +1 @@
+new