Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: vapier@g.o, tools-portage@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH] app-portage/eclass-manpages: @DEFAULT_UNSET -> @DEFAULT-UNSET
Date: Fri, 28 Apr 2017 14:40:05
Message-Id: 20170428143945.16032-1-mgorny@gentoo.org
1 Change the unset value tag to '@DEFAULT-UNSET' to ensure consistent use
2 of hyphen/underscore throughout eclassdoc. Before, one tag
3 (@ECLASS-VARIABLE) has used hyphen while also one (@DEFAULT_UNSET) used
4 underscore. Unify them to use the former since @ECLASS-VARIABLE tag is
5 more common (and hyphens do not require holding shift).
6
7 Fixing all existing uses is perfectly within our power; however, I think
8 it would be reasonable to delay it and combine with other eclass changes
9 to avoid unnecessary cache regen. The script still allows the old tag
10 name for compatibility.
11 ---
12 app-portage/eclass-manpages/files/eclass-to-manpage.awk | 11 +++++++----
13 1 file changed, 7 insertions(+), 4 deletions(-)
14
15 diff --git a/app-portage/eclass-manpages/files/eclass-to-manpage.awk b/app-portage/eclass-manpages/files/eclass-to-manpage.awk
16 index 0b65162c04ec..8ff9f71a2022 100644
17 --- a/app-portage/eclass-manpages/files/eclass-to-manpage.awk
18 +++ b/app-portage/eclass-manpages/files/eclass-to-manpage.awk
19 @@ -36,7 +36,7 @@
20
21 # The format of function-specific variables:
22 # @VARIABLE: foo
23 -# [@DEFAULT_UNSET]
24 +# [@DEFAULT-UNSET]
25 # [@INTERNAL]
26 # [@REQUIRED]
27 # @DESCRIPTION:
28 @@ -45,7 +45,7 @@
29
30 # The format of eclass variables:
31 # @ECLASS-VARIABLE: foo
32 -# [@DEFAULT_UNSET]
33 +# [@DEFAULT-UNSET]
34 # [@INTERNAL]
35 # [@REQUIRED]
36 # @DESCRIPTION:
37 @@ -284,9 +284,12 @@ function _handle_variable() {
38 opts = 1
39 while (opts) {
40 getline
41 - if ($2 == "@DEFAULT_UNSET")
42 + if ($2 == "@DEFAULT-UNSET")
43 default_unset = 1
44 - else if ($2 == "@INTERNAL")
45 + else if ($2 == "@DEFAULT_UNSET") {
46 + warn(var_name ": use @DEFAULT-UNSET instead of @DEFAULT_UNSET")
47 + default_unset = 1
48 + } else if ($2 == "@INTERNAL")
49 internal = 1
50 else if ($2 == "@REQUIRED")
51 required = 1
52 --
53 2.13.0.rc1

Replies