summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-12-29 16:25:12 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-12-29 16:25:12 -0400
commitab26861d24c42d9b66ba8fc1463a4ee99071e8a3 (patch)
tree96cc55452c5a6ab7b0cf66f1a5c1321a9c544999
parent98ee54531b9e92f1646396ff4a8be7a86d0c7bcb (diff)
work around windows insanity that is 97.61% more brain-damaged than normal
-rw-r--r--Utility/Tmp.hs10
-rw-r--r--doc/bugs/failure_during_ssh_key_setup___40__windows__41__.mdwn2
2 files changed, 12 insertions, 0 deletions
diff --git a/Utility/Tmp.hs b/Utility/Tmp.hs
index 186cd121a..8c897d749 100644
--- a/Utility/Tmp.hs
+++ b/Utility/Tmp.hs
@@ -5,6 +5,8 @@
- Licensed under the GNU GPL version 3 or higher.
-}
+{-# LANGUAGE CPP #-}
+
module Utility.Tmp where
import Control.Exception (bracket)
@@ -62,7 +64,15 @@ withTmpDirIn :: FilePath -> Template -> (FilePath -> IO a) -> IO a
withTmpDirIn tmpdir template = bracket create remove
where
remove d = whenM (doesDirectoryExist d) $
+#if mingw32_HOST_OS
+ -- Windows will often refuse to delete a file
+ -- after a process has just written to it and exited.
+ -- Because it's crap, presumably. So, ignore failure
+ -- to delete the temp directory.
+ catchIO $ removeDirectoryRecursive d
+#else
removeDirectoryRecursive d
+#endif
create = do
createDirectoryIfMissing True tmpdir
makenewdir (tmpdir </> template) (0 :: Int)
diff --git a/doc/bugs/failure_during_ssh_key_setup___40__windows__41__.mdwn b/doc/bugs/failure_during_ssh_key_setup___40__windows__41__.mdwn
index 7c45afb65..7f1f26e04 100644
--- a/doc/bugs/failure_during_ssh_key_setup___40__windows__41__.mdwn
+++ b/doc/bugs/failure_during_ssh_key_setup___40__windows__41__.mdwn
@@ -8,3 +8,5 @@ Create a remote repository
### What version of git-annex are you using? On what operating system?
Windows 7, git-annex version 5.20131221-gf8c928d
+
+> [[fixed|done]].. thanks for testing the assistant on windows! --[[Joey]]