BSD-3-Clause licensed by Henning Thielemann
Maintained by Jens Petersen
This version can be pinned in stack with:rpmbuild-order-0.4.0@sha256:3430666ed9ef2d7321f3cb8950ee262e96b4a0d28ed924d5d61e67377fedadf6,3649

Module documentation for 0.4.0

Build Status Hackage license

rpmbuild-order

This package originally based on code from cabal-sort, sorts rpm package spec files by build order.

$ rpmbuild-order --help
$ rpmbuild-order sort mycore mylib myapp
mylib
mycore
myapp

The arguments passed can either be directories containing the package, or spec files.

Using the rpmbuild-order deps and rdeps commands the ordered dependencies and reverse dependencies of a package can be obtained from the current set of checked out package sources.

As of version 0.4, a library is also provided. See the modules’ documentation for details.

Notes and known problems

  1. Given packages A, B, C, where C depends on B, and B depends on A, and you call

    rpmbuild-order sort C.spec A.spec

then the output may be wrong if C does not have a direct dependency on A. Even if the order is correct, B is missing in the output and thus in this case the list of packages cannot be reliably used for a sequence of builds.

However the deps and rdeps commands take other neighbouring package directories into account.

  1. repoquery is not used to resolve meta-dependencies or files to packages. So if a package BuildRequires a file, it will not be resolved to a package. This may get addressed some day, but file dependencies seem less common for BuildRequires than Requires.

  2. rpmspec is used to parse spec files (for macro expansion etc): so missing macros packages may lead to erroneous results.

Changes

0.4.0 (2020-07-29)

  • performance: rework just to use String and only parse spec files once and also use faster PatriciaTree.Gr On about 500 packages roughly twice as fast as 0.3.1
  • sort now defaults to outputting separate dependency stacks, with options for combined, connected, and independent packages only
  • new ‘layers’ command outputs packages in ordered dependency independent layers
  • new ‘chain’ command outputs Fedora chain-build format
  • new ‘leaves’ commands to list outer leaf packages
  • new ‘roots’ commands lists lowest dependencies
  • new library exposed with 2 modules: low-level Graph and high-level Order:
    • Distribution.RPM.Build.Order provides: dependencySort, dependencySortParallel, dependencyLayers, sortGraph output
    • Distribution.RPM.Build.Graph provides: createGraph, dependencyNodes, subgraph’, packageLayers, etc
  • graph Nodes are now only labelled by package/spec filepath and no longer carry redundant dependency lists
  • add a basic testsuite for the library

0.3.1 (2020-07-04)

  • fix detection of circular dependencies (bug introduced in 0.3)

0.3 (2019-10-10)

  • check package provides instead of rpms
  • use ByteString for packages (provides)
  • move to simple-cmd-args (optparse-applicative)
  • add –lenient for rpmspec failures

0.2 (2018-08-17)

  • error if no spec file
  • filter out hidden files from deps search
  • add –version
  • generate manpage with help2man

0.1 (2018-07-18)

  • initial release with sort, deps and rdeps (reverse dependencies) commands