Skip to content

Commit d95bdfa

Browse files
committed
Do etags hashing wrt #193
1 parent 9639e69 commit d95bdfa

File tree

6 files changed

+230
-331
lines changed

6 files changed

+230
-331
lines changed

app/ghcup-gen/Validate.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ validateTarballs (TarballFilter etool versionRegex) dls gt = do
256256
case etool of
257257
Right (Just GHCup) -> do
258258
tmpUnpack <- lift mkGhcupTmpDir
259-
_ <- liftE $ download dli tmpUnpack Nothing
259+
_ <- liftE $ download (_dlUri dli) (Just (_dlHash dli)) tmpUnpack Nothing False
260260
pure Nothing
261261
Right _ -> do
262262
p <- liftE $ downloadCached dli Nothing
@@ -266,7 +266,7 @@ validateTarballs (TarballFilter etool versionRegex) dls gt = do
266266
$ p
267267
Left ShimGen -> do
268268
tmpUnpack <- lift mkGhcupTmpDir
269-
_ <- liftE $ download dli tmpUnpack Nothing
269+
_ <- liftE $ download (_dlUri dli) (Just (_dlHash dli)) tmpUnpack Nothing False
270270
pure Nothing
271271
case r of
272272
VRight (Just basePath) -> do

lib/GHCup.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2137,7 +2137,7 @@ upgradeGHCup mtarget force' = do
21372137
dli <- liftE $ getDownloadInfo GHCup latestVer
21382138
tmp <- lift withGHCupTmpDir
21392139
let fn = "ghcup" <> exeExt
2140-
p <- liftE $ download dli tmp (Just fn)
2140+
p <- liftE $ download (_dlUri dli) (Just (_dlHash dli)) tmp (Just fn) False
21412141
let destDir = takeDirectory destFile
21422142
destFile = fromMaybe (binDir </> fn) mtarget
21432143
lift $ $(logDebug) [i|mkdir -p #{destDir}|]

0 commit comments

Comments
 (0)