fix storing outManifest
This commit is contained in:
parent
b3d7ae51f0
commit
dc083bf8c8
1 changed files with 9 additions and 4 deletions
|
@ -525,6 +525,13 @@ getEnabledSpecialRemoteByName remotename =
|
||||||
maybe (return (Just rmt)) giveup
|
maybe (return (Just rmt)) giveup
|
||||||
(checkSpecialRemoteProblems rmt)
|
(checkSpecialRemoteProblems rmt)
|
||||||
|
|
||||||
|
formatManifest :: Manifest -> B.ByteString
|
||||||
|
formatManifest manifest =
|
||||||
|
B8.unlines $
|
||||||
|
map serializeKey' (inManifest manifest)
|
||||||
|
<>
|
||||||
|
map (\k -> "-" <> serializeKey' k) (outManifest manifest)
|
||||||
|
|
||||||
parseManifest :: B.ByteString -> Either String Manifest
|
parseManifest :: B.ByteString -> Either String Manifest
|
||||||
parseManifest b =
|
parseManifest b =
|
||||||
let (outks, inks) = partitionEithers $ map parseline $ B8.lines b
|
let (outks, inks) = partitionEithers $ map parseline $ B8.lines b
|
||||||
|
@ -650,15 +657,13 @@ uploadManifest rmt manifest = do
|
||||||
mkbak = genBackupManifestKey (Remote.uuid rmt)
|
mkbak = genBackupManifestKey (Remote.uuid rmt)
|
||||||
|
|
||||||
uploadfailed = giveup "Failed to upload manifest."
|
uploadfailed = giveup "Failed to upload manifest."
|
||||||
|
|
||||||
manifestcontent = B8.unlines $ map serializeKey' (inManifest manifest)
|
|
||||||
|
|
||||||
dropandput mk = do
|
dropandput mk = do
|
||||||
dropKey' rmt mk
|
dropKey' rmt mk
|
||||||
put mk
|
put mk
|
||||||
|
|
||||||
put mk = withTmpFile "GITMANIFEST" $ \tmp tmph -> do
|
put mk = withTmpFile "GITMANIFEST" $ \tmp tmph -> do
|
||||||
liftIO $ B8.hPut tmph manifestcontent
|
liftIO $ B8.hPut tmph (formatManifest manifest)
|
||||||
liftIO $ hClose tmph
|
liftIO $ hClose tmph
|
||||||
-- storeKey needs the key to be in the annex objects
|
-- storeKey needs the key to be in the annex objects
|
||||||
-- directory, so put the manifest file there temporarily.
|
-- directory, so put the manifest file there temporarily.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue