debian-4.1.2: Modules for working with the Debian package system

Safe Haskell | None
Language | Haskell2010

Debian.Relation

Contents

- Types
- Helper Functions
- Relation Parser

Description

A module for working with debian relationships http://www.debian.org/doc/debian-policy/ch-relationships.html

Synopsis

- class Pretty (PP a) => PkgName a where
  - pkgNameFromString :: String -> a
- newtype SrcPkgName = SrcPkgName {
  - unSrcPkgName :: String
  }
- newtype BinPkgName = BinPkgName {
  - unBinPkgName :: String
  }
- type Relations = AndRelation
- type AndRelation = [OrRelation]
- type OrRelation = [Relation]
- data Relation where
  - RRel BinPkgName (Maybe VersionReq) (Maybe ArchitectureReq) [RestrictionList]
  - pattern Rel :: BinPkgName -> Maybe VersionReq -> Maybe ArchitectureReq -> Relation
- data ArchitectureReq
  - = ArchOnly (Set Arch)
  - | ArchExcept (Set Arch)
- data Arch
  - = Source
  - | All
  - | Binary ArchOS ArchCPU
- data ArchOS
  - = ArchOS String
  - | ArchOSAny
- data ArchCPU
  - = ArchCPU String
  - | ArchCPUAny
- data VersionReq
  - = SLT DebianVersion
  - | LTE DebianVersion
  - | EEQ DebianVersion
  - | GRE DebianVersion
  - | SGR DebianVersion
- type RestrictionList = OMap String Bool
- checkVersionReq :: Maybe VersionReq -> Maybe DebianVersion -> Bool
- type RelParser a = CharParser () a
- class ParseRelations a where
  - parseRelations :: a -> Either ParseError Relations

# Types

class Pretty (PP a) => PkgName a where Source #

Methods

pkgNameFromString :: String -> a Source #

#### Instances

Instances details

PkgName BinPkgName Source # |
Instance details Defined in Debian.Relation.Common Methods pkgNameFromString :: String -> BinPkgName Source #
PkgName SrcPkgName Source # |
Instance details Defined in Debian.Relation.Common Methods pkgNameFromString :: String -> SrcPkgName Source #

newtype SrcPkgName Source #

Constructors

SrcPkgName |

Fields

- unSrcPkgName :: String

#### Instances

Instances details

PkgName SrcPkgName Source # |
Instance details Defined in Debian.Relation.Common Methods pkgNameFromString :: String -> SrcPkgName Source #
Data SrcPkgName Source # |

Instance details

Defined in Debian.Relation.Common

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SrcPkgName -> c SrcPkgName Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SrcPkgName Source #

toConstr :: SrcPkgName -> Constr Source #

dataTypeOf :: SrcPkgName -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SrcPkgName) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SrcPkgName) Source #

gmapT :: (forall b. Data b => b -> b) -> SrcPkgName -> SrcPkgName Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SrcPkgName -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SrcPkgName -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> SrcPkgName -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SrcPkgName -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SrcPkgName -> m SrcPkgName Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SrcPkgName -> m SrcPkgName Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SrcPkgName -> m SrcPkgName Source #

Read SrcPkgName Source # |
Instance details Defined in Debian.Relation.Common Methods readsPrec :: Int -> ReadS SrcPkgName Source # readList :: ReadS [SrcPkgName] Source # readPrec :: ReadPrec SrcPkgName Source # readListPrec :: ReadPrec [SrcPkgName] Source #
Show SrcPkgName Source # |
Instance details Defined in Debian.Relation.Common Methods showsPrec :: Int -> SrcPkgName -> ShowS Source # show :: SrcPkgName -> String Source # showList :: [SrcPkgName] -> ShowS Source #
Eq SrcPkgName Source # |
Instance details Defined in Debian.Relation.Common Methods (==) :: SrcPkgName -> SrcPkgName -> Bool Source # (/=) :: SrcPkgName -> SrcPkgName -> Bool Source #
Ord SrcPkgName Source # |

Instance details

