-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | A secure package manager for Arch Linux and the AUR.
--
-- Aura is a package manager for Arch Linux. It connects to both the
-- official Arch repostitories and to the AUR, allowing easy control of
-- all packages on an Arch system. It allows all pacman operations
-- and provides new custom ones for dealing with AUR packages.
-- This differs from some other AUR package managers.
@package aura
@version 3.2.2
-- | Annotate Doc text with various colours.
module Aura.Colour
-- | Render an assembled Doc into strict Text.
dtot :: Doc AnsiStyle -> Text
-- | Colour a Doc cyan.
cyan :: Doc AnsiStyle -> Doc AnsiStyle
-- | Colour a Doc cyan and bold.
bCyan :: Doc AnsiStyle -> Doc AnsiStyle
-- | Colour a Doc green.
green :: Doc AnsiStyle -> Doc AnsiStyle
-- | Colour a Doc yellow.
yellow :: Doc AnsiStyle -> Doc AnsiStyle
-- | Colour a Doc red.
red :: Doc AnsiStyle -> Doc AnsiStyle
-- | Colour a Doc magenta.
magenta :: Doc AnsiStyle -> Doc AnsiStyle
-- | Utility functions specific to Aura.
module Aura.Utils
-- | For regex-like find-and-replace in some Text.
data Pattern
Pattern :: !Text -> !Text -> Pattern
[_pattern] :: Pattern -> !Text
[_target] :: Pattern -> !Text
-- | Find lines which contain some given Text.
searchLines :: Text -> [Text] -> [Text]
-- | Assumes the given URL is correctly formatted.
urlContents :: Manager -> String -> IO (Maybe ByteString)
-- | Borrowed from semigroupoids.
foldMap1 :: Semigroup m => (a -> m) -> NonEmpty a -> m
-- | Borrowed from semigroupoids.
fold1 :: Semigroup m => NonEmpty m -> m
hush :: Either a b -> Maybe b
note :: a -> Maybe b -> Either a b
-- | Borrowed from Compactable.
fmapEither :: (a -> Either b c) -> [a] -> ([b], [c])
-- | Borrowed from Compactable.
traverseEither :: Applicative f => (a -> f (Either b c)) -> [a] -> f ([b], [c])
data These a b
This :: a -> These a b
That :: b -> These a b
These :: a -> b -> These a b
these :: (a -> t) -> (b -> t) -> (a -> b -> t) -> These a b -> t
-- | Edit some file in-place with the user's specified editor.
edit :: FilePath -> FilePath -> IO ()
-- | Simple Traversals compatible with both lens and microlens.
type Traversal' s a = forall f. Applicative f => (a -> f a) -> s -> f s
-- | maybe with the function at the end.
maybe' :: b -> Maybe a -> (a -> b) -> b
-- | Break a list into groups of n elements. The last item in the
-- result is not guaranteed to have the same length as the others.
groupsOf :: Int -> [a] -> [[a]]
nes :: Set a -> Maybe (NonEmpty a)
-- | Partition a NonEmpty based on some function.
partNonEmpty :: (a -> These b c) -> NonEmpty a -> These (NonEmpty b) (NonEmpty c)
instance (GHC.Base.Semigroup a, GHC.Base.Semigroup b) => GHC.Base.Semigroup (Aura.Utils.These a b)
instance Data.Bifunctor.Bifunctor Aura.Utils.These
-- | Core Aura types.
module Aura.Types
-- | A package to be installed.
data Package
FromRepo :: !Prebuilt -> Package
FromAUR :: !Buildable -> Package
-- | The name of a Package.
pname :: Package -> PkgName
-- | Other names which allow this Package to be satisfied as a
-- dependency.
pprov :: Package -> Provides
-- | The version of a Package.
pver :: Package -> Versioning
dividePkgs :: NonEmpty Package -> These (NonEmpty Prebuilt) (NonEmpty Buildable)
-- | A dependency on another package.
data Dep
Dep :: !PkgName -> !VersionDemand -> Dep
[dName] :: Dep -> !PkgName
[dDemand] :: Dep -> !VersionDemand
-- | Parse a dependency entry as it would appear in a PKGBUILD:
--
--
-- >>> parseDep "pacman>1.2.3"
-- Just (Dep {name = PkgName {name = "pacman"}, demand = >1.2.3})
--
parseDep :: Text -> Maybe Dep
-- | Renders the Dep into a form that pacman -T
-- understands. The dual of parseDep.
renderedDep :: Dep -> Text
-- | A Package from the AUR that's buildable in some way on the
-- user's machine.
data Buildable
Buildable :: !PkgName -> !Versioning -> !PkgName -> !Provides -> ![Dep] -> !Pkgbuild -> !Bool -> Buildable
[bName] :: Buildable -> !PkgName
[bVersion] :: Buildable -> !Versioning
[bBase] :: Buildable -> !PkgName
[bProvides] :: Buildable -> !Provides
[bDeps] :: Buildable -> ![Dep]
[bPkgbuild] :: Buildable -> !Pkgbuild
[bIsExplicit] :: Buildable -> !Bool
-- | A prebuilt Package from the official Arch repositories.
data Prebuilt
Prebuilt :: !PkgName -> !Versioning -> !PkgName -> !Provides -> Prebuilt
[pName] :: Prebuilt -> !PkgName
[pVersion] :: Prebuilt -> !Versioning
[pBase] :: Prebuilt -> !PkgName
[pProvides] :: Prebuilt -> !Provides
-- | A package name with its version number.
data SimplePkg
SimplePkg :: !PkgName -> !Versioning -> SimplePkg
[spName] :: SimplePkg -> !PkgName
[spVersion] :: SimplePkg -> !Versioning
-- | Attempt to create a SimplePkg from filepaths like
-- /var/cache/pacman/pkg/linux-3.2.14-1-x86_64.pkg.tar.xz
simplepkg :: PackagePath -> Maybe SimplePkg
-- | Attempt to create a SimplePkg from text like: xchat 2.8.8-19
simplepkg' :: Text -> Maybe SimplePkg
bToSP :: Buildable -> SimplePkg
pToSP :: Prebuilt -> SimplePkg
-- | Types whose members can be converted to CLI flags.
class Flagable a
asFlag :: Flagable a => a -> [Text]
-- | The versioning requirement of some package's dependency.
data VersionDemand
LessThan :: !Versioning -> VersionDemand
AtLeast :: !Versioning -> VersionDemand
MoreThan :: !Versioning -> VersionDemand
MustBe :: !Versioning -> VersionDemand
Anything :: VersionDemand
-- | Attempt to zoom into the Versioning hiding within a
-- VersionDemand.
_VersionDemand :: Traversal' VersionDemand Versioning
-- | The installation method.
data InstallType
Pacman :: !PkgName -> InstallType
Build :: !Buildable -> InstallType
-- | The various ways that dependency resolution can fail.
data DepError
NonExistant :: !PkgName -> !PkgName -> DepError
VerConflict :: !Doc AnsiStyle -> DepError
Ignored :: !Doc AnsiStyle -> DepError
BrokenProvides :: !PkgName -> !Provides -> !PkgName -> DepError
-- | Failures that can occur during Aura processing. Could be a message, or
-- a silent failure that should print nothing to the console.
data Failure
Silent :: Failure
Failure :: FailMsg -> Failure
-- | Some failure message that when given the current runtime
-- Language will produce a human-friendly error.
newtype FailMsg
FailMsg :: (Language -> Doc AnsiStyle) -> FailMsg
[failure] :: FailMsg -> Language -> Doc AnsiStyle
-- | All human languages available for text output.
data Language
English :: Language
Japanese :: Language
Polish :: Language
Croatian :: Language
Swedish :: Language
German :: Language
Spanish :: Language
Portuguese :: Language
French :: Language
Russian :: Language
Italian :: Language
Serbian :: Language
Norwegian :: Language
Indonesia :: Language
Chinese :: Language
Esperanto :: Language
Dutch :: Language
-- | The name of an Arch Linux package.
newtype PkgName
PkgName :: Text -> PkgName
[pnName] :: PkgName -> Text
-- | A group that a Package could belong too, like base,
-- base-devel, etc.
newtype PkgGroup
PkgGroup :: Text -> PkgGroup
[pgGroup] :: PkgGroup -> Text
-- | The dependency which some package provides. May not be the same name
-- as the package itself (e.g. cronie provides cron).
newtype Provides
Provides :: PkgName -> Provides
[provides] :: Provides -> PkgName
-- | Filepaths like:
--
--
-- - /var/cache/pacman/pkg/linux-3.2.14-1-x86_64.pkg.tar.xz
-- - /var/cache/pacman/pkg/wine-1.4rc6-1-x86_64.pkg.tar.xz
-- - /var/cache/pacman/pkg/ruby-1.9.3_p125-4-x86_64.pkg.tar.xz
--
data PackagePath
-- | Smart constructor for PackagePath.
packagePath :: FilePath -> Maybe PackagePath
ppPath :: PackagePath -> FilePath
-- | The contents of a PKGBUILD file.
newtype Pkgbuild
Pkgbuild :: ByteString -> Pkgbuild
[pkgbuild] :: Pkgbuild -> ByteString
-- | Shell environment variables.
type Environment = Map Text Text
-- | The name of a user account on a Linux system.
newtype User
User :: Text -> User
[user] :: User -> Text
instance GHC.Classes.Ord Aura.Types.VersionDemand
instance GHC.Classes.Eq Aura.Types.VersionDemand
instance GHC.Generics.Generic Aura.Types.PackagePath
instance GHC.Classes.Eq Aura.Types.PackagePath
instance GHC.Generics.Generic Aura.Types.Pkgbuild
instance GHC.Show.Show Aura.Types.Pkgbuild
instance GHC.Classes.Ord Aura.Types.Pkgbuild
instance GHC.Classes.Eq Aura.Types.Pkgbuild
instance GHC.Show.Show Aura.Types.Language
instance GHC.Classes.Ord Aura.Types.Language
instance GHC.Enum.Bounded Aura.Types.Language
instance GHC.Enum.Enum Aura.Types.Language
instance GHC.Classes.Eq Aura.Types.Language
instance GHC.Show.Show Aura.Types.Failure
instance GHC.Generics.Generic Aura.Types.User
instance GHC.Show.Show Aura.Types.User
instance GHC.Classes.Eq Aura.Types.User
instance Data.String.IsString Aura.Types.PkgName
instance Data.Aeson.Types.FromJSON.FromJSONKey Aura.Types.PkgName
instance Data.Aeson.Types.ToJSON.ToJSONKey Aura.Types.PkgName
instance Aura.Types.Flagable Aura.Types.PkgName
instance GHC.Generics.Generic Aura.Types.PkgName
instance GHC.Show.Show Aura.Types.PkgName
instance GHC.Classes.Ord Aura.Types.PkgName
instance GHC.Classes.Eq Aura.Types.PkgName
instance GHC.Generics.Generic Aura.Types.SimplePkg
instance GHC.Show.Show Aura.Types.SimplePkg
instance GHC.Classes.Ord Aura.Types.SimplePkg
instance GHC.Classes.Eq Aura.Types.SimplePkg
instance GHC.Generics.Generic Aura.Types.Dep
instance GHC.Show.Show Aura.Types.Dep
instance GHC.Classes.Ord Aura.Types.Dep
instance GHC.Classes.Eq Aura.Types.Dep
instance Aura.Types.Flagable Aura.Types.PkgGroup
instance GHC.Generics.Generic Aura.Types.PkgGroup
instance GHC.Show.Show Aura.Types.PkgGroup
instance GHC.Classes.Ord Aura.Types.PkgGroup
instance GHC.Classes.Eq Aura.Types.PkgGroup
instance GHC.Generics.Generic Aura.Types.Provides
instance GHC.Show.Show Aura.Types.Provides
instance GHC.Classes.Ord Aura.Types.Provides
instance GHC.Classes.Eq Aura.Types.Provides
instance GHC.Generics.Generic Aura.Types.Prebuilt
instance GHC.Show.Show Aura.Types.Prebuilt
instance GHC.Classes.Ord Aura.Types.Prebuilt
instance GHC.Classes.Eq Aura.Types.Prebuilt
instance GHC.Generics.Generic Aura.Types.Buildable
instance GHC.Show.Show Aura.Types.Buildable
instance GHC.Classes.Ord Aura.Types.Buildable
instance GHC.Classes.Eq Aura.Types.Buildable
instance GHC.Classes.Eq Aura.Types.InstallType
instance GHC.Classes.Eq Aura.Types.Package
instance GHC.Classes.Ord Aura.Types.Package
instance GHC.Classes.Ord Aura.Types.PackagePath
instance GHC.Exception.Type.Exception Aura.Types.Failure
instance GHC.Exception.Type.Exception Aura.Types.FailMsg
instance GHC.Show.Show Aura.Types.FailMsg
instance GHC.Show.Show Aura.Types.VersionDemand
instance Aura.Types.Flagable Data.Text.Internal.Text
instance (Data.Foldable.Foldable f, Aura.Types.Flagable a) => Aura.Types.Flagable (f a)
-- | Interaction with the terminal.
module Aura.Shell
-- | Code borrowed from `ansi-terminal` library by Max Bolingbroke.
csi :: [Int] -> ByteString -> ByteString
-- | Terminal code for raising the cursor.
cursorUpLineCode :: Int -> ByteString
-- | This will get the true user name regardless of sudo-ing.
getTrueUser :: Environment -> Maybe User
-- | Is the current user of Aura the true root user, and not just
-- a sudo user?
isTrueRoot :: Environment -> Bool
-- | Is the user root, or using sudo?
hasRootPriv :: Environment -> Bool
-- | vi is a sensible default, it should be installed by on any
-- Arch system.
getEditor :: Environment -> FilePath
-- | This will get the locale variable for translations from the
-- environment
getLocale :: Environment -> Text
-- | Mark some Path as being owned by a User.
chown :: MonadIO m => User -> FilePath -> [String] -> m ()
-- | Hide the cursor in a terminal.
hideCursor :: IO ()
-- | Restore a cursor to visiblity in the terminal.
showCursor :: IO ()
hideCursorCode :: ByteString
showCursorCode :: ByteString
-- | Raise the cursor by n lines.
raiseCursorBy :: Int -> IO ()
-- | Definition of the runtime environment.
module Aura.Settings
-- | The global settings as set by the user with command-line flags.
data Settings
Settings :: !Manager -> !Environment -> !Language -> !FilePath -> !Bool -> !Set PkgName -> !CommonConfig -> !BuildConfig -> !LogLevel -> !LogFunc -> Settings
[managerOf] :: Settings -> !Manager
[envOf] :: Settings -> !Environment
[langOf] :: Settings -> !Language
[editorOf] :: Settings -> !FilePath
[isTerminal] :: Settings -> !Bool
[ignoresOf] :: Settings -> !Set PkgName
[commonConfigOf] :: Settings -> !CommonConfig
[buildConfigOf] :: Settings -> !BuildConfig
[logLevelOf] :: Settings -> !LogLevel
[logFuncOf] :: Settings -> !LogFunc
logFuncOfL :: Lens' Settings LogFunc
-- | Settings unique to the AUR package building process.
data BuildConfig
BuildConfig :: !Set Makepkg -> !Maybe FilePath -> !Maybe User -> !Maybe FilePath -> !Maybe FilePath -> !Truncation -> !Set BuildSwitch -> BuildConfig
[makepkgFlagsOf] :: BuildConfig -> !Set Makepkg
[buildPathOf] :: BuildConfig -> !Maybe FilePath
[buildUserOf] :: BuildConfig -> !Maybe User
[allsourcePathOf] :: BuildConfig -> !Maybe FilePath
[vcsPathOf] :: BuildConfig -> !Maybe FilePath
[truncationOf] :: BuildConfig -> !Truncation
[buildSwitchesOf] :: BuildConfig -> !Set BuildSwitch
-- | Extra options for customizing the build process.
data BuildSwitch
AsDeps :: BuildSwitch
DeleteBuildDir :: BuildSwitch
DeleteMakeDeps :: BuildSwitch
DiffPkgbuilds :: BuildSwitch
DontSuppressMakepkg :: BuildSwitch
DryRun :: BuildSwitch
ForceBuilding :: BuildSwitch
HotEdit :: BuildSwitch
LowVerbosity :: BuildSwitch
NoPkgbuildCheck :: BuildSwitch
RebuildDevel :: BuildSwitch
SkipDepCheck :: BuildSwitch
SortAlphabetically :: BuildSwitch
buildPathOfL :: Lens' BuildConfig (Maybe FilePath)
buildUserOfL :: Lens' BuildConfig (Maybe User)
buildSwitchesOfL :: Lens' BuildConfig (Set BuildSwitch)
allsourcePathOfL :: Lens' BuildConfig (Maybe FilePath)
vcsPathOfL :: Lens' BuildConfig (Maybe FilePath)
-- | Is some Aura-specific setting turned on for this run?
switch :: Settings -> BuildSwitch -> Bool
-- | How -As should truncate its results.
data Truncation
None :: Truncation
Head :: !Word -> Truncation
Tail :: !Word -> Truncation
-- | Unless otherwise specified, packages will be built within
-- /tmp.
defaultBuildDir :: FilePath
-- | Flags that are common to both Aura and Pacman. Aura will react to
-- them, but also pass them through to pacman calls if
-- necessary.
data CommonConfig
CommonConfig :: !Either FilePath FilePath -> !Either FilePath FilePath -> !Either FilePath FilePath -> !Set CommonSwitch -> CommonConfig
[cachePathOf] :: CommonConfig -> !Either FilePath FilePath
[configPathOf] :: CommonConfig -> !Either FilePath FilePath
[logPathOf] :: CommonConfig -> !Either FilePath FilePath
[commonSwitchesOf] :: CommonConfig -> !Set CommonSwitch
-- | Yes/No-style switches that are common to both Aura and Pacman. Aura
-- acts on them first, then passes them down to pacman if
-- necessary.
data CommonSwitch
NoConfirm :: CommonSwitch
NeededOnly :: CommonSwitch
Debug :: CommonSwitch
Colour :: !ColourMode -> CommonSwitch
Overwrite :: !Text -> CommonSwitch
cachePathOfL :: Lens' CommonConfig (Either FilePath FilePath)
logPathOfL :: Lens' CommonConfig (Either FilePath FilePath)
-- | Matches Pacman's colour options. Auto will ensure that text
-- will only be coloured when the output target is a terminal.
data ColourMode
Never :: ColourMode
Always :: ColourMode
Auto :: ColourMode
-- | Is some Aura/Pacman common setting turned on for this run?
shared :: Settings -> CommonSwitch -> Bool
-- | CLI flags that will be passed down to makepkg when building
-- packages.
data Makepkg
IgnoreArch :: Makepkg
AllSource :: Makepkg
SkipInteg :: Makepkg
SkipPGP :: Makepkg
NoCheck :: Makepkg
instance GHC.Show.Show Aura.Settings.Truncation
instance GHC.Classes.Eq Aura.Settings.Truncation
instance GHC.Show.Show Aura.Settings.Makepkg
instance GHC.Classes.Ord Aura.Settings.Makepkg
instance GHC.Classes.Eq Aura.Settings.Makepkg
instance GHC.Show.Show Aura.Settings.ColourMode
instance GHC.Classes.Ord Aura.Settings.ColourMode
instance GHC.Classes.Eq Aura.Settings.ColourMode
instance GHC.Show.Show Aura.Settings.CommonSwitch
instance GHC.Classes.Ord Aura.Settings.CommonSwitch
instance GHC.Classes.Eq Aura.Settings.CommonSwitch
instance GHC.Generics.Generic Aura.Settings.CommonConfig
instance GHC.Show.Show Aura.Settings.CommonConfig
instance GHC.Show.Show Aura.Settings.BuildSwitch
instance GHC.Classes.Ord Aura.Settings.BuildSwitch
instance GHC.Classes.Eq Aura.Settings.BuildSwitch
instance GHC.Show.Show Aura.Settings.BuildConfig
instance GHC.Generics.Generic Aura.Settings.Settings
instance Aura.Types.Flagable Aura.Settings.CommonConfig
instance Aura.Types.Flagable Aura.Settings.CommonSwitch
instance Aura.Types.Flagable Aura.Settings.ColourMode
instance Aura.Types.Flagable Aura.Settings.Makepkg
-- | Handle the storing of PKGBUILDs.
module Aura.Pkgbuild.Records
-- | Does a given package has a PKGBUILD stored? This is True when a
-- package has been built successfully once before.
hasPkgbuildStored :: PkgName -> IO Bool
-- | Write the PKGBUILDs of some Buildables to disk.
storePkgbuilds :: NonEmpty Buildable -> IO ()
-- | The expected path to a stored PKGBUILD, given some package name.
pkgbuildPath :: PkgName -> FilePath
-- | The various fields for -Ai output.
module Aura.Languages.Fields
-- | All output strings that a user can be shown. All normal restrictions
-- on line length do not apply for this file, and this file only.
module Aura.Languages
-- | Thank you all!
translators :: Map Language Text
-- | Make some Text cyan. Previous wrapped things in backticks.
bt :: Pretty a => a -> Doc AnsiStyle
-- | User-facing input and output utilities.
module Aura.IO
-- | Print a Doc with Aura flair after performing a
-- colourCheck.
putStrLnA :: MonadIO m => Settings -> Doc AnsiStyle -> m ()
-- | Will remove all colour annotations if the user specified
-- --color=never.
putStrA :: MonadIO m => Settings -> Doc AnsiStyle -> m ()
-- | Strip colours from a Doc if --color=never is
-- specified, or if the output target isn't a terminal.
colourCheck :: Settings -> Doc ann -> Doc ann
putText :: MonadIO m => Text -> m ()
putTextLn :: MonadIO m => Text -> m ()
-- | Format two lists into two nice rows a la `-Qi` or `-Si`.
entrify :: Settings -> [Text] -> [Doc AnsiStyle] -> Doc AnsiStyle
-- | Right-pads strings according to the longest string in the group.
padding :: Settings -> [Text] -> [Text]
yesNoPrompt :: Settings -> Doc AnsiStyle -> IO Bool
-- | An empty response emplies "yes".
isAffirmative :: Language -> Text -> Bool
-- | Doesn't prompt when `--noconfirm` is used.
optionalPrompt :: Settings -> (Language -> Doc AnsiStyle) -> IO Bool
withOkay :: Settings -> (Language -> Doc AnsiStyle) -> (Language -> Doc AnsiStyle) -> RIO e a -> RIO e a
-- | Given a number of selections, allows the user to choose one.
getSelection :: Foldable f => (a -> Text) -> f a -> IO a
-- | Reading and searching the package cache.
module Aura.Cache
-- | Every package in the current cache, paired with its original filename.
newtype Cache
Cache :: Map SimplePkg PackagePath -> Cache
[_cache] :: Cache -> Map SimplePkg PackagePath
-- | Given a path to the package cache, yields its contents in a usable
-- form.
cacheContents :: FilePath -> IO Cache
-- | For manipulating the specifics of the cache cleaning process.
data CleanMode
Quantity :: CleanMode
AndUninstalled :: CleanMode
-- | The default location of the package cache: /var/cache/pacman/pkg/
defaultPackageCache :: FilePath
-- | Any entries (filepaths) in the cache that match a given Text.
cacheMatches :: Settings -> Text -> IO [PackagePath]
-- | All packages from a given Set who have a copy in the cache.
pkgsInCache :: Settings -> Set PkgName -> IO (Set PkgName)
instance GHC.Show.Show Aura.Cache.CleanMode
instance GHC.Classes.Eq Aura.Cache.CleanMode
-- | A simple parser for .conf files, along with types for aura-specific
-- config files.
module Aura.Settings.External
data AuraConfig
AuraConfig :: !Maybe Language -> !Maybe FilePath -> !Maybe User -> !Maybe FilePath -> !Maybe FilePath -> !Maybe FilePath -> !Maybe BuildSwitch -> AuraConfig
[acLang] :: AuraConfig -> !Maybe Language
[acEditor] :: AuraConfig -> !Maybe FilePath
[acUser] :: AuraConfig -> !Maybe User
[acBuildPath] :: AuraConfig -> !Maybe FilePath
[acASPath] :: AuraConfig -> !Maybe FilePath
[acVCSPath] :: AuraConfig -> !Maybe FilePath
[acAnalyse] :: AuraConfig -> !Maybe BuildSwitch
getAuraConf :: Environment -> IO Config
auraConfig :: Config -> AuraConfig
-- | The (meaningful) contents of a .conf file.
newtype Config
Config :: Map Text [Text] -> Config
-- | Parse a Config.
config :: Parsec Void Text Config
instance GHC.Show.Show Aura.Settings.External.AuraConfig
instance GHC.Show.Show Aura.Settings.External.Config
-- | An interface to pacman. Takes any pacman arguments and
-- applies it to pacman through the shell.
module Aura.Pacman
-- | Run a pacman action that may fail.
pacman :: Environment -> [Text] -> IO ()
-- | Runs pacman silently and returns only the stdout.
pacmanOutput :: Environment -> [Text] -> IO ByteString
-- | Run some pacman process, but only care about whether it
-- succeeded.
pacmanSuccess :: Environment -> [Text] -> IO Bool
-- | Runs pacman silently and returns the stdout as UTF8-decoded
-- Text lines.
pacmanLines :: Environment -> [Text] -> IO [Text]
-- | Default location of the pacman database lock file:
-- /var/lib/pacman/db.lck
lockFile :: FilePath
-- | Default location of the pacman config file: /etc/pacman.conf
pacmanConfFile :: FilePath
-- | Default location of the pacman log flie: /var/log/pacman.log
defaultLogFile :: FilePath
-- | Fetches the CacheDir entry from the config, if it's there.
getCachePath :: Config -> Maybe FilePath
-- | Fetches the LogFile entry from the config, if it's there.
getLogFilePath :: Config -> Maybe FilePath
-- | Given a filepath to the pacman config, try to parse its contents.
getPacmanConf :: FilePath -> IO (Either Failure Config)
-- | Fetches the IgnorePkg entry from the config, if it's there.
getIgnoredPkgs :: Config -> Set PkgName
-- | Fetches the IgnoreGroup entry from the config, if it's there.
getIgnoredGroups :: Config -> Set PkgGroup
-- | Given a Set of package groups, yield all the packages they
-- contain.
groupPackages :: Environment -> NonEmpty PkgGroup -> IO (Set PkgName)
-- | Yields the lines given by `pacman -V` with the pacman image stripped.
versionInfo :: Environment -> IO [Text]
-- | The amount of whitespace before text in the lines given by `pacman -V`
verMsgPad :: Int
-- | Print an animated AURA version message.
module Aura.Logo
-- | Show an animated version message, but only when the output target is a
-- terminal.
animateVersionMsg :: Settings -> Text -> [Text] -> IO ()
instance GHC.Classes.Eq Aura.Logo.MouthState
-- | Analyse PKGBUILDs for potentially malicious bash code.
module Aura.Pkgbuild.Security
-- | A bash term which should never appear in a PKGBUILD. If one does, it's
-- either a sign of maintainer negligence or malicious behaviour.
data BannedTerm
BannedTerm :: !Text -> !BanCategory -> BannedTerm
-- | The reason why the bash term is black-listed.
data BanCategory
Downloading :: BanCategory
ScriptRunning :: BanCategory
Permissions :: BanCategory
InlinedBash :: BanCategory
StrangeBashism :: BanCategory
CleverRedirect :: BanCategory
-- | Attempt to parse a PKGBUILD. Should succeed for all reasonable
-- PKGBUILDs.
parsedPB :: Pkgbuild -> Maybe List
-- | Discover any banned terms lurking in a parsed PKGBUILD, paired with
-- the surrounding context lines.
bannedTerms :: List -> [(ShellCommand, BannedTerm)]
-- | Dispatch different error messages depending on the category of a
-- BannedTerm.
reportExploit :: BannedTerm -> Language -> Doc AnsiStyle
instance GHC.Show.Show Aura.Pkgbuild.Security.BanCategory
instance GHC.Classes.Ord Aura.Pkgbuild.Security.BanCategory
instance GHC.Classes.Eq Aura.Pkgbuild.Security.BanCategory
instance GHC.Generics.Generic Aura.Pkgbuild.Security.BannedTerm
instance GHC.Show.Show Aura.Pkgbuild.Security.BannedTerm
instance GHC.Classes.Ord Aura.Pkgbuild.Security.BannedTerm
instance GHC.Classes.Eq Aura.Pkgbuild.Security.BannedTerm
-- | Query the AUR for a package's PKGBUILD.
module Aura.Pkgbuild.Fetch
-- | The PKGBUILD of a given package, retrieved from the AUR servers.
getPkgbuild :: Manager -> PkgName -> IO (Maybe Pkgbuild)
-- | The location of a given package's PKGBUILD on the AUR servers.
pkgbuildUrl :: String -> String
-- | Interface to makepkg.
module Aura.MakePkg
-- | Given the current user name, build the package of whatever directory
-- we're in.
makepkg :: Settings -> User -> IO (Either Failure (NonEmpty FilePath))
-- | Make a source package. See `man makepkg` and grep for `--allsource`.
makepkgSource :: User -> IO [FilePath]
-- | Core types and functions which belong nowhere else.
module Aura.Core
-- | The complete Aura runtime environment. Repository has internal
-- caches instantiated in IO, while Settings is mostly
-- static and derived from command-line arguments.
data Env
Env :: !Repository -> !Settings -> Env
[repository] :: Env -> !Repository
[settings] :: Env -> !Settings
-- | A Repository is a place where packages may be fetched from.
-- Multiple repositories can be combined with the Semigroup
-- instance. Checks packages in batches for efficiency.
data Repository
Repository :: !TVar (Map PkgName Package) -> (Settings -> NonEmpty PkgName -> IO (Maybe (Set PkgName, Set Package))) -> Repository
[repoCache] :: Repository -> !TVar (Map PkgName Package)
[repoLookup] :: Repository -> Settings -> NonEmpty PkgName -> IO (Maybe (Set PkgName, Set Package))
liftMaybeM :: (MonadThrow m, Exception e) => e -> m (Maybe a) -> m a
-- | Action won't be allowed unless user is root, or using sudo.
sudo :: RIO Env a -> RIO Env a
-- | Stop the user if they are the true root. Building as root isn't
-- allowed since makepkg v4.2.
trueRoot :: RIO Env a -> RIO Env a
-- | A list of non-prebuilt packages installed on the system. -Qm
-- yields a list of sorted values.
foreignPackages :: Environment -> IO (Set SimplePkg)
-- | Packages marked as a dependency, yet are required by no other package.
orphans :: Environment -> IO (Set PkgName)
-- | Any installed package whose name is suffixed by git, hg, svn, darcs,
-- cvs, or bzr.
develPkgs :: Environment -> IO (Set PkgName)
-- | Is a package suffixed by git, hg, svn, darcs, cvs, or bzr?
isDevelPkg :: PkgName -> Bool
-- | Depedencies which are not installed, or otherwise provided by some
-- installed package.
newtype Unsatisfied
Unsatisfied :: NonEmpty Dep -> Unsatisfied
-- | The opposite of Unsatisfied.
newtype Satisfied
Satisfied :: NonEmpty Dep -> Satisfied
-- | Similar to isSatisfied, but dependencies are checked in a
-- batch, since -T can accept multiple inputs.
areSatisfied :: Environment -> NonEmpty Dep -> IO (These Unsatisfied Satisfied)
-- | Returns what it was given if the package is already installed.
-- Reasoning: Using raw bools can be less expressive.
isInstalled :: Environment -> PkgName -> IO (Maybe PkgName)
-- | Block further action until the database is free.
checkDBLock :: Settings -> IO ()
-- | An -Rsu call.
removePkgs :: NonEmpty PkgName -> RIO Env ()
-- | Partition a list of packages into pacman and buildable groups. Yes,
-- this is the correct signature. As far as this function (in isolation)
-- is concerned, there is no way to guarantee that the list of
-- NonEmptys will itself be non-empty.
partitionPkgs :: NonEmpty (NonEmpty Package) -> ([Prebuilt], [NonEmpty Buildable])
-- | Given two filepaths, output the diff of the two files. Output will be
-- coloured unless colour is deactivated by `--color never` or by
-- detection of a non-terminal output target.
diff :: MonadIO m => Settings -> FilePath -> FilePath -> m ()
-- | Print some message in green with Aura flair.
notify :: MonadIO m => Settings -> (Language -> Doc AnsiStyle) -> m ()
-- | Print some message in yellow with Aura flair.
warn :: MonadIO m => Settings -> (Language -> Doc AnsiStyle) -> m ()
-- | Print some message in red with Aura flair.
scold :: MonadIO m => Settings -> (Language -> Doc AnsiStyle) -> m ()
-- | Report a message with multiple associated items. Usually a list of
-- naughty packages.
report :: (Doc AnsiStyle -> Doc AnsiStyle) -> (Language -> Doc AnsiStyle) -> NonEmpty PkgName -> RIO Env ()
instance GHC.Generics.Generic Aura.Core.Env
instance RIO.Prelude.Logger.HasLogFunc Aura.Core.Env
instance GHC.Base.Semigroup Aura.Core.Repository
-- | Handle the saving and restoring of installed package states.
module Aura.State
-- | All packages installed at some specific ZonedTime. Any "pinned"
-- PkgState will never be deleted by `-Bc`.
data PkgState
PkgState :: !ZonedTime -> !Bool -> !Map PkgName Versioning -> PkgState
[timeOf] :: PkgState -> !ZonedTime
[pinnedOf] :: PkgState -> !Bool
[pkgsOf] :: PkgState -> !Map PkgName Versioning
-- | Save a package state. In writing the first state file, the
-- states directory is created automatically.
saveState :: Settings -> IO ()
-- | Does its best to restore a state chosen by the user.
restoreState :: RIO Env ()
-- | Does a given package have an entry in a particular PkgState?
inState :: SimplePkg -> PkgState -> Bool
-- | Given a FilePath to a package state file, attempt to read and
-- parse its contents. As of Aura 2.0, only state files in JSON format
-- are accepted.
readState :: FilePath -> IO (Maybe PkgState)
-- | The default location of all saved states: /var/cache/aura/states
stateCache :: FilePath
-- | The filepaths of every saved package state.
getStateFiles :: IO [FilePath]
instance Data.Aeson.Types.ToJSON.ToJSON Aura.State.PkgState
instance Data.Aeson.Types.FromJSON.FromJSON Aura.State.PkgState
-- | Code common to the analysis and display of PKGBUILD security issues.
module Aura.Security
-- | Determine if a package's PKGBUILD might contain malicious bash code.
analysePkgbuild :: Buildable -> RIO Env ()
displayBannedTerms :: Settings -> (ShellCommand, BannedTerm) -> IO ()
-- | Handle the testing and dependency solving of official repository
-- packages.
module Aura.Packages.Repository
-- | Repository package source. We expect no matches to be found when the
-- package is actually an AUR package.
pacmanRepo :: IO Repository
-- | Parses the version number of a package from the result of a pacman
-- -Si call.
extractVersion :: Text -> Maybe Versioning
-- | Module for connecting to the AUR servers, downloading PKGBUILDs and
-- package sources.
module Aura.Packages.AUR
-- | Attempt to retrieve info about a given Set of packages from the
-- AUR.
aurLookup :: Manager -> NonEmpty PkgName -> IO (Maybe (Set PkgName, Set Buildable))
-- | Yield fully realized Packages from the AUR.
aurRepo :: IO Repository
-- | Frontend to the aur library. For -Ai.
aurInfo :: NonEmpty PkgName -> RIO Env [AurInfo]
-- | Frontend to the aur library. For -As.
aurSearch :: Text -> RIO Env [AurInfo]
sortAurInfo :: Settings -> [AurInfo] -> [AurInfo]
-- | Attempt to freshly clone a package source from the AUR.
clone :: Buildable -> IO (Maybe FilePath)
-- | A package's home URL on the AUR.
pkgUrl :: PkgName -> Text
-- | Library for handling package dependencies and version conflicts.
module Aura.Dependencies
-- | Given some Packages, determine its full dependency graph. The
-- graph is collapsed into layers of packages which are not
-- interdependent, and thus can be built and installed as a group.
--
-- Deeper layers of the result list (generally) depend on the previous
-- layers.
resolveDeps :: Repository -> NonEmpty Package -> RIO Env (NonEmpty (NonEmpty Package))
instance GHC.Generics.Generic Aura.Dependencies.Resolution
-- | Agnostically builds packages, regardless of original source.
module Aura.Build
-- | Expects files like: /var/cache/pacman/pkg/*.pkg.tar.xz
installPkgFiles :: NonEmpty PackagePath -> RIO Env ()
-- | All building occurs within temp directories, or in a location
-- specified by the user with flags.
buildPackages :: NonEmpty Buildable -> RIO Env [PackagePath]
-- | Storage location for "source" packages built with
-- --allsource. Can be overridden in config or with
-- --allsourcepath.
srcPkgStore :: FilePath
-- | Storage/build location for VCS packages like
-- cool-retroterm-git. Some of these packages are quite large
-- (e.g. kernels), and so recloning them in their entirety upon each
-- -Au is wasteful.
vcsStore :: FilePath
-- | Layer for AUR package installation. Backend for A.
module Aura.Install
-- | High level install command. Handles installing dependencies.
install :: NonEmpty PkgName -> RIO Env ()
-- | Display dependencies. The result of -Ad.
displayPkgDeps :: NonEmpty PkgName -> RIO Env ()