mirror of
https://github.com/commercialhaskell/stackage.git
synced 2026-01-11 23:08:30 +01:00
Warnings cleanup
This commit is contained in:
parent
771e1967de
commit
29ebe5d88b
@ -20,7 +20,6 @@ import Distribution.Package (Dependency (..))
|
||||
import Distribution.System (Arch, OS)
|
||||
import qualified Distribution.System
|
||||
import Distribution.Version (anyVersion)
|
||||
import Distribution.Version (anyVersion)
|
||||
import Filesystem (isFile)
|
||||
import Network.HTTP.Client (Manager, httpLbs, responseBody)
|
||||
import Stackage.CorePackages
|
||||
@ -144,8 +143,6 @@ getSystemInfo = do
|
||||
siOS = Distribution.System.Linux
|
||||
siArch = Distribution.System.X86_64
|
||||
|
||||
loadBuildConstraints fp = decodeFileEither fp >>= either throwIO toBC
|
||||
|
||||
data ConstraintFile = ConstraintFile
|
||||
{ cfGlobalFlags :: Map FlagName Bool
|
||||
, cfPackageFlags :: Map PackageName (Map FlagName Bool)
|
||||
|
||||
@ -103,15 +103,21 @@ waitForDeps toolMap packageMap activeComps bp pi action = do
|
||||
isCore = (`member` siCorePackages (bpSystemInfo bp))
|
||||
isCoreExe = (`member` siCoreExecutables (bpSystemInfo bp))
|
||||
|
||||
withCounter :: TVar Int -> IO a -> IO a
|
||||
withCounter counter = bracket_
|
||||
(atomically $ modifyTVar counter (+ 1))
|
||||
(atomically $ modifyTVar counter (subtract 1))
|
||||
|
||||
withTSem :: TSem -> IO a -> IO a
|
||||
withTSem sem = bracket_ (atomically $ waitTSem sem) (atomically $ signalTSem sem)
|
||||
|
||||
-- | Returns @Nothing@ if installing to a global database
|
||||
pbDatabase :: PerformBuild -> Maybe FilePath
|
||||
pbDatabase pb
|
||||
| pbGlobalInstall pb = Nothing
|
||||
| otherwise = Just $ pbInstallDest pb </> "pkgdb"
|
||||
|
||||
pbBinDir, pbLibDir, pbDataDir, pbDocDir :: PerformBuild -> FilePath
|
||||
pbBinDir pb = pbInstallDest pb </> "bin"
|
||||
pbLibDir pb = pbInstallDest pb </> "lib"
|
||||
pbDataDir pb = pbInstallDest pb </> "share"
|
||||
@ -260,9 +266,9 @@ singleBuild pb@PerformBuild {..} SingleBuild {..} =
|
||||
testOut = pbLogDir </> fpFromText namever </> "test.out"
|
||||
testRunOut = pbLogDir </> fpFromText namever </> "test-run.out"
|
||||
|
||||
wf fp inner = do
|
||||
wf fp inner' = do
|
||||
createTree $ parent fp
|
||||
withBinaryFile (fpToString fp) WriteMode inner
|
||||
withBinaryFile (fpToString fp) WriteMode inner'
|
||||
|
||||
configArgs = ($ []) $ execWriter $ do
|
||||
tell' "--package-db=clear"
|
||||
@ -279,9 +285,9 @@ singleBuild pb@PerformBuild {..} SingleBuild {..} =
|
||||
flags :: Text
|
||||
flags = unwords $ map go $ mapToList pcFlagOverrides
|
||||
where
|
||||
go (name, isOn) = concat
|
||||
go (name', isOn) = concat
|
||||
[ if isOn then "" else "-"
|
||||
, unFlagName name
|
||||
, unFlagName name'
|
||||
]
|
||||
|
||||
PackageConstraints {..} = ppConstraints $ piPlan sbPackageInfo
|
||||
|
||||
@ -20,7 +20,6 @@ import Distribution.Version as X (Version (..),
|
||||
VersionRange)
|
||||
import Distribution.Version as X (withinRange)
|
||||
import qualified Distribution.Version as C
|
||||
import System.Exit (ExitCode (ExitSuccess))
|
||||
|
||||
unPackageName :: PackageName -> Text
|
||||
unPackageName (PackageName str) = pack str
|
||||
|
||||
@ -90,6 +90,7 @@ data UploadDocs = UploadDocs
|
||||
, udSnapshot :: SnapshotIdent
|
||||
}
|
||||
|
||||
uploadDocs :: UploadDocs -> Manager -> IO (Response LByteString)
|
||||
uploadDocs (UploadDocs (StackageServer host) fp0 token ident) man = do
|
||||
fe <- isFile fp0
|
||||
if fe
|
||||
@ -179,6 +180,7 @@ data UploadDocMap = UploadDocMap
|
||||
, udmPlan :: BuildPlan
|
||||
}
|
||||
|
||||
uploadDocMap :: UploadDocMap -> Manager -> IO (Response LByteString)
|
||||
uploadDocMap UploadDocMap {..} man = do
|
||||
docmap <- docsListing udmPlan udmDocDir
|
||||
req1 <- parseUrl $ unpack $ unStackageServer udmServer ++ "/upload-doc-map"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user