Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gentoo-syntax:master commit in: plugin/
Date: Sat, 17 Aug 2019 06:53:00
Message-Id: 1566024752.50323c29c07bb23db971ce34846c607ddd440fe3.mgorny@gentoo
1 commit: 50323c29c07bb23db971ce34846c607ddd440fe3
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sat Aug 17 06:52:32 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sat Aug 17 06:52:32 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/gentoo-syntax.git/commit/?id=50323c29
7
8 newebuild: Support acct-{group,user} categories
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 plugin/newebuild.vim | 24 +++++++++++++++++++++---
13 1 file changed, 21 insertions(+), 3 deletions(-)
14
15 diff --git a/plugin/newebuild.vim b/plugin/newebuild.vim
16 index dd195ee..26d5a9f 100644
17 --- a/plugin/newebuild.vim
18 +++ b/plugin/newebuild.vim
19 @@ -58,7 +58,25 @@ fun! <SID>MakeNewEbuild()
20 else
21 put ='EAPI=7'
22 put =''
23 - if l:category ==# "app-vim"
24 + if l:category ==# "acct-group"
25 + " {{{ acct-group special setup
26 + put ='inherit acct-group'
27 + put =''
28 + put ='ACCT_GROUP_ID='
29 + " }}}
30 + elseif l:category ==# "acct-user"
31 + " {{{ acct-user special setup
32 + let l:username=substitute(expand("%:t:r"),
33 + \ "\\(.*\\)-[0-9]*.*", "\\1", "")
34 + put ='inherit acct-user'
35 + put =''
36 + put ='DESCRIPTION=\"\"'
37 + put ='ACCT_USER_ID='
38 + put ='ACCT_USER_GROUPS=( ' . l:username . ' )'
39 + put =''
40 + put ='acct-user_add_deps'
41 + " }}}
42 + elseif l:category ==# "app-vim"
43 " {{{ app-vim special setup
44 put ='#VIM_PLUGIN_VIM_VERSION=\"7.0\"'
45 put ='inherit vim-plugin'
46 @@ -159,8 +177,8 @@ fun! <SID>MakeNewEbuild()
47
48 " {{{ go to the first thing to edit
49 0
50 - /^\(DIST_AUTHOR\|DESCRIPTION\)=/
51 - exec "normal 2f\""
52 + /^\(ACCT_GROUP_ID\|DIST_AUTHOR\|DESCRIPTION\)=/
53 + exec "normal f=ll"
54 nohls
55 " }}}
56 endif