replace removeLink with removeFile
same reasoning as in commit 5cc8d9d03b
This commit is contained in:
parent
90eb1e2da6
commit
f8bb9a8734
9 changed files with 16 additions and 21 deletions
|
@ -61,7 +61,7 @@ cleanupOtherTmp = do
|
|||
tmpdir <- fromRepo gitAnnexTmpOtherDir
|
||||
void $ liftIO $ tryIO $ removeDirectoryRecursive tmpdir
|
||||
oldtmp <- fromRepo gitAnnexTmpOtherDirOld
|
||||
liftIO $ mapM_ (cleanold . fromOsPath)
|
||||
liftIO $ mapM_ cleanold
|
||||
=<< emptyWhenDoesNotExist (dirContentsRecursive oldtmp)
|
||||
-- remove when empty
|
||||
liftIO $ void $ tryIO $ removeDirectory oldtmp
|
||||
|
@ -69,7 +69,7 @@ cleanupOtherTmp = do
|
|||
cleanold f = do
|
||||
now <- liftIO getPOSIXTime
|
||||
let oldenough = now - (60 * 60 * 24 * 7)
|
||||
catchMaybeIO (modificationTime <$> R.getSymbolicLinkStatus f) >>= \case
|
||||
catchMaybeIO (modificationTime <$> R.getSymbolicLinkStatus (fromOsPath f)) >>= \case
|
||||
Just mtime | realToFrac mtime <= oldenough ->
|
||||
void $ tryIO $ removeWhenExistsWith R.removeLink f
|
||||
void $ tryIO $ removeWhenExistsWith removeFile f
|
||||
_ -> return ()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue