aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas "Cakeisalie5" Touhey <thomas@touhey.fr>2017-07-15 01:35:22 +0200
committerThomas "Cakeisalie5" Touhey <thomas@touhey.fr>2017-07-15 01:35:22 +0200
commit6b8291c0e656d306f8782e84e28d3f2ee11b63cb (patch)
tree7a92799a93249f8d89466e2d12257446efebf6d2
parente7a7e8d891b82e3afd18e3a8e5de993fb88cc833 (diff)
Stupid error number two: stat on a non-existing file, fixed.
-rwxr-xr-xtools/configure.py2
-rwxr-xr-xtools/makeinc.py12
2 files changed, 10 insertions, 4 deletions
diff --git a/tools/configure.py b/tools/configure.py
index bd6f9cf..026d2a9 100755
--- a/tools/configure.py
+++ b/tools/configure.py
@@ -53,7 +53,7 @@ args.modules = set(args.modules.split(',')) if args.modules else []
# Prepare for the configuration #
#*****************************************************************************#
# Clean the repository.
-ret = call(['python3', os.path.join('tools', 'make.py'), 'clean'])
+ret = call(['python3', os.path.join('tools', 'make.py'), 'mrproper'])
if ret: exit(ret)
#*****************************************************************************#
# Get the configuration #
diff --git a/tools/makeinc.py b/tools/makeinc.py
index 56a1d5c..e186fcf 100755
--- a/tools/makeinc.py
+++ b/tools/makeinc.py
@@ -134,7 +134,13 @@ def process(path_in, f_out, indent=0, isbit=False):
def make_header(base, name, out_path):
global cache
- st = os.stat(out_path)
+ try:
+ st = os.stat(out_path)
+ atim = st.st_atime
+ mtim = st.st_mtime
+ except:
+ atim = 0
+ mtim = 0
out = open(out_path, 'w')
head = getheader(os.path.join(base, name))
@@ -196,12 +202,12 @@ def make_header(base, name, out_path):
if not name in cache:
cache[name] = [base, bdeps]
if cache[name][0] != base or cache[name][1] != bdeps or \
- st.st_mtime <= max(map(lambda x:os.stat(x).st_mtime, \
+ mtim <= max(map(lambda x:os.stat(x).st_mtime, \
[os.path.join(base, name)] + bdeps)):
cache[name] = [base, bdeps]
else:
# Restore last modification time.
- os.utime(out_path, (st.st_atime, st.st_mtime))
+ os.utime(out_path, (atim, mtim))
#*****************************************************************************#
# Make the folder #
#*****************************************************************************#