Safe Haskell | None |
---|---|
Language | Haskell2010 |
Exposed for testing, do not use!
Synopsis
- parseTree :: ByteString -> Maybe Tree
- renderTree :: Tree -> ByteString
- newtype Tree = TreeMap (Map SafeFilePath TreeEntry)
- data TreeEntry = TreeEntry {}
- mkSafeFilePath :: Text -> Maybe SafeFilePath
- pcHpackExecutable :: PantryConfig -> HpackExecutable
- normalizeParents :: FilePath -> Either String FilePath
- makeTarRelative :: FilePath -> FilePath -> Either String FilePath
- getGlobalHintsFile :: HasPantryConfig env => RIO env (Path Abs File)
- hpackVersion :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => RIO env Version
- data Storage
- initStorage :: HasLogFunc env => Text -> Migration -> Path Abs File -> (Storage -> RIO env a) -> RIO env a
- withStorage_ :: Storage -> forall env a. HasLogFunc env => ReaderT SqlBackend (RIO env) a -> RIO env a
Documentation
renderTree :: Tree -> ByteString Source #
Represents the contents of a tree, which is a mapping from
relative file paths to TreeEntry
s.
Since: 0.1.0.0
mkSafeFilePath :: Text -> Maybe SafeFilePath Source #
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
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 #
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.
withStorage_ :: Storage -> forall env a. HasLogFunc env => ReaderT SqlBackend (RIO env) a -> RIO env a Source #