Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Travis Whitaker
GHC
Commits
8ad8dc41
Commit
8ad8dc41
authored
Mar 19, 2020
by
Ben Gamari
🐢
Committed by
Marge Bot
May 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get-win32-tarballs: Improve diagnostics output
parent
670c3e5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
mk/get-win32-tarballs.py
mk/get-win32-tarballs.py
+8
-2
No files found.
mk/get-win32-tarballs.py
View file @
8ad8dc41
...
...
@@ -5,6 +5,7 @@ from pathlib import Path
import
urllib.request
import
subprocess
import
argparse
from
sys
import
stderr
TARBALL_VERSION
=
'0.1'
BASE_URL
=
"https://downloads.haskell.org/ghc/mingw/{}"
.
format
(
TARBALL_VERSION
)
...
...
@@ -18,11 +19,13 @@ def file_url(arch: str, fname: str) -> str:
fname
=
fname
)
def
fetch
(
url
:
str
,
dest
:
Path
):
print
(
'Fetching'
,
url
,
'=>'
,
dest
)
print
(
'Fetching'
,
url
,
'=>'
,
dest
,
file
=
stderr
)
urllib
.
request
.
urlretrieve
(
url
,
dest
)
def
fetch_arch
(
arch
:
str
):
req
=
urllib
.
request
.
urlopen
(
file_url
(
arch
,
'MANIFEST'
))
manifest_url
=
file_url
(
arch
,
'MANIFEST'
)
print
(
'Fetching'
,
manifest_url
,
file
=
stderr
)
req
=
urllib
.
request
.
urlopen
(
manifest_url
)
files
=
req
.
read
().
decode
(
'UTF-8'
).
split
(
'
\n
'
)
d
=
DEST
/
arch
if
not
d
.
is_dir
():
...
...
@@ -35,6 +38,9 @@ def fetch_arch(arch: str):
verify
(
arch
)
def
verify
(
arch
:
str
):
if
not
Path
(
DEST
/
arch
/
"SHA256SUMS"
).
is_file
():
raise
IOError
(
"SHA256SUMS doesn't exist; have you fetched?"
)
cmd
=
[
'sha256sum'
,
'--quiet'
,
'--check'
,
'--ignore-missing'
,
'SHA256SUMS'
]
subprocess
.
check_call
(
cmd
,
cwd
=
DEST
/
arch
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment