remove unused adjustedBranchRefresh associated file parameter
This commit is contained in:
parent
e897229088
commit
4f1eea9061
19 changed files with 39 additions and 51 deletions
|
@ -308,16 +308,12 @@ updateAdjustedBranch adj (AdjBranch currbranch) origbranch
|
||||||
-- adjustment is stable.
|
-- adjustment is stable.
|
||||||
return True
|
return True
|
||||||
|
|
||||||
{- Passed an action that, if it succeeds may get or drop the Key associated
|
{- Passed an action that, if it succeeds may get or drop a key.
|
||||||
- with the file. When the adjusted branch needs to be refreshed to reflect
|
- When the adjusted branch needs to be refreshed to reflect
|
||||||
- those changes, it's handled here.
|
- those changes, it's handled here.
|
||||||
-
|
|
||||||
- Note that the AssociatedFile must be verified by this to point to the
|
|
||||||
- Key. In some cases, the value was provided by the user and might not
|
|
||||||
- really be an associated file.
|
|
||||||
-}
|
-}
|
||||||
adjustedBranchRefresh :: AssociatedFile -> Annex a -> Annex a
|
adjustedBranchRefresh :: Annex a -> Annex a
|
||||||
adjustedBranchRefresh _af a = do
|
adjustedBranchRefresh a = do
|
||||||
r <- a
|
r <- a
|
||||||
go
|
go
|
||||||
return r
|
return r
|
||||||
|
|
|
@ -376,16 +376,16 @@ lockContentUsing contentlocker key fallback a = withContentLockFile key $ \mlock
|
||||||
{- Runs an action, passing it the temp file to get,
|
{- Runs an action, passing it the temp file to get,
|
||||||
- and if the action succeeds, verifies the file matches
|
- and if the action succeeds, verifies the file matches
|
||||||
- the key and moves the file into the annex as a key's content. -}
|
- the key and moves the file into the annex as a key's content. -}
|
||||||
getViaTmp :: RetrievalSecurityPolicy -> VerifyConfig -> Key -> AssociatedFile -> Maybe FileSize -> (OsPath -> Annex (Bool, Verification)) -> Annex Bool
|
getViaTmp :: RetrievalSecurityPolicy -> VerifyConfig -> Key -> Maybe FileSize -> (OsPath -> Annex (Bool, Verification)) -> Annex Bool
|
||||||
getViaTmp rsp v key af sz action =
|
getViaTmp rsp v key sz action =
|
||||||
checkDiskSpaceToGet key sz False $
|
checkDiskSpaceToGet key sz False $
|
||||||
getViaTmpFromDisk rsp v key af action
|
getViaTmpFromDisk rsp v key action
|
||||||
|
|
||||||
{- Like getViaTmp, but does not check that there is enough disk space
|
{- Like getViaTmp, but does not check that there is enough disk space
|
||||||
- for the incoming key. For use when the key content is already on disk
|
- for the incoming key. For use when the key content is already on disk
|
||||||
- and not being copied into place. -}
|
- and not being copied into place. -}
|
||||||
getViaTmpFromDisk :: RetrievalSecurityPolicy -> VerifyConfig -> Key -> AssociatedFile -> (OsPath -> Annex (Bool, Verification)) -> Annex Bool
|
getViaTmpFromDisk :: RetrievalSecurityPolicy -> VerifyConfig -> Key -> (OsPath -> Annex (Bool, Verification)) -> Annex Bool
|
||||||
getViaTmpFromDisk rsp v key af action = checkallowed $ do
|
getViaTmpFromDisk rsp v key action = checkallowed $ do
|
||||||
tmpfile <- prepTmp key
|
tmpfile <- prepTmp key
|
||||||
resuming <- liftIO $ doesPathExist tmpfile
|
resuming <- liftIO $ doesPathExist tmpfile
|
||||||
(ok, verification) <- action tmpfile
|
(ok, verification) <- action tmpfile
|
||||||
|
@ -400,7 +400,7 @@ getViaTmpFromDisk rsp v key af action = checkallowed $ do
|
||||||
else verification
|
else verification
|
||||||
if ok
|
if ok
|
||||||
then ifM (verifyKeyContentPostRetrieval rsp v verification' key tmpfile)
|
then ifM (verifyKeyContentPostRetrieval rsp v verification' key tmpfile)
|
||||||
( pruneTmpWorkDirBefore tmpfile (moveAnnex key af)
|
( pruneTmpWorkDirBefore tmpfile (moveAnnex key)
|
||||||
, do
|
, do
|
||||||
verificationOfContentFailed tmpfile
|
verificationOfContentFailed tmpfile
|
||||||
return False
|
return False
|
||||||
|
@ -507,8 +507,8 @@ withTmp key action = do
|
||||||
- accepted into the repository. Will display a warning message in this
|
- accepted into the repository. Will display a warning message in this
|
||||||
- case. May also throw exceptions in some cases.
|
- case. May also throw exceptions in some cases.
|
||||||
-}
|
-}
|
||||||
moveAnnex :: Key -> AssociatedFile -> OsPath -> Annex Bool
|
moveAnnex :: Key -> OsPath -> Annex Bool
|
||||||
moveAnnex key af src = ifM (checkSecureHashes' key)
|
moveAnnex key src = ifM (checkSecureHashes' key)
|
||||||
( do
|
( do
|
||||||
#ifdef mingw32_HOST_OS
|
#ifdef mingw32_HOST_OS
|
||||||
{- Windows prevents deletion of files that are not
|
{- Windows prevents deletion of files that are not
|
||||||
|
@ -523,7 +523,7 @@ moveAnnex key af src = ifM (checkSecureHashes' key)
|
||||||
where
|
where
|
||||||
storeobject dest = ifM (liftIO $ doesPathExist dest)
|
storeobject dest = ifM (liftIO $ doesPathExist dest)
|
||||||
( alreadyhave
|
( alreadyhave
|
||||||
, adjustedBranchRefresh af $ modifyContentDir dest $ do
|
, adjustedBranchRefresh $ modifyContentDir dest $ do
|
||||||
liftIO $ moveFile src dest
|
liftIO $ moveFile src dest
|
||||||
-- Freeze the object file now that it is in place.
|
-- Freeze the object file now that it is in place.
|
||||||
-- Waiting until now to freeze it allows for freeze
|
-- Waiting until now to freeze it allows for freeze
|
||||||
|
@ -776,7 +776,7 @@ removeAnnex (ContentRemovalLock key) = withObjectLoc key $ \file ->
|
||||||
-- it's unmodified.
|
-- it's unmodified.
|
||||||
resetpointer file = unlessM (liftIO $ isSymbolicLink <$> R.getSymbolicLinkStatus (fromOsPath file)) $
|
resetpointer file = unlessM (liftIO $ isSymbolicLink <$> R.getSymbolicLinkStatus (fromOsPath file)) $
|
||||||
ifM (isUnmodified key file)
|
ifM (isUnmodified key file)
|
||||||
( adjustedBranchRefresh (AssociatedFile (Just file)) $
|
( adjustedBranchRefresh $
|
||||||
depopulatePointerFile key file
|
depopulatePointerFile key file
|
||||||
-- Modified file, so leave it alone.
|
-- Modified file, so leave it alone.
|
||||||
-- If it was a hard link to the annex object,
|
-- If it was a hard link to the annex object,
|
||||||
|
|
|
@ -863,7 +863,7 @@ importKeys remote importtreeconfig importcontent thirdpartypopulated importablec
|
||||||
ia loc [cid] tmpfile
|
ia loc [cid] tmpfile
|
||||||
(Left k)
|
(Left k)
|
||||||
(combineMeterUpdate p' p)
|
(combineMeterUpdate p' p)
|
||||||
ok <- moveAnnex k af tmpfile
|
ok <- moveAnnex k tmpfile
|
||||||
when ok $
|
when ok $
|
||||||
logStatus NoLiveUpdate k InfoPresent
|
logStatus NoLiveUpdate k InfoPresent
|
||||||
return (Just (k, ok))
|
return (Just (k, ok))
|
||||||
|
@ -906,7 +906,7 @@ importKeys remote importtreeconfig importcontent thirdpartypopulated importablec
|
||||||
p
|
p
|
||||||
case keyGitSha k of
|
case keyGitSha k of
|
||||||
Nothing -> do
|
Nothing -> do
|
||||||
ok <- moveAnnex k af tmpfile
|
ok <- moveAnnex k tmpfile
|
||||||
when ok $ do
|
when ok $ do
|
||||||
recordcidkey cidmap cid k
|
recordcidkey cidmap cid k
|
||||||
logStatus NoLiveUpdate k InfoPresent
|
logStatus NoLiveUpdate k InfoPresent
|
||||||
|
|
|
@ -198,17 +198,11 @@ ingest' preferredbackend meterupdate (Just (LockedDown cfg source)) mk restage =
|
||||||
| otherwise = gounlocked key mcache
|
| otherwise = gounlocked key mcache
|
||||||
|
|
||||||
golocked key mcache =
|
golocked key mcache =
|
||||||
tryNonAsync (moveAnnex key naf (contentLocation source)) >>= \case
|
tryNonAsync (moveAnnex key (contentLocation source)) >>= \case
|
||||||
Right True -> success key mcache
|
Right True -> success key mcache
|
||||||
Right False -> giveup "failed to add content to annex"
|
Right False -> giveup "failed to add content to annex"
|
||||||
Left e -> restoreFile (keyFilename source) key e
|
Left e -> restoreFile (keyFilename source) key e
|
||||||
|
|
||||||
-- moveAnnex uses the AssociatedFile provided to it to unlock
|
|
||||||
-- locked files when getting a file in an adjusted branch.
|
|
||||||
-- That case does not apply here, where we're adding an unlocked
|
|
||||||
-- file, so provide it nothing.
|
|
||||||
naf = AssociatedFile Nothing
|
|
||||||
|
|
||||||
gounlocked key (Just cache) = do
|
gounlocked key (Just cache) = do
|
||||||
-- Remove temp directory hard link first because
|
-- Remove temp directory hard link first because
|
||||||
-- linkToAnnex falls back to copying if a file
|
-- linkToAnnex falls back to copying if a file
|
||||||
|
@ -377,7 +371,7 @@ addAnnexedFile matcher file key mtmp = ifM (addUnlocked matcher mi (isJust mtmp)
|
||||||
stagePointerFile file mode =<< hashPointerFile key
|
stagePointerFile file mode =<< hashPointerFile key
|
||||||
Database.Keys.addAssociatedFile key =<< inRepo (toTopFilePath file)
|
Database.Keys.addAssociatedFile key =<< inRepo (toTopFilePath file)
|
||||||
case mtmp of
|
case mtmp of
|
||||||
Just tmp -> ifM (moveAnnex key af tmp)
|
Just tmp -> ifM (moveAnnex key tmp)
|
||||||
( linkunlocked mode >> return True
|
( linkunlocked mode >> return True
|
||||||
, writepointer mode >> return False
|
, writepointer mode >> return False
|
||||||
)
|
)
|
||||||
|
@ -388,11 +382,10 @@ addAnnexedFile matcher file key mtmp = ifM (addUnlocked matcher mi (isJust mtmp)
|
||||||
, do
|
, do
|
||||||
addSymlink file key Nothing
|
addSymlink file key Nothing
|
||||||
case mtmp of
|
case mtmp of
|
||||||
Just tmp -> moveAnnex key af tmp
|
Just tmp -> moveAnnex key tmp
|
||||||
Nothing -> return True
|
Nothing -> return True
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
af = AssociatedFile (Just file)
|
|
||||||
mi = case mtmp of
|
mi = case mtmp of
|
||||||
Just tmp -> MatchingFile $ FileInfo
|
Just tmp -> MatchingFile $ FileInfo
|
||||||
{ contentFile = tmp
|
{ contentFile = tmp
|
||||||
|
|
|
@ -78,7 +78,7 @@ download r key f d witness =
|
||||||
Just StallDetectionDisabled -> go Nothing
|
Just StallDetectionDisabled -> go Nothing
|
||||||
Just sd -> runTransferrer sd r key f d Download witness
|
Just sd -> runTransferrer sd r key f d Download witness
|
||||||
where
|
where
|
||||||
go sd = getViaTmp (Remote.retrievalSecurityPolicy r) vc key f Nothing $ \dest ->
|
go sd = getViaTmp (Remote.retrievalSecurityPolicy r) vc key Nothing $ \dest ->
|
||||||
download' (Remote.uuid r) key f sd d (go' dest) witness
|
download' (Remote.uuid r) key f sd d (go' dest) witness
|
||||||
go' dest p = verifiedAction $
|
go' dest p = verifiedAction $
|
||||||
Remote.retrieveKeyFile r key f dest p vc
|
Remote.retrieveKeyFile r key f dest p vc
|
||||||
|
|
|
@ -927,7 +927,7 @@ downloadGitBundle rmt k = getKeyExportLocations rmt k >>= \case
|
||||||
|
|
||||||
getexport loc = catchNonAsync (getexport' loc) (const (pure False))
|
getexport loc = catchNonAsync (getexport' loc) (const (pure False))
|
||||||
getexport' loc =
|
getexport' loc =
|
||||||
getViaTmp rsp vc k (AssociatedFile Nothing) Nothing $ \tmp -> do
|
getViaTmp rsp vc k Nothing $ \tmp -> do
|
||||||
v <- Remote.retrieveExport (Remote.exportActions rmt)
|
v <- Remote.retrieveExport (Remote.exportActions rmt)
|
||||||
k loc tmp nullMeterUpdate
|
k loc tmp nullMeterUpdate
|
||||||
return (True, v)
|
return (True, v)
|
||||||
|
@ -986,7 +986,7 @@ generateGitBundle rmt bs manifest =
|
||||||
tmp nullMeterUpdate
|
tmp nullMeterUpdate
|
||||||
if (bundlekey `notElem` inManifest manifest)
|
if (bundlekey `notElem` inManifest manifest)
|
||||||
then do
|
then do
|
||||||
unlessM (moveAnnex bundlekey (AssociatedFile Nothing) tmp) $
|
unlessM (moveAnnex bundlekey tmp) $
|
||||||
giveup "Unable to push"
|
giveup "Unable to push"
|
||||||
return (bundlekey, uploadaction bundlekey)
|
return (bundlekey, uploadaction bundlekey)
|
||||||
else return (bundlekey, noop)
|
else return (bundlekey, noop)
|
||||||
|
|
|
@ -213,7 +213,7 @@ storeReceived f = do
|
||||||
warning $ "Received a file " <> QuotedPath f <> " that is not a git-annex key. Deleting this file."
|
warning $ "Received a file " <> QuotedPath f <> " that is not a git-annex key. Deleting this file."
|
||||||
liftIO $ removeWhenExistsWith removeFile f
|
liftIO $ removeWhenExistsWith removeFile f
|
||||||
Just k -> void $ logStatusAfter NoLiveUpdate k $
|
Just k -> void $ logStatusAfter NoLiveUpdate k $
|
||||||
getViaTmpFromDisk RetrievalVerifiableKeysSecure AlwaysVerify k (AssociatedFile Nothing) $ \dest -> unVerified $
|
getViaTmpFromDisk RetrievalVerifiableKeysSecure AlwaysVerify k $ \dest -> unVerified $
|
||||||
liftIO $ catchBoolIO $ do
|
liftIO $ catchBoolIO $ do
|
||||||
renameFile f dest
|
renameFile f dest
|
||||||
return True
|
return True
|
||||||
|
|
|
@ -128,7 +128,7 @@ linkKey file oldkey newkey = ifM (isJust <$> isAnnexLink file)
|
||||||
- and vulnerable to corruption. -}
|
- and vulnerable to corruption. -}
|
||||||
linkKey' :: VerifyConfig -> Key -> Key -> Annex Bool
|
linkKey' :: VerifyConfig -> Key -> Key -> Annex Bool
|
||||||
linkKey' v oldkey newkey =
|
linkKey' v oldkey newkey =
|
||||||
getViaTmpFromDisk RetrievalAllKeysSecure v newkey (AssociatedFile Nothing) $ \tmp -> unVerified $ do
|
getViaTmpFromDisk RetrievalAllKeysSecure v newkey $ \tmp -> unVerified $ do
|
||||||
oldobj <- calcRepo (gitAnnexLocation oldkey)
|
oldobj <- calcRepo (gitAnnexLocation oldkey)
|
||||||
isJust <$> linkOrCopy' (return True) newkey oldobj tmp Nothing
|
isJust <$> linkOrCopy' (return True) newkey oldobj tmp Nothing
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ start :: (SeekInput, Key) -> CommandStart
|
||||||
start (_, key) = fieldTransfer Download key $ \_p -> do
|
start (_, key) = fieldTransfer Download key $ \_p -> do
|
||||||
-- This matches the retrievalSecurityPolicy of Remote.Git
|
-- This matches the retrievalSecurityPolicy of Remote.Git
|
||||||
let rsp = RetrievalAllKeysSecure
|
let rsp = RetrievalAllKeysSecure
|
||||||
ifM (getViaTmp rsp DefaultVerify key (AssociatedFile Nothing) Nothing go)
|
ifM (getViaTmp rsp DefaultVerify key Nothing go)
|
||||||
( do
|
( do
|
||||||
logStatus NoLiveUpdate key InfoPresent
|
logStatus NoLiveUpdate key InfoPresent
|
||||||
_ <- quiesce True
|
_ <- quiesce True
|
||||||
|
|
|
@ -129,7 +129,7 @@ perform src key = do
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
move = checkDiskSpaceToGet key Nothing False $
|
move = checkDiskSpaceToGet key Nothing False $
|
||||||
moveAnnex key (AssociatedFile Nothing) src
|
moveAnnex key src
|
||||||
|
|
||||||
cleanup :: Key -> CommandCleanup
|
cleanup :: Key -> CommandCleanup
|
||||||
cleanup key = do
|
cleanup key = do
|
||||||
|
|
|
@ -36,7 +36,7 @@ perform file key = do
|
||||||
-- the file might be on a different filesystem, so moveFile is used
|
-- the file might be on a different filesystem, so moveFile is used
|
||||||
-- rather than simply calling moveAnnex; disk space is also
|
-- rather than simply calling moveAnnex; disk space is also
|
||||||
-- checked this way.
|
-- checked this way.
|
||||||
ok <- getViaTmp RetrievalAllKeysSecure DefaultVerify key (AssociatedFile Nothing) Nothing $ \dest -> unVerified $
|
ok <- getViaTmp RetrievalAllKeysSecure DefaultVerify key Nothing $ \dest -> unVerified $
|
||||||
if dest /= file
|
if dest /= file
|
||||||
then liftIO $ catchBoolIO $ do
|
then liftIO $ catchBoolIO $ do
|
||||||
moveFile file dest
|
moveFile file dest
|
||||||
|
|
|
@ -301,7 +301,7 @@ test runannex mkr mkk =
|
||||||
Just verifier -> do
|
Just verifier -> do
|
||||||
loc <- Annex.calcRepo (gitAnnexLocation k)
|
loc <- Annex.calcRepo (gitAnnexLocation k)
|
||||||
verifier k loc
|
verifier k loc
|
||||||
get r k = logStatusAfter NoLiveUpdate k $ getViaTmp (Remote.retrievalSecurityPolicy r) (RemoteVerify r) k (AssociatedFile Nothing) Nothing $ \dest ->
|
get r k = logStatusAfter NoLiveUpdate k $ getViaTmp (Remote.retrievalSecurityPolicy r) (RemoteVerify r) k Nothing $ \dest ->
|
||||||
tryNonAsync (Remote.retrieveKeyFile r k (AssociatedFile Nothing) dest nullMeterUpdate (RemoteVerify r)) >>= \case
|
tryNonAsync (Remote.retrieveKeyFile r k (AssociatedFile Nothing) dest nullMeterUpdate (RemoteVerify r)) >>= \case
|
||||||
Right v -> return (True, v)
|
Right v -> return (True, v)
|
||||||
Left _ -> return (False, UnVerified)
|
Left _ -> return (False, UnVerified)
|
||||||
|
@ -375,13 +375,13 @@ testUnavailable runannex mkr mkk =
|
||||||
, check (`notElem` [Right True, Right False]) "checkPresent" $ \r k ->
|
, check (`notElem` [Right True, Right False]) "checkPresent" $ \r k ->
|
||||||
Remote.checkPresent r k
|
Remote.checkPresent r k
|
||||||
, check (== Right False) "retrieveKeyFile" $ \r k ->
|
, check (== Right False) "retrieveKeyFile" $ \r k ->
|
||||||
logStatusAfter NoLiveUpdate k $ getViaTmp (Remote.retrievalSecurityPolicy r) (RemoteVerify r) k (AssociatedFile Nothing) Nothing $ \dest ->
|
logStatusAfter NoLiveUpdate k $ getViaTmp (Remote.retrievalSecurityPolicy r) (RemoteVerify r) k Nothing $ \dest ->
|
||||||
tryNonAsync (Remote.retrieveKeyFile r k (AssociatedFile Nothing) dest nullMeterUpdate (RemoteVerify r)) >>= \case
|
tryNonAsync (Remote.retrieveKeyFile r k (AssociatedFile Nothing) dest nullMeterUpdate (RemoteVerify r)) >>= \case
|
||||||
Right v -> return (True, v)
|
Right v -> return (True, v)
|
||||||
Left _ -> return (False, UnVerified)
|
Left _ -> return (False, UnVerified)
|
||||||
, check (== Right False) "retrieveKeyFileCheap" $ \r k -> case Remote.retrieveKeyFileCheap r of
|
, check (== Right False) "retrieveKeyFileCheap" $ \r k -> case Remote.retrieveKeyFileCheap r of
|
||||||
Nothing -> return False
|
Nothing -> return False
|
||||||
Just a -> logStatusAfter NoLiveUpdate k $ getViaTmp (Remote.retrievalSecurityPolicy r) (RemoteVerify r) k (AssociatedFile Nothing) Nothing $ \dest ->
|
Just a -> logStatusAfter NoLiveUpdate k $ getViaTmp (Remote.retrievalSecurityPolicy r) (RemoteVerify r) k Nothing $ \dest ->
|
||||||
unVerified $ isRight
|
unVerified $ isRight
|
||||||
<$> tryNonAsync (a k (AssociatedFile Nothing) dest)
|
<$> tryNonAsync (a k (AssociatedFile Nothing) dest)
|
||||||
]
|
]
|
||||||
|
@ -443,7 +443,7 @@ randKey sz = withTmpFile (literalOsPath "randkey") $ \f h -> do
|
||||||
k <- case Types.Backend.genKey Backend.Hash.testKeyBackend of
|
k <- case Types.Backend.genKey Backend.Hash.testKeyBackend of
|
||||||
Just a -> a ks nullMeterUpdate
|
Just a -> a ks nullMeterUpdate
|
||||||
Nothing -> giveup "failed to generate random key (backend problem)"
|
Nothing -> giveup "failed to generate random key (backend problem)"
|
||||||
_ <- moveAnnex k (AssociatedFile Nothing) f
|
_ <- moveAnnex k f
|
||||||
return k
|
return k
|
||||||
|
|
||||||
getReadonlyKey :: Remote -> OsPath -> Annex Key
|
getReadonlyKey :: Remote -> OsPath -> Annex Key
|
||||||
|
|
|
@ -63,7 +63,7 @@ toPerform key af remote = go Upload af $
|
||||||
fromPerform :: Key -> AssociatedFile -> Remote -> CommandPerform
|
fromPerform :: Key -> AssociatedFile -> Remote -> CommandPerform
|
||||||
fromPerform key af remote = go Upload af $
|
fromPerform key af remote = go Upload af $
|
||||||
download' (uuid remote) key af Nothing stdRetry $ \p ->
|
download' (uuid remote) key af Nothing stdRetry $ \p ->
|
||||||
logStatusAfter NoLiveUpdate key $ getViaTmp (retrievalSecurityPolicy remote) vc key af Nothing $ \t ->
|
logStatusAfter NoLiveUpdate key $ getViaTmp (retrievalSecurityPolicy remote) vc key Nothing $ \t ->
|
||||||
tryNonAsync (Remote.retrieveKeyFile remote key af t p vc) >>= \case
|
tryNonAsync (Remote.retrieveKeyFile remote key af t p vc) >>= \case
|
||||||
Right v -> return (True, v)
|
Right v -> return (True, v)
|
||||||
Left e -> do
|
Left e -> do
|
||||||
|
|
|
@ -50,7 +50,7 @@ start = do
|
||||||
return True
|
return True
|
||||||
| otherwise = notifyTransfer direction af $
|
| otherwise = notifyTransfer direction af $
|
||||||
download' (Remote.uuid remote) key af Nothing stdRetry $ \p ->
|
download' (Remote.uuid remote) key af Nothing stdRetry $ \p ->
|
||||||
logStatusAfter NoLiveUpdate key $ getViaTmp (Remote.retrievalSecurityPolicy remote) (RemoteVerify remote) key af Nothing $ \t -> do
|
logStatusAfter NoLiveUpdate key $ getViaTmp (Remote.retrievalSecurityPolicy remote) (RemoteVerify remote) key Nothing $ \t -> do
|
||||||
r <- tryNonAsync (Remote.retrieveKeyFile remote key af t p (RemoteVerify remote)) >>= \case
|
r <- tryNonAsync (Remote.retrieveKeyFile remote key af t p (RemoteVerify remote)) >>= \case
|
||||||
Left e -> do
|
Left e -> do
|
||||||
warning (UnquotedString (show e))
|
warning (UnquotedString (show e))
|
||||||
|
|
|
@ -55,7 +55,7 @@ start = do
|
||||||
-- so caller is responsible for doing notification
|
-- so caller is responsible for doing notification
|
||||||
-- and for retrying, and updating location log,
|
-- and for retrying, and updating location log,
|
||||||
-- and stall canceling.
|
-- and stall canceling.
|
||||||
let go p = getViaTmp (Remote.retrievalSecurityPolicy remote) (RemoteVerify remote) key af Nothing $ \t -> do
|
let go p = getViaTmp (Remote.retrievalSecurityPolicy remote) (RemoteVerify remote) key Nothing $ \t -> do
|
||||||
Remote.verifiedAction (Remote.retrieveKeyFile remote key af t p (RemoteVerify remote))
|
Remote.verifiedAction (Remote.retrieveKeyFile remote key af t p (RemoteVerify remote))
|
||||||
in download' (Remote.uuid remote) key af Nothing noRetry go
|
in download' (Remote.uuid remote) key af Nothing noRetry go
|
||||||
noNotification
|
noNotification
|
||||||
|
@ -72,7 +72,7 @@ start = do
|
||||||
runner (AssistantDownloadRequest _ key (TransferAssociatedFile file)) remote =
|
runner (AssistantDownloadRequest _ key (TransferAssociatedFile file)) remote =
|
||||||
notifyTransfer Download file $
|
notifyTransfer Download file $
|
||||||
download' (Remote.uuid remote) key file Nothing stdRetry $ \p ->
|
download' (Remote.uuid remote) key file Nothing stdRetry $ \p ->
|
||||||
logStatusAfter NoLiveUpdate key $ getViaTmp (Remote.retrievalSecurityPolicy remote) (RemoteVerify remote) key file Nothing $ \t -> do
|
logStatusAfter NoLiveUpdate key $ getViaTmp (Remote.retrievalSecurityPolicy remote) (RemoteVerify remote) key Nothing $ \t -> do
|
||||||
r <- tryNonAsync (Remote.retrieveKeyFile remote key file t p (RemoteVerify remote)) >>= \case
|
r <- tryNonAsync (Remote.retrieveKeyFile remote key file t p (RemoteVerify remote)) >>= \case
|
||||||
Left e -> do
|
Left e -> do
|
||||||
warning (UnquotedString (show e))
|
warning (UnquotedString (show e))
|
||||||
|
|
|
@ -81,7 +81,7 @@ runLocal runst runner a = case a of
|
||||||
iv <- startVerifyKeyContentIncrementally DefaultVerify k
|
iv <- startVerifyKeyContentIncrementally DefaultVerify k
|
||||||
let runtransfer ti =
|
let runtransfer ti =
|
||||||
Right <$> transfer download' k af Nothing (\p ->
|
Right <$> transfer download' k af Nothing (\p ->
|
||||||
logStatusAfter NoLiveUpdate k $ getViaTmp rsp DefaultVerify k af Nothing $ \tmp ->
|
logStatusAfter NoLiveUpdate k $ getViaTmp rsp DefaultVerify k Nothing $ \tmp ->
|
||||||
storefile tmp o l getb iv validitycheck p ti)
|
storefile tmp o l getb iv validitycheck p ti)
|
||||||
let fallback = return $ Left $
|
let fallback = return $ Left $
|
||||||
ProtoFailureMessage "transfer already in progress, or unable to take transfer lock"
|
ProtoFailureMessage "transfer already in progress, or unable to take transfer lock"
|
||||||
|
|
|
@ -682,7 +682,7 @@ copyToRemote' repo r st@(State connpool duc _ _ _) key af o meterupdate
|
||||||
let checksuccess = liftIO checkio >>= \case
|
let checksuccess = liftIO checkio >>= \case
|
||||||
Just err -> giveup err
|
Just err -> giveup err
|
||||||
Nothing -> return True
|
Nothing -> return True
|
||||||
logStatusAfter NoLiveUpdate key $ Annex.Content.getViaTmp rsp verify key af (Just sz) $ \dest ->
|
logStatusAfter NoLiveUpdate key $ Annex.Content.getViaTmp rsp verify key (Just sz) $ \dest ->
|
||||||
metered (Just (combineMeterUpdate meterupdate p)) key bwlimit $ \_ p' ->
|
metered (Just (combineMeterUpdate meterupdate p)) key bwlimit $ \_ p' ->
|
||||||
copier object dest key p' checksuccess verify
|
copier object dest key p' checksuccess verify
|
||||||
)
|
)
|
||||||
|
|
|
@ -25,8 +25,7 @@ upgrade = do
|
||||||
olddir <- fromRepo gitAnnexDir
|
olddir <- fromRepo gitAnnexDir
|
||||||
keys <- getKeysPresent0 olddir
|
keys <- getKeysPresent0 olddir
|
||||||
forM_ keys $ \k ->
|
forM_ keys $ \k ->
|
||||||
moveAnnex k (AssociatedFile Nothing)
|
moveAnnex k (olddir </> toOsPath (keyFile0 k))
|
||||||
(olddir </> toOsPath (keyFile0 k))
|
|
||||||
|
|
||||||
-- update the symlinks to the key files
|
-- update the symlinks to the key files
|
||||||
-- No longer needed here; V1.upgrade does the same thing
|
-- No longer needed here; V1.upgrade does the same thing
|
||||||
|
|
|
@ -85,7 +85,7 @@ moveContent = do
|
||||||
let d = parentDir f
|
let d = parentDir f
|
||||||
liftIO $ allowWrite d
|
liftIO $ allowWrite d
|
||||||
liftIO $ allowWrite f
|
liftIO $ allowWrite f
|
||||||
_ <- moveAnnex k (AssociatedFile Nothing) f
|
_ <- moveAnnex k f
|
||||||
liftIO $ removeDirectory d
|
liftIO $ removeDirectory d
|
||||||
|
|
||||||
updateSymlinks :: Annex ()
|
updateSymlinks :: Annex ()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue