debian-4.0.5: Modules for working with the Debian package system
Safe HaskellSafe-Inferred
LanguageHaskell2010

Debian.Control.Policy

Description

Access to things that Debian policy says should be in a valid control file. The pure functions will not throw ControlFileError if they are operating on a DebianControl value returned by validateDebianControl. However, they might if they are created using unsafeDebianControl.

Synopsis

Validated debian control file type

data DebianControl Source #

Opaque (constructor not exported) type to hold a validated Debian Control File

validateDebianControl :: MonadCatch m => Control' Text -> m (Either ControlFileError DebianControl) Source #

Validate and return a control file in an opaque wrapper. May throw a ControlFileError. Currently we only verify that it has a Source field in the first paragraph and one or more subsequent paragraphs each with a Package field, and no syntax errors in the build dependencies (though they may be absent.)

data ControlFileError Source #

Errors that control files might throw, with source file name and line number generated by template haskell.

Constructors

NoParagraphs 

Fields

NoBinaryParagraphs 

Fields

MissingField 

Fields

ParseRelationsError 

Fields

ParseControlError 

Fields

IOError 

Fields

Class of things that contain one DebianControl value

class Show a => HasDebianControl a where Source #

Class of things that contain a validated Debian control file.

Instances

Instances details
HasDebianControl DebianControl Source # 
Instance details

Defined in Debian.Control.Policy

Pure functions that operate on validated control files

debianRelations :: HasDebianControl a => String -> a -> Either ControlFileError (Maybe Relations) Source #

This could access fields we haven't validated, so it can return an error. Additionally, the field might be absent, in which case it returns Nothing.