Commit d956739d authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Fit lines into 80 characters.

parent 481caa85
......@@ -12,21 +12,25 @@ import Util
newtype PackageDataKey = PackageDataKey (FilePath, String)
deriving (Show, Typeable, Eq, Hashable, Binary, NFData)
data PackageData = Modules FilePath | SrcDirs FilePath | PackageKey FilePath
| IncludeDirs FilePath | Deps FilePath | DepKeys FilePath
data PackageData = Modules FilePath
| SrcDirs FilePath
| PackageKey FilePath
| IncludeDirs FilePath
| Deps FilePath
| DepKeys FilePath
instance ShowArgs PackageData where
showArgs key = do
let (keyName, file, ifEmpty) = case key of
showArgs packageData = do
let (key, file, defaultValue) = case packageData of
Modules file -> ("MODULES" , file, "" )
SrcDirs file -> ("HS_SRC_DIRS" , file, ".")
PackageKey file -> ("PACKAGE_KEY" , file, "" )
IncludeDirs file -> ("INCLUDE_DIRS", file, ".")
Deps file -> ("DEPS" , file, "" )
DepKeys file -> ("DEP_KEYS" , file, "" )
keyFullName = replaceSeparators '_' $ takeDirectory file ++ "_" ++ keyName
res <- askOracle $ PackageDataKey (file, keyFullName)
fullKey = replaceSeparators '_' $ takeDirectory file ++ "_" ++ key
res <- askOracle $ PackageDataKey (file, fullKey)
return $ words $ case res of
Nothing -> error $ "\nCannot find key '" ++ keyName ++ "' in " ++ file ++ "."
Just "" -> ifEmpty
Nothing -> error $ "No key '" ++ key ++ "' in " ++ file ++ "."
Just "" -> defaultValue
Just value -> value
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment