aura-2.3.0: A secure package manager for Arch Linux and the AUR.

Copyright(c) Colin Woodbury 2012 - 2020
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 
Instances
Generic Env Source # 
Instance details

Defined in Aura.Core

Associated Types

type Rep Env :: Type -> Type #

Methods

from :: Env -> Rep Env x #

to :: Rep Env x -> Env #

HasLogFunc Env Source # 
Instance details

Defined in Aura.Core

type Rep Env Source # 
Instance details

Defined in Aura.Core

type Rep Env = D1 (MetaData "Env" "Aura.Core" "aura-2.3.0-8xHX63F6OjrJKAMWE3RFwt" False) (C1 (MetaCons "Env" PrefixI True) (S1 (MetaSel (Just "repository") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Repository) :*: S1 (MetaSel (Just "settings") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Settings)))

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.

liftMaybeM :: (MonadThrow m, Exception e) => e -> m (Maybe a) -> m a Source #

User Privileges

sudo :: RIO Env a -> RIO Env a Source #

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

trueRoot :: RIO Env a -> RIO Env 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 (NonEmpty Dep) 

newtype Satisfied Source #

The opposite of Unsatisfied.

Constructors

Satisfied (NonEmpty Dep) 

areSatisfied :: NonEmpty 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 :: NonEmpty PkgName -> RIO Env () Source #

An -Rsu call.

partitionPkgs :: NonEmpty (NonEmpty Package) -> ([Prebuilt], [NonEmpty 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 NonEmptys will itself be non-empty.

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

Package a Buildable, running the customization handler first.

IO

notify :: MonadIO m => Settings -> (Language -> Doc AnsiStyle) -> m () Source #

Print some message in green with Aura flair.

warn :: MonadIO m => Settings -> (Language -> Doc AnsiStyle) -> m () Source #

Print some message in yellow with Aura flair.

scold :: MonadIO m => Settings -> (Language -> Doc AnsiStyle) -> m () Source #

Print some message in red with Aura flair.

report :: (Doc AnsiStyle -> Doc AnsiStyle) -> (Language -> Doc AnsiStyle) -> NonEmpty PkgName -> RIO Env () Source #

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