From 0ee75c5fc4113df0e0342b9a3fd8df3676d64af6 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Wed, 30 Nov 2016 10:05:20 -0700 Subject: [PATCH] genconfig: pick up defaults from the environment This matches the behavior of Make and ensures that we rebuild correctly when the configuration is only modified in the environment. Change-Id: Iaf63c488b7c817d6c74a89da2d1de8e4c01be045 Signed-off-by: Daniel Verkamp --- scripts/genconfig.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/genconfig.py b/scripts/genconfig.py index d8e1f7e89..5e3ae63b2 100755 --- a/scripts/genconfig.py +++ b/scripts/genconfig.py @@ -1,12 +1,13 @@ #!/usr/bin/env python +import os import re import sys comment = re.compile('^\s*#') assign = re.compile('^\s*([a-zA-Z_]+)\s*(\?)?=\s*([^#]*)') -args = {} +args = os.environ.copy() for arg in sys.argv: m = assign.match(arg) if m: