Cabal-1.2.4.0: A framework for packaging Haskell softwareSource codeContentsIndex
Distribution.Simple.Utils
Portabilityportable
Stabilityalpha
MaintainerIsaac Jones <ijones@syntaxpolice.org>
Description
Explanation: Misc. Utilities, especially file-related utilities. Stuff used by multiple modules that doesn't fit elsewhere.
Synopsis
die :: String -> IO a
dieWithLocation :: FilePath -> Maybe Int -> String -> IO a
warn :: Verbosity -> String -> IO ()
notice :: Verbosity -> String -> IO ()
info :: Verbosity -> String -> IO ()
debug :: Verbosity -> String -> IO ()
breaks :: (a -> Bool) -> [a] -> [[a]]
wrapText :: Int -> [String] -> [String]
rawSystemExit :: Verbosity -> FilePath -> [String] -> IO ()
rawSystemStdout :: Verbosity -> FilePath -> [String] -> IO String
rawSystemStdout' :: Verbosity -> FilePath -> [String] -> IO (String, ExitCode)
maybeExit :: IO ExitCode -> IO ()
xargs :: Int -> ([String] -> IO ()) -> [String] -> [String] -> IO ()
matchesDescFile :: FilePath -> Bool
rawSystemPathExit :: Verbosity -> String -> [String] -> IO ()
smartCopySources :: Verbosity -> [FilePath] -> FilePath -> [String] -> [String] -> Bool -> Bool -> IO ()
createDirectoryIfMissingVerbose :: Verbosity -> Bool -> FilePath -> IO ()
copyFileVerbose :: Verbosity -> FilePath -> FilePath -> IO ()
copyDirectoryRecursiveVerbose :: Verbosity -> FilePath -> FilePath -> IO ()
moduleToFilePath :: [FilePath] -> String -> [String] -> IO [FilePath]
moduleToFilePath2 :: [FilePath] -> String -> [String] -> IO [(FilePath, FilePath)]
mkLibName :: FilePath -> String -> String
mkProfLibName :: FilePath -> String -> String
mkSharedLibName :: FilePath -> String -> PackageIdentifier -> String
currentDir :: FilePath
dotToSep :: String -> String
findFile :: [FilePath] -> FilePath -> IO FilePath
findFileWithExtension :: [String] -> [FilePath] -> FilePath -> IO (Maybe FilePath)
findFileWithExtension' :: [String] -> [FilePath] -> FilePath -> IO (Maybe (FilePath, FilePath))
defaultPackageDesc :: Verbosity -> IO FilePath
findPackageDesc :: Verbosity -> FilePath -> IO FilePath
defaultHookedPackageDesc :: IO (Maybe FilePath)
findHookedPackageDesc :: FilePath -> IO (Maybe FilePath)
exeExtension :: String
objExtension :: String
dllExtension :: String
Documentation
die :: String -> IO aSource
dieWithLocation :: FilePath -> Maybe Int -> String -> IO aSource
warn :: Verbosity -> String -> IO ()Source

Non fatal conditions that may be indicative of an error or problem.

We display these at the normal verbosity level.

notice :: Verbosity -> String -> IO ()Source

Useful status messages.

We display these at the normal verbosity level.

This is for the ordinary helpful status messages that users see. Just enough information to know that things are working but not floods of detail.

info :: Verbosity -> String -> IO ()Source

More detail on the operation of some action.

We display these messages when the verbosity level is verbose

debug :: Verbosity -> String -> IO ()Source

Detailed internal debugging information

We display these messages when the verbosity level is deafening

breaks :: (a -> Bool) -> [a] -> [[a]]Source
wrapText :: Int -> [String] -> [String]Source
rawSystemExit :: Verbosity -> FilePath -> [String] -> IO ()Source
rawSystemStdout :: Verbosity -> FilePath -> [String] -> IO StringSource
rawSystemStdout' :: Verbosity -> FilePath -> [String] -> IO (String, ExitCode)Source
maybeExit :: IO ExitCode -> IO ()Source
xargs :: Int -> ([String] -> IO ()) -> [String] -> [String] -> IO ()Source

