-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Sort RPM packages in dependency order
--   
--   The rpmbuild-order tool sorts source RPM packages by build
--   dependencies, so that they can be built in a correct order. It does
--   this by reading RPM package spec files and then topologically sorts
--   them according to their build dependencies. The code evolved from
--   cabal-sort by Henning Thielemann. It can also order the dependencies
--   or reverse depends of one or more packages among the packages checked
--   out in neighboring directories (which can be useful to see what
--   packages are affected when a low-level package changes, or which
--   packages are dependents of one of more packages). It also has support
--   for setting RPM options for bcond etc, which can affect dependencies.
--   It can also output dependency graphs. Since version 0.4, a library API
--   is provided.
@package rpmbuild-order
@version 0.4.13


-- | This module has commands for reading the Requires and Provides from an
--   RPM package spec file.
module Distribution.RPM.Build.ProvReqs

-- | Get RPM Provides and BuildRequires based on spec file.
rpmspecProvidesBuildRequires :: Bool -> [String] -> FilePath -> IO (Maybe ([String], [String]))


-- | This module provides simple dependency graph making for rpm packages:
--   
--   <pre>
--   import <a>Distribution.RPM.Build.Graph</a>
--   
--   graph &lt;- <a>createGraph</a> ["pkg1", "pkg2", "../pkg3"]
--   </pre>
module Distribution.RPM.Build.Graph

-- | alias for a package dependency graph
type PackageGraph = Gr FilePath ()

-- | Create a directed dependency graph for a set of packages This is a
--   convenience wrapper for createGraph1 False False True Nothing
createGraph :: [FilePath] -> IO PackageGraph

-- | Create a directed dependency graph for a set of packages setting rpm
--   options This is a convenience wrapper for <tt>createGraph2 rpmopts
--   False False True Nothing</tt>
createGraphRpmOpts :: [String] -> [FilePath] -> IO PackageGraph

-- | Create a directed dependency graph for a set of packages For the
--   (createGraph default) reverse deps graph the arrows point back from
--   the dependencies to the dependendent (parent/consumer) packages, and
--   this allows forward sorting by dependencies (ie lowest deps first).
--   
--   This is the same as <tt>createGraph2 []</tt>
createGraph1 :: Bool -> Bool -> Bool -> Maybe FilePath -> [FilePath] -> IO PackageGraph

-- | Create a directed dependency graph for a set of packages For the
--   (createGraph default) reverse deps graph the arrows point back from
--   the dependencies to the dependendent (parent/consumer) packages, and
--   this allows forward sorting by dependencies (ie lowest deps first).
--   
--   Additionally this function allows passing options to rpmspec: eg
--   `--with bootstrap` etc
createGraph2 :: [String] -> Bool -> Bool -> Bool -> Maybe FilePath -> [FilePath] -> IO PackageGraph

-- | Create a directed dependency graph for a set of packages
--   
--   Like createGraph2 but with additional parameter for any BRs to be
--   ignored.
createGraph3 :: [String] -> [String] -> Bool -> Bool -> Bool -> Maybe FilePath -> [FilePath] -> IO PackageGraph

-- | Create a directed dependency graph for a set of packages
--   
--   Like createGraph3 but can disable check for cycles
createGraph4 :: Bool -> [String] -> [String] -> Bool -> Bool -> Bool -> Maybe FilePath -> [FilePath] -> IO PackageGraph

-- | Alias for createGraph1
--   
--   deprecated
createGraph' :: Bool -> Bool -> Bool -> Maybe FilePath -> [FilePath] -> IO PackageGraph

-- | Alias for createGraph2
--   
--   @since 0.4.2 (deprecated)
createGraph'' :: [String] -> Bool -> Bool -> Bool -> Maybe FilePath -> [FilePath] -> IO PackageGraph

-- | Alias for createGraph3
--   
--   @since 0.4.3 (deprecated)
createGraph''' :: [String] -> [String] -> Bool -> Bool -> Bool -> Maybe FilePath -> [FilePath] -> IO PackageGraph

-- | Alias for createGraph4
--   
--   @since 0.4.4 (deprecated)
createGraph'''' :: Bool -> [String] -> [String] -> Bool -> Bool -> Bool -> Maybe FilePath -> [FilePath] -> IO PackageGraph