Defined in Debian.Relation.Common

Methods

compare :: SrcPkgName -> SrcPkgName -> Ordering Source #

(<) :: SrcPkgName -> SrcPkgName -> Bool Source #

(<=) :: SrcPkgName -> SrcPkgName -> Bool Source #

(>) :: SrcPkgName -> SrcPkgName -> Bool Source #

(>=) :: SrcPkgName -> SrcPkgName -> Bool Source #

max :: SrcPkgName -> SrcPkgName -> SrcPkgName Source #

min :: SrcPkgName -> SrcPkgName -> SrcPkgName Source #

Pretty (PP SrcPkgName) Source # |
Instance details Defined in Debian.Relation.Common Methods pretty :: PP SrcPkgName -> Doc Source # prettyVersioned :: CabalSpecVersion -> PP SrcPkgName -> Doc Source #

newtype BinPkgName Source #

Constructors

BinPkgName |

Fields

- unBinPkgName :: String

#### Instances

Instances details

PkgName BinPkgName Source # |
Instance details Defined in Debian.Relation.Common Methods pkgNameFromString :: String -> BinPkgName Source #
Data BinPkgName Source # |

Instance details

Defined in Debian.Relation.Common

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BinPkgName -> c BinPkgName Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BinPkgName Source #

toConstr :: BinPkgName -> Constr Source #

dataTypeOf :: BinPkgName -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BinPkgName) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BinPkgName) Source #

gmapT :: (forall b. Data b => b -> b) -> BinPkgName -> BinPkgName Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BinPkgName -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BinPkgName -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> BinPkgName -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> BinPkgName -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> BinPkgName -> m BinPkgName Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BinPkgName -> m BinPkgName Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BinPkgName -> m BinPkgName Source #

Read BinPkgName Source # |
Instance details Defined in Debian.Relation.Common Methods readsPrec :: Int -> ReadS BinPkgName Source # readList :: ReadS [BinPkgName] Source # readPrec :: ReadPrec BinPkgName Source # readListPrec :: ReadPrec [BinPkgName] Source #
Show BinPkgName Source # |
Instance details Defined in Debian.Relation.Common Methods showsPrec :: Int -> BinPkgName -> ShowS Source # show :: BinPkgName -> String Source # showList :: [BinPkgName] -> ShowS Source #
Eq BinPkgName Source # |
Instance details Defined in Debian.Relation.Common Methods (==) :: BinPkgName -> BinPkgName -> Bool Source # (/=) :: BinPkgName -> BinPkgName -> Bool Source #
Ord BinPkgName Source # |

Instance details

Defined in Debian.Relation.Common

Methods

compare :: BinPkgName -> BinPkgName -> Ordering Source #

(<) :: BinPkgName -> BinPkgName -> Bool Source #

(<=) :: BinPkgName -> BinPkgName -> Bool Source #

(>) :: BinPkgName -> BinPkgName -> Bool Source #

(>=) :: BinPkgName -> BinPkgName -> Bool Source #

max :: BinPkgName -> BinPkgName -> BinPkgName Source #

min :: BinPkgName -> BinPkgName -> BinPkgName Source #

Pretty (PP BinPkgName) Source # |
Instance details Defined in Debian.Relation.Common Methods pretty :: PP BinPkgName -> Doc Source # prettyVersioned :: CabalSpecVersion -> PP BinPkgName -> Doc Source #

type Relations = AndRelation Source #

type AndRelation = [OrRelation] Source #

type OrRelation = [Relation] Source #

data Relation Source #

Constructors

RRel BinPkgName (Maybe VersionReq) (Maybe ArchitectureReq) [RestrictionList] |

Bundled Patterns

pattern Rel :: BinPkgName -> Maybe VersionReq -> Maybe ArchitectureReq -> Relation | Deprecated: Switch to RRel

#### Instances

Instances details

