aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorAman Verma <amanraoverma@gmail.com>2020-12-19 18:43:55 -0500
committerEli Schwartz <eschwartz93@gmail.com>2020-12-22 21:38:28 -0500
commit1f7c8ec7e27f54ace74c77fd517eb0aa33d43d9b (patch)
tree1a0346cfea01cd202fa0befbc30a5985bf8abfa2 /mesonbuild
parentd6ef5b202413e19e1389a51e5804b214e3961c09 (diff)
downloadmeson-1f7c8ec7e27f54ace74c77fd517eb0aa33d43d9b.zip
meson-1f7c8ec7e27f54ace74c77fd517eb0aa33d43d9b.tar.gz
meson-1f7c8ec7e27f54ace74c77fd517eb0aa33d43d9b.tar.bz2
mdist: Ensure correct format for sha256sum.
We conform to the format described at <https://www.gnu.org/software/coreutils/manual/html_node/md5sum-invocation.html>. and compatible with busybox and Perl's shasum utility.
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/mdist.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/mdist.py b/mesonbuild/mdist.py
index 6985ca9..1e80a62 100644
--- a/mesonbuild/mdist.py
+++ b/mesonbuild/mdist.py
@@ -48,7 +48,9 @@ def create_hash(fname):
m = hashlib.sha256()
m.update(open(fname, 'rb').read())
with open(hashname, 'w') as f:
- f.write('{} {}\n'.format(m.hexdigest(), os.path.basename(fname)))
+ # A space and an asterisk because that is the format defined by GNU coreutils
+ # and accepted by busybox and the Perl shasum tool.
+ f.write('{} *{}\n'.format(m.hexdigest(), os.path.basename(fname)))
print(os.path.relpath(fname), m.hexdigest())