forked from platformio/platformio-core
Force drive letter to lower case when calculating project checksum on Windows // Resolve #4600
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
from hashlib import sha1
|
from hashlib import sha1
|
||||||
|
|
||||||
@@ -94,7 +95,16 @@ def compute_project_checksum(config):
|
|||||||
checksum = sha1(hashlib_encode_data(__version__))
|
checksum = sha1(hashlib_encode_data(__version__))
|
||||||
|
|
||||||
# configuration file state
|
# configuration file state
|
||||||
checksum.update(hashlib_encode_data(config.to_json()))
|
config_data = config.to_json()
|
||||||
|
if IS_WINDOWS:
|
||||||
|
# issue #4600: fix drive letter
|
||||||
|
config_data = re.sub(
|
||||||
|
r"([A-Z]):\\",
|
||||||
|
lambda match: "%s:\\" % match.group(1).lower(),
|
||||||
|
config_data,
|
||||||
|
flags=re.I,
|
||||||
|
)
|
||||||
|
checksum.update(hashlib_encode_data(config_data))
|
||||||
|
|
||||||
# project file structure
|
# project file structure
|
||||||
check_suffixes = (".c", ".cc", ".cpp", ".h", ".hpp", ".s", ".S")
|
check_suffixes = (".c", ".cc", ".cpp", ".h", ".hpp", ".s", ".S")
|
||||||
|
Reference in New Issue
Block a user