hackage-security- Hackage security library

Safe HaskellNone



The files we cache from the repository

Both the Local and the Remote repositories make use of this module.



data Cache #

Location and layout of the local cache



getCached :: Cache -> CachedFile -> IO (Maybe (Path Absolute)) #

Get a cached file (if available)

getCachedRoot :: Cache -> IO (Path Absolute) #

Get the cached root

Calling getCachedRoot without root info available is a programmer error and will result in an unchecked exception. See requiresBootstrap.

getCachedIndex :: Cache -> Format f -> IO (Maybe (Path Absolute)) #

Get the cached index (if available)

clearCache :: Cache -> IO () #

Delete a previously downloaded remote file

withIndex :: Cache -> (Handle -> IO a) -> IO a #

cacheRemoteFile :: forall down typ f. DownloadedFile down => Cache -> down typ -> Format f -> IsCached typ -> IO () #

Cache a previously downloaded remote file

lockCache :: Cache -> IO () -> IO () #

Lock the cache

This avoids two concurrent processes updating the cache at the same time, provided they both take the lock.