let st = go emptycomputestate (parseQuery b)
in if st == emptycomputestate then Nothing else Just st
where
- emptycomputestate = ComputeState mempty mempty mempty "." False False
+ emptycomputestate = ComputeState
+ { computeParams = mempty
+ , computeInputs = mempty
+ , computeOutputs = mempty
+ , computeSubdir = literalOsPath "."
+ , computeReproducible = False
+ , computeInputsUnavailable = False
+ }
+
go :: ComputeState -> [QueryItem] -> ComputeState
go c [] = c { computeParams = reverse (computeParams c) }
go c ((f, v):rest) =
-> Annex v
runComputeProgram (ComputeProgram program) state (ImmutableState immutablestate) getinputcontent cont =
withOtherTmp $ \othertmpdir ->
- withTmpDirIn othertmpdir "compute" go
+ withTmpDirIn othertmpdir (literalOsPath "compute") go
where
go tmpdir = do
environ <- computeProgramEnvironment state
-- to the program as a parameter, which could parse it as a dashed
-- option or other special parameter.
populategitsha gitsha tmpdir = do
- let f = tmpdir </> ".git" </> "objects"
+ let f = tmpdir </> literalOsPath ".git" </> literalOsPath "objects"
</> toOsPath (Git.fromRef' gitsha)
liftIO $ createDirectoryIfMissing True $ takeDirectory f
liftIO . F.writeFile f =<< catObject gitsha
missingstate = giveup "Missing compute state"
getinputcontent state f =
- case M.lookup (fromOsPath f) (computeInputs state) of
+ case M.lookup f (computeInputs state) of
Just inputkey -> case keyGitSha inputkey of
Nothing ->
let retkey = do