LGPL-2.1-only licensed by Chris Lumens
Maintained by [email protected]
This version can be pinned in stack with:codec-rpm-0.2.2@sha256:9e5d2ad3ffa705aa411096f2ac84d93217dd11e566d384594da15249d36762fc,3403

Module documentation for 0.2.2

Build Status Coverage Status

Haskell library for working with RPM packages.

Preparing local development environment for Haskell

For development we use the latest upstream versions:

  1. Remove the standard haskell-platform and ghc-* RPMs if you have them installed
  2. Download version 8.0.2 of the generic Haskell Platform distribution from https://www.haskell.org/platform/linux.html#linux-generic
  3. Extract the archive and install Haskell
$ tar -xzvf haskell-platform-8.0.2-unknown-posix--minimal-x86_64.tar.gz 
$ sudo ./install-haskell-platform.sh
  1. Add /usr/local/bin to your PATH if not already there!

Building the project locally

cabal is used to install and manage Haskell dependencies from upstream.

$ cabal sandbox init
$ cabal install

Executing unit tests

$ cabal sandbox init
$ cabal install --dependencies-only --enable-tests
$ cabal test --show-details=always
Preprocessing library rpm-1...
Preprocessing test suite 'tests' for rpm-1...
Running 1 test suites...
Test suite tests: RUNNING...
Test suite tests: PASS
Test suite logged to: dist/test/rpm-1-tests.log
1 of 1 test suites (1 of 1 test cases) passed.

Produce code coverage report

$ cabal sandbox init
$ cabal install --enable-tests --enable-coverage
$ cabal test --show-details=always
$ firefox ./dist/hpc/vanilla/tix/*/hpc_index.html

Testing in Haskell

The recommended way to test this project is to use Hspec for annotating unit tests. For starters you can try adding cases which extend code coverage.

It is also recommended to use property based testing with QuickCheck (and Hspec) where it makes sense. Property based tools automatically generates hundreds/thousands of input variants and execute the function under test with them. This validates that specific conditions (aka properties of the function) are always met. This is useful with pure functions. For more information see:

Changes

0.2.2

  • Use hcat instead of <> in Codec.RPM.Types (#31).
  • Various changes for running hlint and hpc-coveralls in tests.
  • Fix -Wmissing-home-modules warnings.

0.2.1

  • Allow newer versions of conduit, conduit-extra, lzma-conduit, and resourcet.
  • Relax minimum requirements on exceptions, HUnit, and text to fit better with what is shipped in Fedora.
  • Remove the unused requirement on conduit-combinators.
  • payloadContentsC now wants an instance of MonadThrow.

0.2.0

  • Move parseC into a new Conduit module.
  • Add payloadC and payloadContentsC.
  • parseRPMC should return a ParseError on error.

0.1.3

  • Derive Ord for DepRequirement.

0.1.2

  • Relax overly strict conduit-extra and text requirements.

0.1.1

  • Relax overly strict attoparsec requirement.

0.1.0

  • Initial release.