summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-03-03 17:32:21 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2018-03-03 17:44:35 +0100
commite984029cd1988d9c660d46b51e866e0296ee227a (patch)
tree1e84c815658c06573d1c5a11454008f0319d9cf1
parent81597fd6beade40901e064954700166b855dcb12 (diff)
Accept existing directory with no auto.conf in sync_deps()
An initial empty auto.conf will be created, just as when sync_deps() creates the directory. This is more flexible. There's no good reason to require the directory to be created by sync_deps().
-rw-r--r--kconfiglib.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index c5b0cdf..9b83070 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -972,13 +972,15 @@ class Kconfig(object):
sync_deps(path) does the following:
- 1. If the directory 'path' does not exist, it is created, and an
- empty file auto.conf is stored in it.
+ 1. If the directory <path> does not exist, it is created.
+
+ 2. If no <path>/auto.conf file exists, an initially empty auto.conf
+ is created.
auto.conf keeps track of the old symbol values from the previous
build. The format mirrors .config.
- 2. auto.conf is loaded, and the old symbol values in it are compared
+ 3. auto.conf is loaded, and the old symbol values in it are compared
against the current symbol values. If a symbol has changed value,
the change is signaled by touch'ing a file corresponding to the
symbol.
@@ -992,7 +994,7 @@ class Kconfig(object):
single directory with a huge number of files, which the underlying
filesystem might not handle well.
- 3. A new auto.conf is written to keep track of the current symbol
+ 4. A new auto.conf is written to keep track of the current symbol
values for the next build.
@@ -1011,7 +1013,10 @@ class Kconfig(object):
implementation can be used as a template."""
if not os.path.exists(path):
os.mkdir(path, 0o755)
- open(os.path.join(path, "auto.conf"), "w").close()
+
+ auto_conf = os.path.join(path, "auto.conf")
+ if not os.path.exists(auto_conf):
+ open(auto_conf, "w").close()
# This setup makes sure that at least the current working directory
# gets reset if things fail