Read Relation Source # |
Instance details Defined in Debian.Relation.Common Methods readsPrec :: Int -> ReadS Relation Source # readList :: ReadS [Relation] Source # readPrec :: ReadPrec Relation Source # readListPrec :: ReadPrec [Relation] Source #
Show Relation Source # |
Instance details Defined in Debian.Relation.Common Methods showsPrec :: Int -> Relation -> ShowS Source # show :: Relation -> String Source # showList :: [Relation] -> ShowS Source #
Eq Relation Source # |
Instance details Defined in Debian.Relation.Common Methods (==) :: Relation -> Relation -> Bool Source # (/=) :: Relation -> Relation -> Bool Source #
Ord Relation Source # |
Instance details Defined in Debian.Relation.Common Methods compare :: Relation -> Relation -> Ordering Source # (<) :: Relation -> Relation -> Bool Source # (<=) :: Relation -> Relation -> Bool Source # (>) :: Relation -> Relation -> Bool Source # (>=) :: Relation -> Relation -> Bool Source # max :: Relation -> Relation -> Relation Source # min :: Relation -> Relation -> Relation Source #
Pretty (PP OrRelation) Source # |
Instance details Defined in Debian.Relation.Common Methods pretty :: PP OrRelation -> Doc Source # prettyVersioned :: CabalSpecVersion -> PP OrRelation -> Doc Source #
Pretty (PP Relation) Source # |
Instance details Defined in Debian.Relation.Common Methods pretty :: PP Relation -> Doc Source # prettyVersioned :: CabalSpecVersion -> PP Relation -> Doc Source #
Pretty (PP Relations) Source # | Wrap `PP` around type synonyms that might overlap with the `Pretty [a]` instance.
Instance details Defined in Debian.Relation.Common Methods pretty :: PP Relations -> Doc Source # prettyVersioned :: CabalSpecVersion -> PP Relations -> Doc Source #

data ArchitectureReq Source #

Constructors

ArchOnly (Set Arch) |
ArchExcept (Set Arch) |

#### Instances

Instances details

Read ArchitectureReq Source # |
Instance details Defined in Debian.Relation.Common Methods readsPrec :: Int -> ReadS ArchitectureReq Source # readList :: ReadS [ArchitectureReq] Source # readPrec :: ReadPrec ArchitectureReq Source # readListPrec :: ReadPrec [ArchitectureReq] Source #
Show ArchitectureReq Source # |
Instance details Defined in Debian.Relation.Common Methods showsPrec :: Int -> ArchitectureReq -> ShowS Source # show :: ArchitectureReq -> String Source # showList :: [ArchitectureReq] -> ShowS Source #
Eq ArchitectureReq Source # |
Instance details Defined in Debian.Relation.Common Methods (==) :: ArchitectureReq -> ArchitectureReq -> Bool Source # (/=) :: ArchitectureReq -> ArchitectureReq -> Bool Source #
Ord ArchitectureReq Source # |

Instance details

Defined in Debian.Relation.Common

Methods

compare :: ArchitectureReq -> ArchitectureReq -> Ordering Source #

(<) :: ArchitectureReq -> ArchitectureReq -> Bool Source #

(<=) :: ArchitectureReq -> ArchitectureReq -> Bool Source #

(>) :: ArchitectureReq -> ArchitectureReq -> Bool Source #

(>=) :: ArchitectureReq -> ArchitectureReq -> Bool Source #

max :: ArchitectureReq -> ArchitectureReq -> ArchitectureReq Source #

min :: ArchitectureReq -> ArchitectureReq -> ArchitectureReq Source #

Pretty (PP ArchitectureReq) Source # |
Instance details Defined in Debian.Relation.Common Methods pretty :: PP ArchitectureReq -> Doc Source # prettyVersioned :: CabalSpecVersion -> PP ArchitectureReq -> Doc Source #

data Arch Source #

Constructors

Source |
All |
Binary ArchOS ArchCPU |

#### Instances

Instances details

Data Arch Source # |

Instance details

Defined in Debian.Arch

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Arch -> c Arch Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Arch Source #

toConstr :: Arch -> Constr Source #

dataTypeOf :: Arch -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Arch) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Arch) Source #

