pantry-0.5.2.3: Content addressable Haskell package management
Safe HaskellNone
LanguageHaskell2010

Pantry.Internal

Description

Exposed for testing, do not use!

Synopsis

Documentation

parseTree :: ByteString -> Maybe Tree Source #

renderTree :: Tree -> ByteString Source #

newtype Tree Source #

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

Since: 0.1.0.0

Constructors

TreeMap (Map SafeFilePath TreeEntry) 

Instances

Instances details
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

Instances details
Eq TreeEntry Source # 
Instance details

Defined in Pantry.Types

Methods

(==) :: TreeEntry -> TreeEntry -> Bool

(/=) :: TreeEntry -> TreeEntry -> Bool

Show TreeEntry Source # 
Instance details

Defined in Pantry.Types

Methods

showsPrec :: Int -> TreeEntry -> ShowS

show :: TreeEntry -> String

showList :: [TreeEntry] -> ShowS

data FileType Source #

Constructors

FTNormal 
FTExecutable 

Instances

Instances details
Bounded FileType Source # 
Instance details

Defined in Pantry.Types

Enum FileType Source # 
Instance details

Defined in Pantry.Types

Eq FileType Source # 
Instance details

Defined in Pantry.Types

Methods

(==) :: FileType -> FileType -> Bool

(/=) :: FileType -> FileType -> Bool

Show FileType Source # 
Instance details

Defined in Pantry.Types

Methods

showsPrec :: Int -> FileType -> ShowS

show :: FileType -> String

showList :: [FileType] -> ShowS

PersistField FileType Source # 
Instance details

Defined in Pantry.Types

Methods

toPersistValue :: FileType -> PersistValue

fromPersistValue :: PersistValue -> Either Text FileType

PersistFieldSql FileType Source # 
Instance details

Defined in Pantry.Types

Methods

sqlType :: Proxy FileType -> SqlType

SymbolToField "cabalType" Tree FileType 
Instance details

Defined in Pantry.Storage

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

hpackVersion :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => RIO env Version Source #

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 #