codec-rpm-0.2.2: A library for manipulating RPM files

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

Codec.RPM.Conduit

Description

A module for interacting with an RPM record using conduits.

Synopsis

Documentation

parseRPMC :: MonadError ParseError m => Conduit ByteString m RPM Source #

Like parseRPM, but puts the result into a Conduit as an Either, containing either a ParseError or an RPM. The result can be extracted with runExceptT, like so:

import Conduit((.|), runConduitRes, sourceFile)
import Control.Monad.Except(runExceptT)
result <- runExceptT $ runConduitRes $ sourceFile "some.rpm" .| parseRPMC .| someConsumer

On success, the RPM record will be passed down the conduit for futher processing or consumption. On error, the rest of the conduit will be skipped and the ParseError will be returned as the result to be dealt with.

payloadC :: Monad m => Conduit RPM m ByteString Source #

Extract the package payload from an RPM, returning it in the conduit.

payloadContentsC :: (MonadResource m, MonadThrow m) => Conduit RPM m Entry Source #

Extract the package payload from an RPM, decompress it, and return each element of the payload as a Entry.