From 1f7c8ec7e27f54ace74c77fd517eb0aa33d43d9b Mon Sep 17 00:00:00 2001 From: Aman Verma Date: Sat, 19 Dec 2020 18:43:55 -0500 Subject: [PATCH] mdist: Ensure correct format for sha256sum. We conform to the format described at . and compatible with busybox and Perl's shasum utility. --- mesonbuild/mdist.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mesonbuild/mdist.py b/mesonbuild/mdist.py index 6985ca950..1e80a6222 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())