Figure out the dependency relation between debianized source directories. The code to actually solve these dependency relations for a particular set of binary packages is in Debian.Repo.Dependency.
- type DepInfo = (SrcPkgName, Relations, [BinPkgName])
- newtype SrcPkgName = SrcPkgName PkgName
- newtype BinPkgName = BinPkgName PkgName
- buildDependencies :: Control -> Either String DepInfo
- newtype RelaxInfo = RelaxInfo [(BinPkgName, Maybe SrcPkgName)]
- relaxDeps :: RelaxInfo -> [DepInfo] -> [DepInfo]
- data BuildableInfo a
- buildable :: (a -> a -> Ordering) -> [a] -> BuildableInfo a
- compareSource :: DepInfo -> DepInfo -> Ordering
- orderSource :: (a -> a -> Ordering) -> [a] -> [a]
- genDeps :: [FilePath] -> IO (Either String [DepInfo])
- failPackage :: Eq a => (a -> a -> Ordering) -> a -> [a] -> ([a], [a])
- getSourceOrder :: FilePath -> IO (Either String [SrcPkgName])
This type describes the build dependencies of a source package.
Preparing dependency info
Return the dependency info for a source package with the given dependency relaxation. |According to debian policy, only the first paragraph in debian/control can be a source package http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-sourcecontrolfiles
Specifies build dependencies that should be ignored during the build decision. If the pair is (BINARY, Nothing) it means the binary package BINARY should always be ignored when deciding whether to build. If the pair is (BINARY, Just SOURCE) it means that binary package BINARY should be ignored when deiciding whether to build package SOURCE.
Remove any dependencies that are designated "relaxed" by relaxInfo.
Using dependency info
Given an ordering function representing the dependencies on a list of packages, return a triple: One ready package, the packages that depend on the ready package directly or indirectly, and all the other packages.
This is a nice start. It ignores circular build depends and takes
a pretty simplistic approach to
or build depends. However, I
think this should work pretty nicely in practice.
Given a list of packages, sort them according to their apparant build dependencies so that the first element doesn't depend on any of the other packages.
Return the dependency info for a list of control files.
Remove any packages which can't be built given that a package has failed.
One example of how to tie the below functions together. In this
fp is the path to a directory that contains a bunch of
checked out source packages. The code will automatically look for
debian/control. It returns a list with the packages in the
order they should be built.