MyNixOS website logo
Description

A library for manipulating RPM files.

This module provides a library for reading RPM files and converting them into useful data structures. There is currently no way to operate in reverse - that is, for building an RPM file out of a data structure.

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:

  • http://blog.jessitron.com/2013/04/property-based-testing-what-is-it.html
  • http://book.realworldhaskell.org/read/testing-and-quality-assurance.html
  • https://en.wikibooks.org/wiki/Haskell/Testing
  • http://hspec.github.io/quickcheck.html.
Metadata

Version

0.2.2

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows