1 |
commit: face8293c75d9c7b837e11f67f90d657b167efc4 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jul 16 15:30:30 2021 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jul 16 15:30:30 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/gentoo-syntax.git/commit/?id=face8293 |
7 |
|
8 |
newebuild: Improve eclass boilerplate |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
plugin/newebuild.vim | 11 +++++++++++ |
13 |
1 file changed, 11 insertions(+) |
14 |
|
15 |
diff --git a/plugin/newebuild.vim b/plugin/newebuild.vim |
16 |
index 7c5f46a..756b7f9 100644 |
17 |
--- a/plugin/newebuild.vim |
18 |
+++ b/plugin/newebuild.vim |
19 |
@@ -44,9 +44,20 @@ fun! <SID>MakeNewEbuild() |
20 |
put ='# ' . GentooGetUser() |
21 |
put ='# @AUTHOR:' |
22 |
put ='# ' . GentooGetUser() |
23 |
+ put ='# @SUPPORTED_EAPIS: 8' |
24 |
put ='# @BLURB: ' |
25 |
put ='# @DESCRIPTION:' |
26 |
put ='' |
27 |
+ let l:eclass_ident = substitute(toupper(l:eclass), "[^A-Z0-9]", "_", "g") |
28 |
+ put ='if [[ ! ${_' . l:eclass_ident . '} ]]; then' |
29 |
+ put ='' |
30 |
+ put ='case ${EAPI} in' |
31 |
+ put =' 8) ;;' |
32 |
+ put =' *) die \"EAPI ${EAPI} unsupported.\"' |
33 |
+ put ='esac' |
34 |
+ put ='' |
35 |
+ put ='_' . l:eclass_ident . '=1' |
36 |
+ put ='fi' |
37 |
" }}} |
38 |
|
39 |
" {{{ go to the first thing to edit |