import Version ( version, targetOS, targetARCH )
import Distribution.InstalledPackageInfo
import Distribution.Compat.ReadP
-import Distribution.ParseUtils ( showError, ParseResult(..) )
+import Distribution.ParseUtils ( showError )
import Distribution.Package
import Distribution.Version
import Compat.Directory ( getAppUserDataDirectory, createDirectoryIfMissing )
import Compat.RawSystem ( rawSystem )
-import Control.Exception ( evaluate )
import Prelude
return (PackageIdentifier{ pkgName = n, pkgVersion = globVersion }))
-- globVersion means "all versions"
+globVersion :: Version
globVersion = Version{ versionBranch=[], versionTags=["*"] }
-- -----------------------------------------------------------------------------
-- If we are not modifying (eg. list, describe etc.) then
-- the user database is included by default.
databases
- | modify = foldl addDB [global_conf] flags
- | not modify = foldl addDB [user_conf,global_conf] flags
+ | modify = foldl addDB [global_conf] flags
+ | otherwise = foldl addDB [user_conf,global_conf] flags
-- implement the following rules:
-- --user means overlap with the user database
readParseDatabase filename = do
str <- readFile filename
let packages = read str
- evaluate packages
+ Exception.evaluate packages
`Exception.catch` \_ ->
die (filename ++ ": parse error in package config file")
return (filename,packages)
prog <- getProgramName
die (usageInfo (usageHeader prog) flags)
+my_head :: String -> [a] -> a
my_head s [] = error s
my_head s (x:xs) = x
@$(RM) -f $(VERSION_HS)
@echo "Creating $(VERSION_HS) ... "
@echo "module Version where" >>$(VERSION_HS)
+ @echo "version, targetOS, targetARCH :: String" >>$(VERSION_HS)
@echo "version = \"$(ProjectVersion)\"" >> $(VERSION_HS)
@echo "targetOS = \"$(TargetOS_CPP)\"" >> $(VERSION_HS)
@echo "targetARCH = \"$(TargetArch_CPP)\"" >> $(VERSION_HS)