From: Andreas Sandberg Date: Wed, 5 Apr 2017 08:53:43 +0000 (+0100) Subject: scons: Fix hook installation error caused by stale cache X-Git-Tag: v19.0.0.0~2875 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c7f92c43da5b5d96b4287c418beaab3e56a91137;p=gem5.git scons: Fix hook installation error caused by stale cache Due to the way SCons caches some file system state internally, it sometimes "remembers" that a file or directory didn't exist at some point. The git hook installation script sometimes needs to create a hooks directory in the repository. Due to the cached state of the hooks directory, the build system tries to create it twice. The second mkdir operation leads to an error since the directory already exists. Fix this issue by clearing the cached state of the hooks directory after creating it. Change-Id: I3f67f75c06ef928b439a0742f7619b7e92ed093b Signed-off-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/2660 Reviewed-by: Gabe Black --- diff --git a/SConstruct b/SConstruct index ce53a51c0..6010f3a57 100755 --- a/SConstruct +++ b/SConstruct @@ -399,6 +399,7 @@ def install_git_style_hooks(): if not git_hooks.exists(): mkdir(git_hooks.get_abspath()) + git_hooks.clear() abs_symlink_hooks = git_hooks.islink() and \ os.path.isabs(os.readlink(git_hooks.get_abspath()))