From ca3567df1e100b4bef4d9afa3a639f7016c7907a Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 29 Jun 2018 19:55:29 +0300 Subject: [PATCH] Replace "env" pattern by "sysenv" in "platformio.ini" // Resolve #1705 --- HISTORY.rst | 2 ++ docs | 2 +- platformio/util.py | 8 +++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 8267d040..10b921bc 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -11,6 +11,8 @@ PlatformIO 3.0 (`issue #1665 `_) * Handle "architectures" data from "library.properties" manifest in `lib_compat_mode = strict `__ +* Replaced conflicted "env" pattern by "sysenv" for `"platformio.ini" Dynamic Variables" `__ + (`issue #1705 `_) * Removed "date&time" when processing project with `platformio run `__ command (`issue #1343 `_) * Fixed issue with invalid LD script if path contains space diff --git a/docs b/docs index 6d29169d..ae2968e5 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 6d29169d6e29c48561b58fa1505cc70d259e00e6 +Subproject commit ae2968e52ac2bc86ec7e7fe67073ceb37c47f577 diff --git a/platformio/util.py b/platformio/util.py index 98c3cbc1..eab6512f 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -63,7 +63,13 @@ class ProjectConfig(ConfigParser.ConfigParser): def _re_sub_handler(self, match): section, option = match.group(1), match.group(2) - if section == "env" and not self.has_section(section): + if section in ("env", "sysenv") and not self.has_section(section): + if section == "env": + click.secho( + "Warning! Access to system environment variable via " + "`${{env.{0}}}` is deprecated. Please use " + "`${{sysenv.{0}}}` instead".format(option), + fg="yellow") return os.getenv(option) return self.get(section, option)