Copyright | (c) Colin Woodbury 2012 - 2018 |
---|---|
License | GPL3 |
Maintainer | Colin Woodbury <colin@fosskers.ca> |
Safe Haskell | None |
Language | Haskell2010 |
An interface to pacman
.
Takes any pacman arguments and applies it to pacman through the shell.
Synopsis
- pacman :: [String] -> IO (Either Failure ())
- pacmanOutput :: [String] -> IO ByteString
- pacmanSuccess :: [String] -> IO Bool
- lockFile :: Path Absolute
- pacmanConfFile :: Path Absolute
- defaultLogFile :: Path Absolute
- getCachePath :: Config -> Maybe (Path Absolute)
- getLogFilePath :: Config -> Maybe (Path Absolute)
- newtype Config = Config (Map Text [Text])
- config :: Parsec Void Text Config
- getPacmanConf :: Path Absolute -> IO (Either Failure Config)
- getIgnoredPkgs :: Config -> Set PkgName
- getIgnoredGroups :: Config -> Set PkgGroup
- groupPackages :: NonEmptySet PkgGroup -> IO (Set PkgName)
- getVersionInfo :: IO [Text]
- verMsgPad :: Int64
Calling Pacman
pacman :: [String] -> IO (Either Failure ()) Source #
Run a pacman action that may fail. Will never throw an IO exception.
pacmanOutput :: [String] -> IO ByteString Source #
Runs pacman silently and returns only the stdout.
pacmanSuccess :: [String] -> IO Bool Source #
Run some pacman
process, but only care about whether it succeeded.
Paths
lockFile :: Path Absolute Source #
Default location of the pacman database lock file: /var/lib/pacman/db.lck
pacmanConfFile :: Path Absolute Source #
Default location of the pacman config file: /etc/pacman.conf
defaultLogFile :: Path Absolute Source #
Default location of the pacman log flie: /var/log/pacman.log
getCachePath :: Config -> Maybe (Path Absolute) Source #
Fetches the CacheDir
entry from the config, if it's there.
getLogFilePath :: Config -> Maybe (Path Absolute) Source #
Fetches the LogFile
entry from the config, if it's there.
Pacman Config
The (meaningful) contents of the Pacman config file.
getPacmanConf :: Path Absolute -> IO (Either Failure Config) Source #
Given a filepath to the pacman config, try to parse its contents.
getIgnoredPkgs :: Config -> Set PkgName Source #
Fetches the IgnorePkg
entry from the config, if it's there.
getIgnoredGroups :: Config -> Set PkgGroup Source #
Fetches the IgnoreGroup
entry from the config, if it's there.
groupPackages :: NonEmptySet PkgGroup -> IO (Set PkgName) Source #
Given a Set
of package groups, yield all the packages they contain.
Misc.
getVersionInfo :: IO [Text] Source #
Yields the lines given by `pacman -V` with the pacman image stripped.