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 6F7101381F3 for ; Thu, 5 Sep 2013 11:54:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5F956E0DDE; Thu, 5 Sep 2013 11:54:39 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id DEEC8E0DDE for ; Thu, 5 Sep 2013 11:54:38 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 88E9D33EA89 for ; Thu, 5 Sep 2013 11:54:37 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 4EC3EE468F for ; Thu, 5 Sep 2013 11:54:35 +0000 (UTC) From: "Jauhien Piatlicki" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Jauhien Piatlicki" Message-ID: <1378382052.71062a6167f767e15a22ac10edd996b3cad667a3.jauhien@gentoo> Subject: [gentoo-commits] proj/g-sorcery:master commit in: g_sorcery/, gs_pypi/, gs_ctan/, gs_elpa/ X-VCS-Repository: proj/g-sorcery X-VCS-Files: g_sorcery/ebuild.py gs_ctan/ebuild.py gs_elpa/ebuild.py gs_pypi/ebuild.py X-VCS-Directories: g_sorcery/ gs_pypi/ gs_ctan/ gs_elpa/ X-VCS-Committer: jauhien X-VCS-Committer-Name: Jauhien Piatlicki X-VCS-Revision: 71062a6167f767e15a22ac10edd996b3cad667a3 X-VCS-Branch: master Date: Thu, 5 Sep 2013 11:54:35 +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: ba501965-d806-494e-8749-2c6e7ddccd5a X-Archives-Hash: 0009bb43bf9583f41261692ca2bdd35c commit: 71062a6167f767e15a22ac10edd996b3cad667a3 Author: Jauhien Piatlicki (jauhien) gmail com> AuthorDate: Thu Sep 5 11:54:12 2013 +0000 Commit: Jauhien Piatlicki gmail com> CommitDate: Thu Sep 5 11:54:12 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/g-sorcery.git;a=commit;h=71062a61 variables without quotation in ebuild-generator --- g_sorcery/ebuild.py | 19 +++++++++++++------ gs_ctan/ebuild.py | 6 +++--- gs_elpa/ebuild.py | 4 ++-- gs_pypi/ebuild.py | 8 ++++---- 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/g_sorcery/ebuild.py b/g_sorcery/ebuild.py index 36847f9..4c2e318 100644 --- a/g_sorcery/ebuild.py +++ b/g_sorcery/ebuild.py @@ -168,7 +168,10 @@ class DefaultEbuildGenerator(EbuildGenerator): inherit entry is just a list of eclass names. vars* entries are lists of variables in tw0 possible formats: 1. A string with variable name - 2. A tuple (varname, value) + 2. A dictinary with entries: + name: variable name + value: variable value + raw: if present, not quotation of value will be done Variable names are automatically transformed to the upper-case. """ def __init__(self, package_db, layout): @@ -218,15 +221,19 @@ class DefaultEbuildGenerator(EbuildGenerator): Args: variables: List of variables. """ - VAR_NAME = 0 - VAR_VALUE = 1 - for var in variables: if isinstance(var, basestring): self.template.append(var.upper() + '="%(' + var + ')s"') else: - self.template.append(var[VAR_NAME].upper() \ - + '="' + var[VAR_VALUE] + '"') + if "raw" in var: + quote = '' + else: + quote = '"' + if "value" in var: + self.template.append(var["name"].upper() \ + + '=' + quote + var["value"] + quote) + else: + self.template.append(var["name"].upper() + '=' + quote + '%(' + var["name"] + ')s' + quote) def get_template(self, package, ebuild_data): diff --git a/gs_ctan/ebuild.py b/gs_ctan/ebuild.py index d8b4f65..0dbb5a0 100644 --- a/gs_ctan/ebuild.py +++ b/gs_ctan/ebuild.py @@ -32,7 +32,7 @@ class CtanEbuildWithoutDigestGenerator(DefaultEbuildGenerator): inherit = ["gs-ctan"] vars_after_description = \ - ["homepage", ("src_uri", ""), "license"] + ["homepage", {"name" : "src_uri", "value" : ""}, "license"] vars_after_keywords = \ ["depend", "rdepend"] @@ -48,12 +48,12 @@ class CtanEbuildWithDigestGenerator(DefaultEbuildGenerator): def __init__(self, package_db): vars_before_inherit = \ - ["base_src_uri", "catalogue", "source_type", "realname", ("digest_sources", "yes")] + ["base_src_uri", "catalogue", "source_type", "realname", {"name" : "digest_sources", "value" : "yes"}] inherit = ["gs-ctan"] vars_after_description = \ - ["homepage", ("src_uri", "${BASE_SRC_URI}${CATALOGUE}${REALNAME}.${SOURCE_TYPE} -> ${P}.${SOURCE_TYPE}"), "license"] + ["homepage", {"name" : "src_uri", "value" : "${BASE_SRC_URI}${CATALOGUE}${REALNAME}.${SOURCE_TYPE} -> ${P}.${SOURCE_TYPE}"}, "license"] vars_after_keywords = \ ["depend", "rdepend"] diff --git a/gs_elpa/ebuild.py b/gs_elpa/ebuild.py index 460ccfa..d1d63f2 100644 --- a/gs_elpa/ebuild.py +++ b/gs_elpa/ebuild.py @@ -27,12 +27,12 @@ class ElpaEbuildWithDigestGenerator(DefaultEbuildGenerator): def __init__(self, package_db): vars_before_inherit = \ - ["repo_uri", "source_type", "realname", ("digest_sources", "yes")] + ["repo_uri", "source_type", "realname", {"name" : "digest_sources", "value" : "yes"}] inherit = ["g-sorcery", "gs-elpa"] vars_after_description = \ - ["homepage", ("src_uri", "${REPO_URI}${REALNAME}-${PV}.${SUFFIX}")] + ["homepage", {"name" : "src_uri", "value" : "${REPO_URI}${REALNAME}-${PV}.${SUFFIX}"}] vars_after_keywords = \ ["depend", "rdepend"] diff --git a/gs_pypi/ebuild.py b/gs_pypi/ebuild.py index 74ba910..d3f5342 100644 --- a/gs_pypi/ebuild.py +++ b/gs_pypi/ebuild.py @@ -24,8 +24,8 @@ class PypiEbuildWithoutDigestGenerator(DefaultEbuildGenerator): def __init__(self, package_db): vars_before_inherit = \ - [("repo_uri", 'http://pypi.python.org/packages/source/${PN:0:1}/${PN}/'), - ("sourcefile", '${P}.tar.gz'), "python_compat"] + [{"name" : "repo_uri", "value" : 'http://pypi.python.org/packages/source/${PN:0:1}/${PN}/'}, + {"name" : "sourcefile", "value" : '${P}.tar.gz'}, {"name" : "python_compat", "raw" : True}] inherit = ["gs-pypi"] @@ -43,13 +43,13 @@ class PypiEbuildWithDigestGenerator(DefaultEbuildGenerator): def __init__(self, package_db): vars_before_inherit = \ - [("digest_sources", "yes"), "python_compat"] + [{"name" : "digest_sources", "value" : "yes"}, {"name" : "python_compat", "raw" : True}] inherit = ["gs-pypi"] vars_after_description = \ ["homepage", - ("src_uri", 'http://pypi.python.org/packages/source/${PN:0:1}/${PN}/${P}.tar.gz')] + {"name" : "src_uri", "value" : 'http://pypi.python.org/packages/source/${PN:0:1}/${PN}/${P}.tar.gz'}] vars_after_keywords = \ []