-- | Get all of the dependencies of a subset of one or more packages within
--   full PackageGraph. The subset paths should be written in the same way
--   as for the graph.
dependencyNodes :: [FilePath] -> PackageGraph -> [FilePath]

-- | A flipped version of subgraph
subgraph' :: Gr a b -> [Node] -> Gr a b

-- | Return the bottom-up list of dependency layers of a graph
packageLayers :: PackageGraph -> [[FilePath]]

-- | The lowest dependencies of a PackageGraph
lowestLayer :: PackageGraph -> [FilePath]

-- | The lowest dependency nodes of a PackageGraph
lowestLayer' :: PackageGraph -> [LNode FilePath]

-- | The leaf (outer) packages of a PackageGraph
packageLeaves :: PackageGraph -> [FilePath]

-- | Returns packages independent of all the rest of the graph
separatePackages :: PackageGraph -> [FilePath]

-- | Return graphviz dot format of graph
printGraph :: PackageGraph -> IO ()

-- | Render graph with graphviz X11 preview
renderGraph :: PackageGraph -> IO ()

-- | Given a list of one or more packages, look for dependencies in
--   neighboring packages and return a package dependency graph
depsGraph :: Bool -> [String] -> Bool -> [String] -> [String] -> Bool -> Maybe FilePath -> [FilePath] -> IO PackageGraph

-- | Given a list of one or more packages and a list of potential
--   dependencies, return a package dependency graph
depsGraphDeps :: Bool -> [String] -> Bool -> [String] -> [String] -> Bool -> Maybe FilePath -> [FilePath] -> [FilePath] -> IO PackageGraph

-- | Used to control the output from sortGraph
data Components

-- | separate independent stacks
Parallel :: Components

-- | combine indepdendent stacks together
Combine :: Components

-- | only stack of packages
Connected :: Components

-- | only independent packages in the package set
Separate :: Components

-- | topological sort packages from a PackageGraph arranged by Components
topsortGraph :: Components -> PackageGraph -> [[String]]
instance GHC.Classes.Eq Distribution.RPM.Build.Graph.SourcePackage


-- | This module provides dependency sorting functions
--   
--   <pre>
--   import <a>Distribution.RPM.Build.Order</a>
--   
--   <a>dependencySort</a> ["pkg1", "pkg2", "../pkg3"]
--   
--   =&gt; ["pkg2", "../pkg3", "pkg1"]
--   </pre>
--   
--   where pkg1 depends on pkg3, which depends on pkg2 say.
--   
--   Package paths can be directories or spec files.
module Distribution.RPM.Build.Order

-- | sort packages by dependencies
dependencySort :: [FilePath] -> IO [FilePath]

-- | sort packages by dependencies with rpm options
dependencySortRpmOpts :: [String] -> [FilePath] -> IO [FilePath]

-- | dependency sort of packages in graph components
dependencySortParallel :: [FilePath] -> IO [[FilePath]]

-- | group packages in dependency layers, lowest first
dependencyLayers :: [FilePath] -> IO [[FilePath]]

-- | like dependencyLayers but with rpm options
dependencyLayersRpmOpts :: [String] -> [FilePath] -> IO [[FilePath]]

-- | returns the leaves of a set of packages
leafPackages :: [FilePath] -> IO [FilePath]

-- | returns independent packages among a set of packages
independentPackages :: [FilePath] -> IO [FilePath]

-- | Used to control the output from sortGraph
data Components

-- | separate independent stacks
Parallel :: Components

-- | combine indepdendent stacks together
Combine :: Components

-- | only stack of packages
Connected :: Components

-- | only independent packages in the package set
Separate :: Components

-- | output sorted packages from a PackageGraph arrange by Components
sortGraph :: Components -> PackageGraph -> IO ()

-- | Given a list of one or more packages, look for dependencies in
--   neighboring packages and output them in a topological order
depsPackages :: Bool -> [String] -> Bool -> [String] -> [String] -> Bool -> Bool -> Maybe FilePath -> [FilePath] -> IO ()
