From 9427e8e85547ea59ebab9e006d3bee8adcadf514 Mon Sep 17 00:00:00 2001 From: Mike Pilgrem Date: Sat, 23 Mar 2024 11:56:21 +0000 Subject: [PATCH] Fix #133 indexRelFile is function of cabalCacheLayout --- ChangeLog.md | 4 ++++ package.yaml | 2 +- pantry.cabal | 2 +- src/Pantry/Hackage.hs | 8 +++++++- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index a9692bb9..8056c59c 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,9 @@ # Changelog for pantry +## v0.9.3.3 + +* Name of tar file of local cache of package index is not hard coded. + ## v0.9.3.2 * Support `ansi-terminal-1.0.2`. diff --git a/package.yaml b/package.yaml index 622fbbd4..7c6497e1 100644 --- a/package.yaml +++ b/package.yaml @@ -1,5 +1,5 @@ name: pantry -version: 0.9.3.2 +version: 0.9.3.3 synopsis: Content addressable Haskell package management description: Please see the README on GitHub at category: Development diff --git a/pantry.cabal b/pantry.cabal index 10175a08..9af82ea5 100644 --- a/pantry.cabal +++ b/pantry.cabal @@ -5,7 +5,7 @@ cabal-version: 2.0 -- see: https://github.com/sol/hpack name: pantry -version: 0.9.3.2 +version: 0.9.3.3 synopsis: Content addressable Haskell package management description: Please see the README on GitHub at category: Development diff --git a/src/Pantry/Hackage.hs b/src/Pantry/Hackage.hs index e7ed1cb4..814d01cb 100644 --- a/src/Pantry/Hackage.hs +++ b/src/Pantry/Hackage.hs @@ -98,8 +98,14 @@ hackageRelDir = either impureThrow id $ parseRelDir "hackage" hackageDirL :: HasPantryConfig env => SimpleGetter env (Path Abs Dir) hackageDirL = pantryConfigL.to (( hackageRelDir) . pcRootDir) +-- | The name of the tar file that is part of the local cache of the package +-- index is determined by this package's use of 'HS.cabalCacheLayout' as the +-- layout of the local cache. indexRelFile :: Path Rel File -indexRelFile = either impureThrow id $ parseRelFile "00-index.tar" +indexRelFile = either impureThrow id $ parseRelFile indexTar + where + indexTar' = HS.cacheLayoutIndexTar HS.cabalCacheLayout + indexTar = HS.toUnrootedFilePath $ HS.unrootPath indexTar' -- | Where does pantry download its 01-index.tar file from Hackage? --