Fix issue with useless project rebuilding for case insensitive file systems (Windows)

This commit is contained in:
Ivan Kravets
2018-03-15 19:53:05 +02:00
parent d2b34d42f7
commit 3663dc3470
3 changed files with 18 additions and 6 deletions

View File

@ -4,6 +4,12 @@ Release Notes
PlatformIO 3.0
--------------
3.5.3 (2018-??-??)
~~~~~~~~~~~~~~~~~~
* Fixed issue with useless project rebuilding for case insensitive file
systems (Windows)
3.5.2 (2018-03-13)
~~~~~~~~~~~~~~~~~~

View File

@ -255,9 +255,10 @@ def lib_search(query, json_output, page, noninteractive, **filters):
elif not click.confirm("Show next libraries?"):
break
result = get_api_result(
"/v2/lib/search",
{"query": " ".join(query),
"page": int(result['page']) + 1},
"/v2/lib/search", {
"query": " ".join(query),
"page": int(result['page']) + 1
},
cache_valid="1d")

View File

@ -411,7 +411,7 @@ def check_project_envs(config, environments=None):
def calculate_project_hash():
check_suffixes = (".c", ".cc", ".cpp", ".h", ".hpp", ".s", ".S")
structure = [__version__]
chunks = [__version__]
for d in (util.get_projectsrc_dir(), util.get_projectlib_dir()):
if not isdir(d):
continue
@ -419,5 +419,10 @@ def calculate_project_hash():
for f in files:
path = join(root, f)
if path.endswith(check_suffixes):
structure.append(path)
return sha1(",".join(sorted(structure))).hexdigest()
chunks.append(path)
chunks_to_str = ",".join(sorted(chunks))
if "windows" in util.get_systype():
# Fix issue with useless project rebuilding for case insensitive FS.
# A case of disk drive can differ...
chunks_to_str = chunks_to_str.lower()
return sha1(chunks_to_str).hexdigest()