debian-4.1.2: Modules for working with the Debian package system

Safe Haskell | None
Language | Haskell2010

Debian.GenBuildDeps

Contents

- Preparing dependency info
- Using dependency info
- Obsolete?

Description

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.

Synopsis

- data DepInfo = DepInfo {
  - sourceName :: SrcPkgName
  - relations :: Relations
  - binaryNames :: [BinPkgName]
  - depSet :: Set BinPkgName
  - binSet :: Set BinPkgName
  }
- sourceName' :: HasDebianControl control => control -> SrcPkgName
- relations' :: HasDebianControl control => control -> Relations
- binaryNames' :: HasDebianControl control => control -> [BinPkgName]
- buildDependencies :: HasDebianControl control => control -> DepInfo
- type RelaxInfo = SrcPkgName -> BinPkgName -> Bool
- relaxDeps :: RelaxInfo -> [DepInfo] -> [DepInfo]
- data BuildableInfo a
  - = BuildableInfo {
    - readyTargets :: [ReadyTarget a]
    - allBlocked :: [a]
    }
  - | CycleInfo {
    - depPairs :: [(a, a)]
    }
- data ReadyTarget a = ReadyTarget {
  - ready :: a
  - waiting :: [a]
  - other :: [a]
  }
- buildable :: (a -> DepInfo) -> [a] -> BuildableInfo a
- compareSource :: DepInfo -> DepInfo -> Ordering
- orderSource :: (a -> a -> Ordering) -> [a] -> [a]
- genDeps :: [FilePath] -> IO [DebianControl]
- failPackage :: Eq a => (a -> a -> Ordering) -> a -> [a] -> ([a], [a])
- getSourceOrder :: FilePath -> IO [SrcPkgName]

# Documentation

data DepInfo Source #

This type describes the build dependencies of a source package.

Constructors

DepInfo |

Fields

- sourceName :: SrcPkgName

  source package name

- relations :: Relations

  dependency relations

- binaryNames :: [BinPkgName]

  binary dependency names (is this a function of relations?)

- depSet :: Set BinPkgName

  Set containing all binary package names mentioned in relations

- binSet :: Set BinPkgName

  Set containing binaryNames

#### Instances

Instances details

Show DepInfo Source # |
Instance details Defined in Debian.GenBuildDeps Methods showsPrec :: Int -> DepInfo -> ShowS Source # show :: DepInfo -> String Source # showList :: [DepInfo] -> ShowS Source #
Eq DepInfo Source # |
Instance details Defined in Debian.GenBuildDeps Methods (==) :: DepInfo -> DepInfo -> Bool Source # (/=) :: DepInfo -> DepInfo -> Bool Source #

sourceName' :: HasDebianControl control => control -> SrcPkgName Source #

source package name

relations' :: HasDebianControl control => control -> Relations Source #

dependency relations

binaryNames' :: HasDebianControl control => control -> [BinPkgName] Source #

binary dependency names (is this a function of relations?)

# Preparing dependency info

buildDependencies :: HasDebianControl control => control -> DepInfo Source #

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

type RelaxInfo = SrcPkgName -> BinPkgName -> Bool Source #

Given a source package name and a binary package name, return False if the binary package should be ignored hwen deciding whether to build the source package. This is used to prevent build dependency cycles from triggering unnecessary rebuilds. (This is a replacement for the RelaxInfo type, which we temporarily rename OldRelaxInfo.)

relaxDeps :: RelaxInfo -> [DepInfo] -> [DepInfo] Source #

Remove any dependencies that are designated "relaxed" by relaxInfo.

# Using dependency info

data BuildableInfo a Source #

Constructors

BuildableInfo |

Fields

- readyTargets :: [ReadyTarget a]
- allBlocked :: [a]

CycleInfo |

Fields

- depPairs :: [(a, a)]

data ReadyTarget a Source #

Constructors

ReadyTarget |

Fields

- ready :: a

  Some target whose build dependencies are all satisfied

- waiting :: [a]

  The targets that are waiting for the ready target

- other :: [a]

  The rest of the targets that need to be built

buildable :: (a -> DepInfo) -> [a] -> BuildableInfo a Source #

Given an ordering function representing the dependencies on a list of packages, return a ReadyTarget triple: One ready package, the packages that depend on the ready package directly or indirectly, and all the other packages.

compareSource :: DepInfo -> DepInfo -> Ordering Source #

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.

# Obsolete?

orderSource :: (a -> a -> Ordering) -> [a] -> [a] Source #

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.

genDeps :: [FilePath] -> IO [DebianControl] Source #

Return the dependency info for a list of control files.

failPackage :: Eq a => (a -> a -> Ordering) -> a -> [a] -> ([a], [a]) Source #

Remove any packages which can't be built given that a package has failed.

getSourceOrder :: FilePath -> IO [SrcPkgName] Source #

One example of how to tie the below functions together. In this case `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.