gmapT :: (forall b. Data b => b -> b) -> Arch -> Arch Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Arch -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Arch -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Arch -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Arch -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Arch -> m Arch Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Arch -> m Arch Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Arch -> m Arch Source #

Read Arch Source # |
Instance details Defined in Debian.Arch Methods readsPrec :: Int -> ReadS Arch Source # readList :: ReadS [Arch] Source # readPrec :: ReadPrec Arch Source # readListPrec :: ReadPrec [Arch] Source #
Show Arch Source # |
Instance details Defined in Debian.Arch Methods showsPrec :: Int -> Arch -> ShowS Source # show :: Arch -> String Source # showList :: [Arch] -> ShowS Source #
Eq Arch Source # |
Instance details Defined in Debian.Arch Methods (==) :: Arch -> Arch -> Bool Source # (/=) :: Arch -> Arch -> Bool Source #
Ord Arch Source # |
Instance details Defined in Debian.Arch Methods compare :: Arch -> Arch -> Ordering Source # (<) :: Arch -> Arch -> Bool Source # (<=) :: Arch -> Arch -> Bool Source # (>) :: Arch -> Arch -> Bool Source # (>=) :: Arch -> Arch -> Bool Source # max :: Arch -> Arch -> Arch Source # min :: Arch -> Arch -> Arch Source #

data ArchOS Source #

Constructors

ArchOS String |
ArchOSAny |

#### Instances

Instances details

Data ArchOS Source # |

Instance details

Defined in Debian.Arch

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ArchOS -> c ArchOS Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ArchOS Source #

toConstr :: ArchOS -> Constr Source #

dataTypeOf :: ArchOS -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ArchOS) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ArchOS) Source #

gmapT :: (forall b. Data b => b -> b) -> ArchOS -> ArchOS Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ArchOS -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ArchOS -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> ArchOS -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ArchOS -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ArchOS -> m ArchOS Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ArchOS -> m ArchOS Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ArchOS -> m ArchOS Source #

Read ArchOS Source # |
Instance details Defined in Debian.Arch Methods readsPrec :: Int -> ReadS ArchOS Source # readList :: ReadS [ArchOS] Source # readPrec :: ReadPrec ArchOS Source # readListPrec :: ReadPrec [ArchOS] Source #
Show ArchOS Source # |
Instance details Defined in Debian.Arch Methods showsPrec :: Int -> ArchOS -> ShowS Source # show :: ArchOS -> String Source # showList :: [ArchOS] -> ShowS Source #
Eq ArchOS Source # |
Instance details Defined in Debian.Arch Methods (==) :: ArchOS -> ArchOS -> Bool Source # (/=) :: ArchOS -> ArchOS -> Bool Source #
Ord ArchOS Source # |
Instance details Defined in Debian.Arch Methods compare :: ArchOS -> ArchOS -> Ordering Source # (<) :: ArchOS -> ArchOS -> Bool Source # (<=) :: ArchOS -> ArchOS -> Bool Source # (>) :: ArchOS -> ArchOS -> Bool Source # (>=) :: ArchOS -> ArchOS -> Bool Source # max :: ArchOS -> ArchOS -> ArchOS Source # min :: ArchOS -> ArchOS -> ArchOS Source #

data ArchCPU Source #

Constructors

ArchCPU String |
ArchCPUAny |

#### Instances

Instances details

Data ArchCPU Source # |

Instance details

Defined in Debian.Arch

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ArchCPU -> c ArchCPU Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ArchCPU Source #

toConstr :: ArchCPU -> Constr Source #

dataTypeOf :: ArchCPU -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ArchCPU) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ArchCPU) Source #

gmapT :: (forall b. Data b => b -> b) -> ArchCPU -> ArchCPU Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ArchCPU -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ArchCPU -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> ArchCPU -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ArchCPU -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ArchCPU -> m ArchCPU Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ArchCPU -> m ArchCPU Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ArchCPU -> m ArchCPU Source #

