add INPUT-REQUIRED
Used by git-annex-compute-singularity to make addcomputed --fast work. Also, simplified git-annex-compute-singularity; there is no need to hard link the container into place. singularity does not care about the extension of the container, so can just pass it the annex object file.
This commit is contained in:
parent
bb0bc078fc
commit
0477a8d098
6 changed files with 83 additions and 66 deletions
|
@ -206,14 +206,14 @@ addComputed maddaction stagefiles r reproducibleconfig choosebackend destfile fa
|
|||
Just v -> isReproducible v
|
||||
Nothing -> Remote.Compute.computeReproducible result
|
||||
|
||||
getInputContent :: Bool -> OsPath -> Annex (Key, Maybe (Either Git.Sha OsPath))
|
||||
getInputContent fast p = catKeyFile p >>= \case
|
||||
Just inputkey -> getInputContent' fast inputkey filedesc
|
||||
getInputContent :: Bool -> OsPath -> Bool -> Annex (Key, Maybe (Either Git.Sha OsPath))
|
||||
getInputContent fast p required = catKeyFile p >>= \case
|
||||
Just inputkey -> getInputContent' fast inputkey required filedesc
|
||||
Nothing -> inRepo (Git.fileRef p) >>= \case
|
||||
Just fileref -> catObjectMetaData fileref >>= \case
|
||||
Just (sha, _, t)
|
||||
| t == Git.BlobObject ->
|
||||
getInputContent' fast (gitShaKey sha) filedesc
|
||||
getInputContent' fast (gitShaKey sha) required filedesc
|
||||
| otherwise ->
|
||||
badinput $ ", not a git " ++ decodeBS (Git.fmtObjectType t)
|
||||
Nothing -> notcheckedin
|
||||
|
@ -223,9 +223,9 @@ getInputContent fast p = catKeyFile p >>= \case
|
|||
badinput s = giveup $ "The computation needs an input file " ++ s ++ ": " ++ fromOsPath p
|
||||
notcheckedin = badinput "that is not checked into the git repository"
|
||||
|
||||
getInputContent' :: Bool -> Key -> String -> Annex (Key, Maybe (Either Git.Sha OsPath))
|
||||
getInputContent' fast inputkey filedesc
|
||||
| fast = return (inputkey, Nothing)
|
||||
getInputContent' :: Bool -> Key -> Bool -> String -> Annex (Key, Maybe (Either Git.Sha OsPath))
|
||||
getInputContent' fast inputkey required filedesc
|
||||
| fast && not required = return (inputkey, Nothing)
|
||||
| otherwise = case keyGitSha inputkey of
|
||||
Nothing -> ifM (inAnnex inputkey)
|
||||
( do
|
||||
|
|
|
@ -152,14 +152,14 @@ perform o r file origkey origstate = do
|
|||
check "not outputting"
|
||||
Remote.Compute.computeOutputs origstate state
|
||||
|
||||
getinputcontent program p
|
||||
getinputcontent program p required
|
||||
| originalOption o =
|
||||
case M.lookup p (Remote.Compute.computeInputs origstate) of
|
||||
Just inputkey -> getInputContent' False inputkey
|
||||
Just inputkey -> getInputContent' False inputkey required
|
||||
(fromOsPath p ++ "(key " ++ serializeKey inputkey ++ ")")
|
||||
Nothing -> Remote.Compute.computationBehaviorChangeError program
|
||||
"requesting a new input file" p
|
||||
| otherwise = getInputContent False p
|
||||
| otherwise = getInputContent False p required
|
||||
|
||||
destfile outputfile
|
||||
| Just outputfile == origfile = Just file
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue