aboutsummaryrefslogtreecommitdiffstats
path: root/webmap-download
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2024-06-03 18:17:19 +0200
committerGuilhem Moulin <guilhem@fripost.org>2024-06-03 18:17:50 +0200
commite06f305b47663b3f20839e989b21a8e759179f16 (patch)
tree9e5e36d04765880310f4e9eb7ec0dc116734ba2b /webmap-download
parentc5e2fced06705bd5d495deca79917ae055af6915 (diff)
webmap-download: Use sha256_hex() for lock file names.
Instead of sha1_hex().
Diffstat (limited to 'webmap-download')
-rwxr-xr-xwebmap-download4
1 files changed, 2 insertions, 2 deletions
diff --git a/webmap-download b/webmap-download
index 583c5dd..4936e24 100755
--- a/webmap-download
+++ b/webmap-download
@@ -27,7 +27,7 @@ import argparse
import itertools
from pathlib import Path
from email.utils import parsedate_to_datetime, formatdate
-from hashlib import sha1
+from hashlib import sha256
import requests
import common
@@ -214,7 +214,7 @@ if __name__ == '__main__':
# place an exclusive lock on a lockfile as the destination can be used by other layers
# hence might be updated in parallel
if lockdir_fd is not None:
- lockfile = sha1(dest.encode('utf-8')).hexdigest() + '.lck'
+ lockfile = sha256(dest.encode('utf-8')).hexdigest() + '.lck'
# use O_TRUNC to bump lockfile's mtime
lock_fd = os.open(lockfile, O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, mode=0o644, dir_fd=lockdir_fd)
try: