From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 4C80D59CA3 for ; Sun, 6 Mar 2016 12:01:46 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DB71F21C001 for ; Sun, 6 Mar 2016 12:01:45 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5F688E07DA for ; Sat, 5 Mar 2016 23:35:22 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 52192340B30 for ; Sat, 5 Mar 2016 23:35:21 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D04F72331 for ; Sat, 5 Mar 2016 23:35:17 +0000 (UTC) From: "Tim Harder" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Tim Harder" Message-ID: <1457220669.3c2c6e68310a16b96c058c9fa7e66b3119b88a89.radhermit@gentoo> Subject: [gentoo-commits] proj/gentoo-syntax:master commit in: plugin/ X-VCS-Repository: proj/gentoo-syntax X-VCS-Files: plugin/gentoo-common.vim plugin/newebuild.vim X-VCS-Directories: plugin/ X-VCS-Committer: radhermit X-VCS-Committer-Name: Tim Harder X-VCS-Revision: 3c2c6e68310a16b96c058c9fa7e66b3119b88a89 X-VCS-Branch: master Date: Sat, 5 Mar 2016 23:35:17 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 8564b74f-7bfa-442f-8036-7c9c7d8b0dd8 X-Archives-Hash: cfa5329e6036b0e68f1aab30fd98050f commit: 3c2c6e68310a16b96c058c9fa7e66b3119b88a89 Author: Michał Górny gentoo org> AuthorDate: Wed Jan 27 13:29:47 2016 +0000 Commit: Tim Harder gentoo org> CommitDate: Sat Mar 5 23:31:09 2016 +0000 URL: https://gitweb.gentoo.org/proj/gentoo-syntax.git/commit/?id=3c2c6e68 newebuild: Guess PYTHON_TARGETS from system plugin/gentoo-common.vim | 23 +++++++++++++++++++++++ plugin/newebuild.vim | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/plugin/gentoo-common.vim b/plugin/gentoo-common.vim index 99bc29d..bacecd9 100644 --- a/plugin/gentoo-common.vim +++ b/plugin/gentoo-common.vim @@ -54,4 +54,27 @@ fun! GentooGetArch() endif endfun +fun! GentooGetPythonTargets() + if exists("g:gentoopythontargets") && g:gentoopythontargets != "" + return g:gentoopythontargets + else + let l:py2 = system("eselect python show --python2") + let l:py2 = substitute(l:py2, "\n", "", "g") + let l:py3 = system("eselect python show --python3") + let l:py3 = substitute(l:py3, "\n", "", "g") + + if l:py2 == "" + let l:py2 = "python2.7" + endif + if l:py3 == "" + let l:py3 = "python3.4" + endif + + let l:pythons = substitute(l:py2 . " " . l:py3, "[.]", "_", "g") + + let g:gentoopythontargets = l:pythons + return g:gentoopythontargets + endif +endfun + " vim: set et foldmethod=marker : " diff --git a/plugin/newebuild.vim b/plugin/newebuild.vim index c2bcd1c..7197e41 100644 --- a/plugin/newebuild.vim +++ b/plugin/newebuild.vim @@ -144,7 +144,7 @@ fun! MakeNewEbuild() " {{{ standard default setup " {{{ extra inherits for some categories if l:category ==# "dev-python" - put ='PYTHON_COMPAT=( python2_7 python3_4 )' + put ='PYTHON_COMPAT=( ' . GentooGetPythonTargets() . ' )' put ='inherit distutils-r1' put ='' elseif l:category =~# "^xfce-"