From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1303150-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 47B10139345
	for <garchives@archives.gentoo.org>; Fri, 16 Jul 2021 15:30:43 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 6A3FBE0A5E;
	Fri, 16 Jul 2021 15:30:42 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 53C95E0A5E
	for <gentoo-commits@lists.gentoo.org>; Fri, 16 Jul 2021 15:30:42 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 289F8342B95
	for <gentoo-commits@lists.gentoo.org>; Fri, 16 Jul 2021 15:30:41 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 5DE657D4
	for <gentoo-commits@lists.gentoo.org>; Fri, 16 Jul 2021 15:30:39 +0000 (UTC)
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" <mgorny@gentoo.org>
Message-ID: <1626449430.face8293c75d9c7b837e11f67f90d657b167efc4.mgorny@gentoo>
Subject: [gentoo-commits] proj/gentoo-syntax:master commit in: plugin/
X-VCS-Repository: proj/gentoo-syntax
X-VCS-Files: plugin/newebuild.vim
X-VCS-Directories: plugin/
X-VCS-Committer: mgorny
X-VCS-Committer-Name: Michał Górny
X-VCS-Revision: face8293c75d9c7b837e11f67f90d657b167efc4
X-VCS-Branch: master
Date: Fri, 16 Jul 2021 15:30:39 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 72818dea-63f0-47de-83db-68a71350a129
X-Archives-Hash: 300f507bb8ff5ac4353116dea6a36a7a

commit:     face8293c75d9c7b837e11f67f90d657b167efc4
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 16 15:30:30 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jul 16 15:30:30 2021 +0000
URL:        https://gitweb.gentoo.org/proj/gentoo-syntax.git/commit/?id=face8293

newebuild: Improve eclass boilerplate

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 plugin/newebuild.vim | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/plugin/newebuild.vim b/plugin/newebuild.vim
index 7c5f46a..756b7f9 100644
--- a/plugin/newebuild.vim
+++ b/plugin/newebuild.vim
@@ -44,9 +44,20 @@ fun! <SID>MakeNewEbuild()
         put ='# ' . GentooGetUser()
         put ='# @AUTHOR:'
         put ='# ' . GentooGetUser()
+        put ='# @SUPPORTED_EAPIS: 8'
         put ='# @BLURB: '
         put ='# @DESCRIPTION:'
         put =''
+        let l:eclass_ident = substitute(toupper(l:eclass), "[^A-Z0-9]", "_", "g")
+        put ='if [[ ! ${_' . l:eclass_ident . '} ]]; then'
+        put =''
+        put ='case ${EAPI} in'
+        put ='	8) ;;'
+        put ='	*) die \"EAPI ${EAPI} unsupported.\"'
+        put ='esac'
+        put =''
+        put ='_' . l:eclass_ident . '=1'
+        put ='fi'
         " }}}
 
         " {{{ go to the first thing to edit