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

Safe Haskell | None
Language | Haskell2010

Debian.Apt.Index

Synopsis

- update :: Fetcher -> FilePath -> String -> [DebSource] -> IO [Maybe (FilePath, Compression)]
- type Fetcher = URI -> FilePath -> Maybe UTCTime -> IO Bool
- data CheckSums = CheckSums {
  - md5sum :: Maybe String
  - sha1 :: Maybe String
  - sha256 :: Maybe String
  }
- data Compression
  - = BZ2
  - | GZ
  - | Uncompressed
- type FileTuple = (CheckSums, Size, FilePath)
- type Size = Integer
- controlFromIndex :: Compression -> FilePath -> ByteString -> Either ParseError (Control' Text)
- controlFromIndex' :: Compression -> FilePath -> IO (Either ParseError (Control' Text))
- findContentsFiles :: (FilePath -> Bool) -> FilePath -> IO [FilePath]
- findIndexes :: FilePath -> String -> [FileTuple] -> IO [(FileTuple, Compression)]
- indexesInRelease :: (FilePath -> Bool) -> Control' Text -> [(CheckSums, Integer, FilePath)]
- tupleFromFilePath :: FilePath -> FilePath -> IO (Maybe FileTuple)

# Documentation

update Source #

Arguments

:: Fetcher | function that will do actually downloading
-> FilePath | download indexes to the directory (must already exist)
-> String | binary architecture
-> [DebSource] | sources.list
-> IO [Maybe (FilePath, Compression)] | (basename of index file, compression status)

update - similar to apt-get update

type Fetcher = URI -> FilePath -> Maybe UTCTime -> IO Bool Source #

function-type for a function that downloads a file The timestamp is optional. If the local file is as new or newer than the remote copy, the download may be skipped.

A good choice might be a partially parameterized call to `fetch`

data CheckSums Source #

Constructors

CheckSums |

Fields

- md5sum :: Maybe String
- sha1 :: Maybe String
- sha256 :: Maybe String

#### Instances

Instances details

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

data Compression Source #

Package indexes on the server are uncompressed or compressed with gzip or bzip2. We do not know what will exist on the server until we actually look. This type is used to mark the compression status of what was actually found.

Constructors

BZ2 |
GZ |
Uncompressed |

#### Instances

Instances details

Bounded Compression Source # |
Instance details Defined in Debian.Apt.Index Methods minBound :: Compression Source # maxBound :: Compression Source #
Enum Compression Source # |

Instance details

Defined in Debian.Apt.Index

Methods

succ :: Compression -> Compression Source #

pred :: Compression -> Compression Source #

toEnum :: Int -> Compression Source #

fromEnum :: Compression -> Int Source #

enumFrom :: Compression -> [Compression] Source #

enumFromThen :: Compression -> Compression -> [Compression] Source #

enumFromTo :: Compression -> Compression -> [Compression] Source #

enumFromThenTo :: Compression -> Compression -> Compression -> [Compression] Source #

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

Instance details

Defined in Debian.Apt.Index

Methods

compare :: Compression -> Compression -> Ordering Source #

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

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

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

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

max :: Compression -> Compression -> Compression Source #

min :: Compression -> Compression -> Compression Source #

type FileTuple = (CheckSums, Size, FilePath) Source #

type Size = Integer Source #

controlFromIndex :: Compression -> FilePath -> ByteString -> Either ParseError (Control' Text) Source #

Parse a possibly compressed index file.

controlFromIndex' :: Compression -> FilePath -> IO (Either ParseError (Control' Text)) Source #

parse an index possibly compressed file

findContentsFiles :: (FilePath -> Bool) -> FilePath -> IO [FilePath] Source #

find the Contents-* files. These are not listed in the Release file

findIndexes :: FilePath -> String -> [FileTuple] -> IO [(FileTuple, Compression)] Source #

indexesInRelease Source #

Arguments

:: (FilePath -> Bool) |
-> Control' Text | A release file
-> [(CheckSums, Integer, FilePath)] |

tupleFromFilePath :: FilePath -> FilePath -> IO (Maybe FileTuple) Source #

make a FileTuple for a file found on the local disk returns `Nothing` if the file does not exist.