diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-01-07 14:51:28 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-01-07 15:14:15 -0400 |
commit | de92739546ba6fd82963e9932d622b891f8ff096 (patch) | |
tree | b60fc4d87f9ac341c3babf68fe020eeaacb52a18 /Command/Migrate.hs | |
parent | 3729ee0549993ccb648b7f798c9c400661350cdf (diff) |
migrate and rekey v6 unlocked file support
Diffstat (limited to 'Command/Migrate.hs')
-rw-r--r-- | Command/Migrate.hs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Command/Migrate.hs b/Command/Migrate.hs index ad3a5efa1..87e4772d1 100644 --- a/Command/Migrate.hs +++ b/Command/Migrate.hs @@ -74,9 +74,12 @@ perform file oldkey oldbackend newbackend = go =<< genkey | knowngoodcontent = finish newkey | otherwise = stopUnless checkcontent $ finish newkey checkcontent = Command.Fsck.checkBackend oldbackend oldkey Command.Fsck.KeyLocked $ Just file - finish newkey = stopUnless (Command.ReKey.linkKey oldkey newkey) $ do - copyMetaData oldkey newkey - next $ Command.ReKey.cleanup file oldkey newkey + finish newkey = ifM (Command.ReKey.linkKey file oldkey newkey) + ( do + copyMetaData oldkey newkey + next $ Command.ReKey.cleanup file oldkey newkey + , error "failed" + ) genkey = case maybe Nothing (\fm -> fm oldkey newbackend (Just file)) (fastMigrate oldbackend) of Just newkey -> return $ Just (newkey, True) Nothing -> do |