bdcs-0.1.0: Tools for managing a content store of software packages

Copyright(c) 2017 Red Hat Inc.
LicenseLGPL
Maintainerhttps://github.com/weldr
Stabilityalpha
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

BDCS.Scripts

Description

Manage Scripts records in the database. This record keeps track of a single script that is associated with a Groups record. A script is some arbitrary program that can be run at various points when installing, upgrading, or removing a piece of software. Not all packaging systems support this concept, and the BDCS only somewhat supports them at the moment.

Synopsis

Documentation

findScript Source #

Arguments

:: MonadIO m 
=> Text

The script type (generally, when it runs). This value is highly packaging system dependent.

-> Text

The script body

-> Maybe Text

The name of any trigger required to fire off this script. Most scripts do not use this, and many packaging systems do not support it.

-> Maybe Text

The script version, currently unused

-> Maybe Int

The script index, currently unused

-> Maybe Int

The script flags, currently unused

-> SqlPersistT m (Maybe (Key Scripts)) 

Find a single script in the database, returning the key for that script if it exists. It is possible for multiple very similar scripts to exist in the same database (or even, scripts with identical bodies but that differ in other ways) so additional information must be provided.

getScript :: MonadIO m => Key Scripts -> SqlPersistT m (Maybe Scripts) Source #

Given a key to a Scripts record in the database, return that record. This function is suitable for using on the result of findScript.

insertScript :: MonadIO m => Key Groups -> Scripts -> SqlPersistT m (Key GroupScripts) Source #

Conditionally add a new Scripts record to the database and associate a Groups record with it. If the association already exists, it is reused in creating the association. The database key of the association is returned. A single group can potentially have zero or many Scripts associated with it.