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

Safe Haskell | None
Language | Haskell2010

Debian.Sources

Contents

- Unit Tests

Synopsis

- data SourceType
  - = Deb
  - | DebSrc
- data SourceOption = SourceOption String SourceOp [String]
- data SourceOp
  - = OpSet
  - | OpAdd
  - | OpDel
- data DebSource = DebSource {
  - _sourceType :: SourceType
  - _sourceOptions :: [SourceOption]
  - _sourceUri :: VendorURI
  - _sourceDist :: Either String (Codename, [Section])
  }
- quoteWords :: String -> [String]
- stripLine :: String -> String
- sourceLines :: String -> [String]
- parseSourceLine :: [Loc] -> String -> DebSource
- parseOptions :: String -> Either ParseError [SourceOption]
- pOptions :: CharParser () [SourceOption]
- pOption :: CharParser () SourceOption
- pOp :: CharParser () SourceOp
- parseSourceLine' :: [Loc] -> String -> Either String DebSource
- parseSourcesList :: [Loc] -> String -> [DebSource]
- testQuoteWords :: Test
- testSourcesList :: Test
- testSourcesList2 :: Test
- validSourcesListStr :: String
- validSourcesList :: [DebSource]
- validSourcesListExpected :: String
- _invalidSourcesListStr1 :: Text
- testSourcesListParse :: Test
- sourcesListTests :: Test
- sourceDist :: Lens' DebSource (Either String (Codename, [Section]))
- sourceOptions :: Lens' DebSource [SourceOption]
- sourceType :: Lens' DebSource SourceType
- sourceUri :: Lens' DebSource VendorURI

# Documentation

data SourceType Source #

Constructors

Deb |
DebSrc |

#### Instances

Instances details

Pretty SourceType Source # |
Instance details Defined in Debian.Sources Methods pretty :: SourceType -> Doc Source # prettyVersioned :: CabalSpecVersion -> SourceType -> Doc Source #
Show SourceType Source # |
Instance details Defined in Debian.Sources Methods showsPrec :: Int -> SourceType -> ShowS Source # show :: SourceType -> String Source # showList :: [SourceType] -> ShowS Source #
Eq SourceType Source # |
Instance details Defined in Debian.Sources Methods (==) :: SourceType -> SourceType -> Bool Source # (/=) :: SourceType -> SourceType -> Bool Source #
Ord SourceType Source # |

Instance details

Defined in Debian.Sources

Methods

compare :: SourceType -> SourceType -> Ordering Source #

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

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

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

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

max :: SourceType -> SourceType -> SourceType Source #

min :: SourceType -> SourceType -> SourceType Source #

data SourceOption Source #

Constructors

SourceOption String SourceOp [String] |

#### Instances

Instances details

Pretty SourceOption Source # |
Instance details Defined in Debian.Sources Methods pretty :: SourceOption -> Doc Source # prettyVersioned :: CabalSpecVersion -> SourceOption -> Doc Source #
Show SourceOption Source # |
Instance details Defined in Debian.Sources Methods showsPrec :: Int -> SourceOption -> ShowS Source # show :: SourceOption -> String Source # showList :: [SourceOption] -> ShowS Source #
Eq SourceOption Source # |
Instance details Defined in Debian.Sources Methods (==) :: SourceOption -> SourceOption -> Bool Source # (/=) :: SourceOption -> SourceOption -> Bool Source #
Ord SourceOption Source # |

Instance details

Defined in Debian.Sources

Methods

compare :: SourceOption -> SourceOption -> Ordering Source #

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

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

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

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

max :: SourceOption -> SourceOption -> SourceOption Source #

min :: SourceOption -> SourceOption -> SourceOption Source #

data SourceOp Source #

Constructors

OpSet |
OpAdd |
OpDel |

#### Instances

Instances details

