summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorZubin Duggal <zubin.duggal@gmail.com>2021-12-13 18:03:14 +0530
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-01-11 19:37:45 -0500
commit02cf4bc6d349514d6740886ebed660a0c444f3d4 (patch)
treec5c709f408e279a212fece25617b6af4b76a599e /mk
parenta8fb4251cd4b12c792b0f94979b584364d80b434 (diff)
downloadhaskell-02cf4bc6d349514d6740886ebed660a0c444f3d4.tar.gz
hadrian: Fully implement source distributions (#19317)
We use `git ls-files` to get the list of files to include in the source distribution. Also implements the `-testsuite` and `-extra-tarballs` distributions.
Diffstat (limited to 'mk')
-rwxr-xr-xmk/get-win32-tarballs.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/mk/get-win32-tarballs.py b/mk/get-win32-tarballs.py
index 025e661b22..f1ada96b48 100755
--- a/mk/get-win32-tarballs.py
+++ b/mk/get-win32-tarballs.py
@@ -38,6 +38,15 @@ def fetch_arch(arch: str):
verify(arch)
+def list_arch(arch: str):
+ d = DEST / arch
+ manifest_url = file_url(arch, 'MANIFEST')
+ req = urllib.request.urlopen(manifest_url)
+ files = req.read().decode('UTF-8').split('\n')
+ print(d / 'SHA256SUMS')
+ for fname in files:
+ print(d / fname)
+
def verify(arch: str):
if not Path(DEST / arch / "SHA256SUMS").is_file():
print("SHA256SUMS doesn't exist; have you fetched?", file=stderr)
@@ -48,14 +57,14 @@ def verify(arch: str):
def main() -> None:
parser = argparse.ArgumentParser()
- parser.add_argument('mode', choices=['verify', 'download'])
+ parser.add_argument('mode', choices=['verify', 'download', 'list'])
parser.add_argument(
'arch',
choices=ARCHS + ['all'],
help="Architecture to fetch (either i686, x86_64, sources, or all)")
args = parser.parse_args()
- action = fetch_arch if args.mode == 'download' else verify
+ action = { 'download' : fetch_arch, 'verify' : verify, 'list' : list_arch }[args.mode]
if args.arch == 'all':
for arch in ARCHS:
action(arch)