aura-2.0.2: A secure package manager for Arch Linux and the AUR, written in Haskell.

Copyright(c) Colin Woodbury 2012 - 2019
LicenseGPL3
MaintainerColin Woodbury <colin@fosskers.ca>
Safe HaskellNone
LanguageHaskell2010

Aura.Core

Contents

Description

Core types and functions which belong nowhere else.

Synopsis

Types

data Env Source #

The complete Aura runtime environment. Repository has internal caches instantiated in IO, while Settings is mostly static and derived from command-line arguments.

Constructors

Env 

data Repository Source #

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.

liftEither :: (Carrier sig m, Member (Error a) sig) => Either a b -> m b Source #

Lift a common return type into the `fused-effects` world. Usually used after a pacman call.

liftEitherM :: (Carrier sig m, Member (Error a) sig) => m (Either a b) -> m b Source #

Like liftEither, but the Either can be embedded in something else, usually a Monad.

liftMaybe :: (Carrier sig m, Member (Error a) sig) => a -> Maybe b -> m b Source #

Like liftEither, but for Maybe.

liftMaybeM :: (Carrier sig m, Member (Error a) sig) => a -> m (Maybe b) -> m b Source #

Like liftEitherM, but for Maybe.

User Privileges

sudo :: (Carrier sig m, Member (Reader Env) sig, Member (Error Failure) sig) => m a -> m a Source #

Action won't be allowed unless user is root, or using sudo.

trueRoot :: (Carrier sig m, Member (Reader Env) sig, Member (Error Failure) sig) => m a -> m a Source #

Stop the user if they are the true root. Building as root isn't allowed since makepkg v4.2.

Querying the Package Database

foreignPackages :: IO (Set SimplePkg) Source #

A list of non-prebuilt packages installed on the system. `-Qm` yields a list of sorted values.

orphans :: IO (Set PkgName) Source #

Packages marked as a dependency, yet are required by no other package.

develPkgs :: IO (Set PkgName) Source #

Any package whose name is suffixed by git, hg, svn, darcs, cvs, or bzr.

newtype Unsatisfied Source #

Depedencies which are not installed, or otherwise provided by some installed package.

Constructors

Unsatisfied (NESet Dep) 

newtype Satisfied Source #

The opposite of Unsatisfied.

Constructors

Satisfied (NESet Dep) 

areSatisfied :: NESet Dep -> IO (These Unsatisfied Satisfied) Source #

Similar to isSatisfied, but dependencies are checked in a batch, since -T can accept multiple inputs.

isInstalled :: PkgName -> IO (Maybe PkgName) Source #

Returns what it was given if the package is already installed. Reasoning: Using raw bools can be less expressive.

checkDBLock :: Settings -> IO () Source #

Block further action until the database is free.

Misc. Package Handling

removePkgs :: (Carrier sig m, Member (Reader Env) sig, Member (Error Failure) sig, Member (Lift IO) sig) => NESet PkgName -> m () Source #

An -Rsu call.

partitionPkgs :: NonEmpty (NESet Package) -> ([Prebuilt], [NESet Buildable]) Source #

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 NESets will itself be non-empty.

packageBuildable :: Settings -> Buildable -> IO Package Source #

Package a Buildable, running the customization handler first.

IO

notify :: Settings -> Doc AnsiStyle -> IO () Source #

Print some message in green with Aura flair.

warn :: Settings -> Doc AnsiStyle -> IO () Source #

Print some message in yellow with Aura flair.

scold :: Settings -> Doc AnsiStyle -> IO () Source #

Print some message in red with Aura flair.

report :: (Carrier sig m, Member (Reader Env) sig, Member (Lift IO) sig) => (Doc AnsiStyle -> Doc AnsiStyle) -> (Language -> Doc AnsiStyle) -> NonEmpty PkgName -> m () Source #

Report a message with multiple associated items. Usually a list of naughty packages.