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

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

Aura.Core

Contents

Description

Core types and functions which belong nowhere else.

Synopsis

Types

newtype 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 :: Member (Error a) r => Either a b -> Eff r b Source #

Lift a common return type into the Eff world. Usually used after a pacman call.

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

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

liftMaybe :: Member (Error a) r => a -> Maybe b -> Eff r b Source #

Like liftEither, but for Maybe.

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

Like liftEitherM, but for Maybe.

User Privileges

sudo :: (Member (Reader Settings) r, Member (Error Failure) r) => Eff r a -> Eff r a Source #

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

trueRoot :: (Member (Reader Settings) r, Member (Error Failure) r) => Eff r a -> Eff r 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.

isSatisfied :: Dep -> IO Bool Source #

True if a dependency is satisfied by an installed package. asT renders the VersionDemand into the specific form that `pacman -T` understands. See `man pacman` for more info.

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

partitionPkgs :: NonEmpty (NonEmptySet Package) -> ([Prebuilt], [NonEmptySet 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 NonEmptySets 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 :: (Member (Reader Settings) r, Member IO r) => (Doc AnsiStyle -> Doc AnsiStyle) -> (Language -> Doc AnsiStyle) -> NonEmpty PkgName -> Eff r () Source #

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