Pretty SourceOp Source # |
Instance details Defined in Debian.Sources Methods pretty :: SourceOp -> Doc Source # prettyVersioned :: CabalSpecVersion -> SourceOp -> Doc Source #
Show SourceOp Source # |
Instance details Defined in Debian.Sources Methods showsPrec :: Int -> SourceOp -> ShowS Source # show :: SourceOp -> String Source # showList :: [SourceOp] -> ShowS Source #
Eq SourceOp Source # |
Instance details Defined in Debian.Sources Methods (==) :: SourceOp -> SourceOp -> Bool Source # (/=) :: SourceOp -> SourceOp -> Bool Source #
Ord SourceOp Source # |
Instance details Defined in Debian.Sources Methods compare :: SourceOp -> SourceOp -> Ordering Source # (<) :: SourceOp -> SourceOp -> Bool Source # (<=) :: SourceOp -> SourceOp -> Bool Source # (>) :: SourceOp -> SourceOp -> Bool Source # (>=) :: SourceOp -> SourceOp -> Bool Source # max :: SourceOp -> SourceOp -> SourceOp Source # min :: SourceOp -> SourceOp -> SourceOp Source #

data DebSource Source #

Constructors

DebSource |

Fields

- _sourceType :: SourceType
- _sourceOptions :: [SourceOption]
- _sourceUri :: VendorURI
- _sourceDist :: Either String (Codename, [Section])

#### Instances

Instances details

Pretty DebSource Source # |
Instance details Defined in Debian.Sources Methods pretty :: DebSource -> Doc Source # prettyVersioned :: CabalSpecVersion -> DebSource -> Doc Source #
Show DebSource Source # |
Instance details Defined in Debian.Sources Methods showsPrec :: Int -> DebSource -> ShowS Source # show :: DebSource -> String Source # showList :: [DebSource] -> ShowS Source #
Eq DebSource Source # |
Instance details Defined in Debian.Sources Methods (==) :: DebSource -> DebSource -> Bool Source # (/=) :: DebSource -> DebSource -> Bool Source #
Ord DebSource Source # |
Instance details Defined in Debian.Sources Methods compare :: DebSource -> DebSource -> Ordering Source # (<) :: DebSource -> DebSource -> Bool Source # (<=) :: DebSource -> DebSource -> Bool Source # (>) :: DebSource -> DebSource -> Bool Source # (>=) :: DebSource -> DebSource -> Bool Source # max :: DebSource -> DebSource -> DebSource Source # min :: DebSource -> DebSource -> DebSource Source #
Pretty (PP [DebSource]) Source # |
Instance details Defined in Debian.Sources Methods pretty :: PP [DebSource] -> Doc Source # prettyVersioned :: CabalSpecVersion -> PP [DebSource] -> Doc Source #

quoteWords :: String -> [String] Source #

quoteWords - similar to words, but with special handling of double-quotes and brackets.

The handling double quotes and [] is supposed to match: apt-0.6.44.2/apt-pkg/contrib/strutl.cc:ParseQuoteWord()

The behaviour can be defined as:

Break the string into space seperated words ignoring spaces that appear between "" or []. Strip trailing and leading white space around words. Strip out double quotes, but leave the square brackets intact.

stripLine :: String -> String Source #

sourceLines :: String -> [String] Source #

parseSourceLine :: [Loc] -> String -> DebSource Source #

parseSourceLine -- parses a source line the argument must be a non-empty, valid source line with comments stripped see: `sourceLines`

parseOptions :: String -> Either ParseError [SourceOption] Source #

pOptions :: CharParser () [SourceOption] Source #

pOption :: CharParser () SourceOption Source #

pOp :: CharParser () SourceOp Source #

parseSourceLine' :: [Loc] -> String -> Either String DebSource Source #

parseSourcesList :: [Loc] -> String -> [DebSource] Source #

# Unit Tests

testQuoteWords :: Test Source #

testSourcesList :: Test Source #

testSourcesList2 :: Test Source #

validSourcesListStr :: String Source #

validSourcesList :: [DebSource] Source #

validSourcesListExpected :: String Source #

_invalidSourcesListStr1 :: Text Source #

testSourcesListParse :: Test Source #

sourcesListTests :: Test Source #

sourceDist :: Lens' DebSource (Either String (Codename, [Section])) Source #

sourceOptions :: Lens' DebSource [SourceOption] Source #

sourceType :: Lens' DebSource SourceType Source #

sourceUri :: Lens' DebSource VendorURI Source #