From e9013dbe6f7822560d7cc1dbc25f1127333f86a2 Mon Sep 17 00:00:00 2001 From: sebmarchand Date: Wed, 8 Jun 2016 10:25:54 -0700 Subject: [PATCH] Update the VS toolchain hash computation caching. R=hans@chromium.org, scottmg@chromium.org BUG=495204 Review-Url: https://codereview.chromium.org/2052533002 --- win_toolchain/get_toolchain_if_necessary.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/win_toolchain/get_toolchain_if_necessary.py b/win_toolchain/get_toolchain_if_necessary.py index 37a3207d8..d7d20b820 100755 --- a/win_toolchain/get_toolchain_if_necessary.py +++ b/win_toolchain/get_toolchain_if_necessary.py @@ -165,6 +165,10 @@ def CalculateHash(root, expected_hash): digest.update(path_without_hash.lower()) with open(path, 'rb') as f: digest.update(f.read()) + + # Save the timestamp file if the calculated hash is the expected one. + if digest.hexdigest() == expected_hash: + SaveTimestampsAndHash(root, digest.hexdigest()) return digest.hexdigest()