pantry-0.5.0.0: Content addressable Haskell package management

Safe HaskellNone
LanguageHaskell2010

Pantry.Internal

Description

Exposed for testing, do not use!

Synopsis

Documentation

newtype Tree Source #

Represents the contents of a tree, which is a mapping from relative file paths to TreeEntrys.

Since: 0.1.0.0

Instances
Eq Tree Source # 
Instance details

Defined in Pantry.Types

Methods

(==) :: Tree -> Tree -> Bool #

(/=) :: Tree -> Tree -> Bool #

Show Tree Source # 
Instance details

Defined in Pantry.Types

Methods

showsPrec :: Int -> Tree -> ShowS #

show :: Tree -> String #

showList :: [Tree] -> ShowS #

data TreeEntry Source #

Constructors

TreeEntry 

Fields

Instances
Eq TreeEntry Source # 
Instance details

Defined in Pantry.Types

Show TreeEntry Source # 
Instance details

Defined in Pantry.Types

normalizeParents :: FilePath -> Either String FilePath Source #

Like System.FilePath.normalise, however:

  • Only works on relative paths, absolute paths fail
  • Strips trailing slashes
  • Only works on forward slashes, even on Windows
  • Normalizes parent dirs foo.. get stripped
  • Cannot begin with a parent directory (../)
  • Spelled like an American, sorry

makeTarRelative Source #

Arguments

:: FilePath

base file

-> FilePath

relative part

-> Either String FilePath 

Following tar file rules (Unix file paths only), make the second file relative to the first file.

getGlobalHintsFile :: HasPantryConfig env => RIO env (Path Abs File) Source #

Get the path to the global hints cache file

data Storage Source #

Represents a SQL database connection. This used to be a newtype wrapper around a connection pool. However, when investigating https://github.com/commercialhaskell/stack/issues/4471, it appeared that holding a pool resulted in overly long write locks being held on the database. As a result, we now abstract away whether a pool is used, and the default implementation in Pantry.Storage does not use a pool.

initStorage Source #

Arguments

:: HasLogFunc env 
=> Text 
-> Migration 
-> Path Abs File

storage file

-> (Storage -> RIO env a) 
-> RIO env a 

withStorage_ :: Storage -> forall env a. HasLogFunc env => ReaderT SqlBackend (RIO env) a -> RIO env a Source #