Read ArchCPU Source # |
Instance details Defined in Debian.Arch Methods readsPrec :: Int -> ReadS ArchCPU Source # readList :: ReadS [ArchCPU] Source # readPrec :: ReadPrec ArchCPU Source # readListPrec :: ReadPrec [ArchCPU] Source #
Show ArchCPU Source # |
Instance details Defined in Debian.Arch Methods showsPrec :: Int -> ArchCPU -> ShowS Source # show :: ArchCPU -> String Source # showList :: [ArchCPU] -> ShowS Source #
Eq ArchCPU Source # |
Instance details Defined in Debian.Arch Methods (==) :: ArchCPU -> ArchCPU -> Bool Source # (/=) :: ArchCPU -> ArchCPU -> Bool Source #
Ord ArchCPU Source # |
Instance details Defined in Debian.Arch Methods compare :: ArchCPU -> ArchCPU -> Ordering Source # (<) :: ArchCPU -> ArchCPU -> Bool Source # (<=) :: ArchCPU -> ArchCPU -> Bool Source # (>) :: ArchCPU -> ArchCPU -> Bool Source # (>=) :: ArchCPU -> ArchCPU -> Bool Source # max :: ArchCPU -> ArchCPU -> ArchCPU Source # min :: ArchCPU -> ArchCPU -> ArchCPU Source #

data VersionReq Source #

Constructors

SLT DebianVersion |
LTE DebianVersion |
EEQ DebianVersion |
GRE DebianVersion |
SGR DebianVersion |

#### Instances

Instances details

Read VersionReq Source # |
Instance details Defined in Debian.Relation.Common Methods readsPrec :: Int -> ReadS VersionReq Source # readList :: ReadS [VersionReq] Source # readPrec :: ReadPrec VersionReq Source # readListPrec :: ReadPrec [VersionReq] Source #
Show VersionReq Source # |
Instance details Defined in Debian.Relation.Common Methods showsPrec :: Int -> VersionReq -> ShowS Source # show :: VersionReq -> String Source # showList :: [VersionReq] -> ShowS Source #
Eq VersionReq Source # |
Instance details Defined in Debian.Relation.Common Methods (==) :: VersionReq -> VersionReq -> Bool Source # (/=) :: VersionReq -> VersionReq -> Bool Source #
Ord VersionReq Source # | The sort order is based on version number first, then on the kind of relation, sorting in the order

Instance details

Defined in Debian.Relation.Common

Methods

compare :: VersionReq -> VersionReq -> Ordering Source #

(<) :: VersionReq -> VersionReq -> Bool Source #

(<=) :: VersionReq -> VersionReq -> Bool Source #

(>) :: VersionReq -> VersionReq -> Bool Source #

(>=) :: VersionReq -> VersionReq -> Bool Source #

max :: VersionReq -> VersionReq -> VersionReq Source #

min :: VersionReq -> VersionReq -> VersionReq Source #

Pretty (PP VersionReq) Source # |
Instance details Defined in Debian.Relation.Common Methods pretty :: PP VersionReq -> Doc Source # prettyVersioned :: CabalSpecVersion -> PP VersionReq -> Doc Source #

type RestrictionList = OMap String Bool Source #

# Helper Functions

checkVersionReq :: Maybe VersionReq -> Maybe DebianVersion -> Bool Source #

Check if a version number satisfies a version requirement.

# Relation Parser

type RelParser a = CharParser () a Source #

class ParseRelations a where Source #

Methods

parseRelations :: a -> Either ParseError Relations Source #

`parseRelations` parse a debian relation (i.e. the value of a Depends field). Return a parsec error or a value of type `Relations`

#### Instances

Instances details

ParseRelations ByteString Source # |
Instance details Defined in Debian.Relation.ByteString Methods parseRelations :: ByteString -> Either ParseError Relations Source #
ParseRelations Text Source # |
Instance details Defined in Debian.Relation.Text Methods parseRelations :: Text -> Either ParseError Relations Source #
ParseRelations String Source # |
Instance details Defined in Debian.Relation.String Methods parseRelations :: String -> Either ParseError Relations Source #