cabal-debian-3.0.4: Create a debianization for a cabal package

Safe HaskellNone



Functions used by but not related to cabal-debian, these could conceivably be moved into more general libraries.



buildDebVersionMap :: IO DebMapSource

Read and parse the status file for installed debian packages.

strictReadF :: (Text -> r) -> FilePath -> IO rSource

replaceFile :: FilePath -> String -> IO ()Source

Write a file which we might still be reading from in order to compute the text argument.

modifyFile :: FilePath -> (String -> IO (Maybe String)) -> IO ()Source

Compute the new file contents from the old. If f returns Nothing do not write.

dpkgFileMap :: IO (Map FilePath (Set BinPkgName))Source

Create a map from pathname to the names of the packages that contains that pathname. We need to make sure we consume all the files, so

cond :: t -> t -> Bool -> tSource

debOfFile :: FilePath -> ReaderT (Map FilePath (Set BinPkgName)) IO (Maybe BinPkgName)Source

Given a path, return the name of the package that owns it.

withCurrentDirectory :: FilePath -> IO a -> IO aSource

From Darcs.Utils

setMapMaybe :: (Ord a, Ord b) => (a -> Maybe b) -> Set a -> Set bSource

zipMaps :: Ord k => (k -> Maybe a -> Maybe b -> Maybe c) -> Map k a -> Map k b -> Map k cSource

foldEmpty :: r -> ([a] -> r) -> [a] -> rSource

maybeL :: Lens a (Maybe b) -> Maybe b -> a -> aSource

If the current value of getL x is Nothing, replace it with f.