This commit is contained in:
Joey Hess 2011-10-31 16:46:51 -04:00
parent 00988bcf36
commit 3d2a9f8405
11 changed files with 48 additions and 54 deletions

View file

@ -56,11 +56,7 @@ perform file oldkey newbackend = do
case k of
Nothing -> stop
Just (newkey, _) -> do
ok <- getViaTmpUnchecked newkey $ \t -> do
-- Make a hard link to the old backend's
-- cached key, to avoid wasting disk space.
liftIO $ unlessM (doesFileExist t) $ createLink src t
return True
ok <- link src newkey
if ok
then do
-- Update symlink to use the new key.
@ -77,3 +73,8 @@ perform file oldkey newbackend = do
else stop
where
cleantmp t = whenM (doesFileExist t) $ removeFile t
link src newkey = getViaTmpUnchecked newkey $ \t -> do
-- Make a hard link to the old backend's
-- cached key, to avoid wasting disk space.
liftIO $ unlessM (doesFileExist t) $ createLink src t
return True