Like the unix xargs program. Useful for when we've got very long command lines that might overflow an OS limit on command line length and so you need to invoke a command multiple times to get all the args in.

Use it with either of the rawSystem variants above. For example:

 xargs (32*1024) (rawSystemPathExit verbosity) prog fixedArgs bigArgs
matchesDescFile :: FilePath -> BoolSource
rawSystemPathExit :: Verbosity -> String -> [String] -> IO ()Source
smartCopySourcesSource
:: Verbosityverbosity
-> [FilePath]build prefix (location of objects)
-> FilePathTarget directory
-> [String]Modules
-> [String]search suffixes
-> BoolExit if no such modules
-> BoolPreserve directory structure
-> IO ()
Copy the source files into the right directory. Looks in the build prefix for files that look like the input modules, based on the input search suffixes. It copies the files into the target directory.
createDirectoryIfMissingVerbose :: Verbosity -> Bool -> FilePath -> IO ()Source
copyFileVerbose :: Verbosity -> FilePath -> FilePath -> IO ()Source
copyDirectoryRecursiveVerbose :: Verbosity -> FilePath -> FilePath -> IO ()Source
moduleToFilePathSource
:: [FilePath]search locations
-> StringModule Name
-> [String]possible suffixes
-> IO [FilePath]
Get the file path for this particular module. In the IO monad because it looks for the actual file. Might eventually interface with preprocessor libraries in order to correctly locate more filenames. Returns empty list if no such files exist.
moduleToFilePath2Source
:: [FilePath]search locations
-> StringModule Name
-> [String]possible suffixes
-> IO [(FilePath, FilePath)]locations and relative names
Like moduleToFilePath, but return the location and the rest of the path as separate results.
mkLibNameSource
:: FilePathfile Prefix
-> Stringlibrary name.
-> String
mkProfLibNameSource
:: FilePathfile Prefix
-> Stringlibrary name.
-> String
mkSharedLibNameSource
:: FilePathfile Prefix
-> Stringlibrary name.
-> PackageIdentifierpackage identifier of the compiler
-> String
currentDir :: FilePathSource
The path name that represents the current directory. In Unix, it's ".", but this is system-specific. (E.g. AmigaOS uses the empty string "" for the current directory.)
dotToSep :: String -> StringSource
findFileSource
:: [FilePath]search locations
-> FilePathFile Name
-> IO FilePath
findFileWithExtension :: [String] -> [FilePath] -> FilePath -> IO (Maybe FilePath)Source
findFileWithExtension' :: [String] -> [FilePath] -> FilePath -> IO (Maybe (FilePath, FilePath))Source
defaultPackageDesc :: Verbosity -> IO FilePathSource
Package description file (pkgname.cabal)
findPackageDescSource
:: VerbosityVerbosity
-> FilePathWhere to look
-> IO FilePath
Find a package description file in the given directory. Looks for .cabal files.
defaultHookedPackageDesc :: IO (Maybe FilePath)Source
Optional auxiliary package information file (pkgname.buildinfo)
findHookedPackageDescSource
:: FilePathDirectory to search
-> IO (Maybe FilePath)dir/pkgname.buildinfo, if present
Find auxiliary package information in the given directory. Looks for .buildinfo files.
exeExtension :: StringSource
Extension for executable files (typically "" on Unix and "exe" on Windows or OS/2)
objExtension :: StringSource
Extension for object files. For GHC and NHC the extension is "o". Hugs uses either "o" or "obj" depending on the used C compiler.
dllExtension :: StringSource
Extension for dynamically linked (or shared) libraries (typically "so" on Unix and "dll" on Windows)
Produced by Haddock version 0.9