From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mail.openembedded.org (Postfix) with ESMTP id 38B01772D9 for ; Wed, 3 Feb 2016 10:33:41 +0000 (UTC) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 03 Feb 2016 02:33:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,389,1449561600"; d="scan'208";a="907544458" Received: from marquiz.fi.intel.com ([10.237.72.155]) by fmsmga002.fm.intel.com with ESMTP; 03 Feb 2016 02:33:41 -0800 From: Markus Lehtonen To: bitbake-devel@lists.openembedded.org Date: Wed, 3 Feb 2016 12:33:38 +0200 Message-Id: <1454495619-15453-2-git-send-email-markus.lehtonen@linux.intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1454495619-15453-1-git-send-email-markus.lehtonen@linux.intel.com> References: <1454495619-15453-1-git-send-email-markus.lehtonen@linux.intel.com> Subject: [PATCH 1/2] data_smart: simple bracket matching inside python expressions X-BeenThere: bitbake-devel@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussion that advance bitbake development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2016 10:33:41 -0000 This expands the python expansion regex by matching curly brackets inside python expressions. In its simplicity it is limited: e.g. it does not correctly handle nested curly brackets or open curly brackets (i.e. '{' without a matching '}') inside python expressions. Making python parsing inside data_smart fully error-free would require significantly more work, basically using/implementing python parser to correctly handle python strings etc. [YOCTO #8849] Signed-off-by: Markus Lehtonen --- lib/bb/data_smart.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py index ca5774b..6069499 100644 --- a/lib/bb/data_smart.py +++ b/lib/bb/data_smart.py @@ -41,7 +41,7 @@ logger = logging.getLogger("BitBake.Data") __setvar_keyword__ = ["_append", "_prepend", "_remove"] __setvar_regexp__ = re.compile('(?P.*?)(?P_append|_prepend|_remove)(_(?P.*))?$') __expand_var_regexp__ = re.compile(r"\${[^{}@\n\t ]+}") -__expand_python_regexp__ = re.compile(r"\${@.+?}") +__expand_python_regexp__ = re.compile(r"\${@(({[^{]*?})|.)+?}") def infer_caller_details(loginfo, parent = False, varval = True): """Save the caller the trouble of specifying everything.""" -- 2.1.4