summaryrefslogtreecommitdiff
path: root/Utility
diff options
context:
space:
mode:
authorGravatar Joey Hess <id@joeyh.name>2013-05-13 20:11:30 -0500
committerGravatar Joey Hess <id@joeyh.name>2013-05-13 20:11:30 -0500
commit174da3515594fea9ebc1b346d8a52bfd16a443bf (patch)
tree8bcd7d29a90fa2925a4916ef6f1ab0ef8e6e193a /Utility
parent13c19fb0a0d1df6bfdd9ba2bca3eb45d624015d5 (diff)
parent1dd4574909b40ffdb77ae1338b353156d73983af (diff)
Merge branch 'windows' of git://git-annex.branchable.com into windows
Diffstat (limited to 'Utility')
-rw-r--r--Utility/Directory.hs2
-rw-r--r--[-rwxr-xr-x]Utility/Env.hs0
-rw-r--r--Utility/Gpg.hs1
-rw-r--r--[-rwxr-xr-x]Utility/Path.hs0
-rw-r--r--[-rwxr-xr-x]Utility/Tmp.hs (renamed from Utility/TempFile.hs)24
-rw-r--r--[-rwxr-xr-x]Utility/UserInfo.hs0
-rw-r--r--Utility/WebApp.hs2
7 files changed, 15 insertions, 14 deletions
diff --git a/Utility/Directory.hs b/Utility/Directory.hs
index 599d41a03..9477ad5b9 100644
--- a/Utility/Directory.hs
+++ b/Utility/Directory.hs
@@ -18,7 +18,7 @@ import Control.Applicative
import System.IO.Unsafe (unsafeInterleaveIO)
import Utility.SafeCommand
-import Utility.TempFile
+import Utility.Tmp
import Utility.Exception
import Utility.Monad
diff --git a/Utility/Env.hs b/Utility/Env.hs
index cb738732f..cb738732f 100755..100644
--- a/Utility/Env.hs
+++ b/Utility/Env.hs
diff --git a/Utility/Gpg.hs b/Utility/Gpg.hs
index d3460bdf7..e33f5156a 100644
--- a/Utility/Gpg.hs
+++ b/Utility/Gpg.hs
@@ -13,6 +13,7 @@ import System.Posix.Types
import Control.Applicative
import Control.Concurrent
import Control.Exception (bracket)
+import System.Path
import Common
import Utility.Env
diff --git a/Utility/Path.hs b/Utility/Path.hs
index 2c2fc35ff..2c2fc35ff 100755..100644
--- a/Utility/Path.hs
+++ b/Utility/Path.hs
diff --git a/Utility/TempFile.hs b/Utility/Tmp.hs
index 58d07c3a2..f03e4c0dc 100755..100644
--- a/Utility/TempFile.hs
+++ b/Utility/Tmp.hs
@@ -1,11 +1,11 @@
-{- temp file functions
+{- Temporary files and directories.
-
- Copyright 2010-2013 Joey Hess <joey@kitenet.net>
-
- Licensed under the GNU GPL version 3 or higher.
-}
-module Utility.TempFile where
+module Utility.Tmp where
import Control.Exception (bracket)
import System.IO
@@ -31,15 +31,15 @@ viaTmp a file content = do
{- Runs an action with a tmp file located in the system's tmp directory
- (or in "." if there is none) then removes the file. -}
-withTempFile :: Template -> (FilePath -> Handle -> IO a) -> IO a
-withTempFile template a = do
+withTmpFile :: Template -> (FilePath -> Handle -> IO a) -> IO a
+withTmpFile template a = do
tmpdir <- catchDefaultIO "." getTemporaryDirectory
- withTempFileIn tmpdir template a
+ withTmpFileIn tmpdir template a
{- Runs an action with a tmp file located in the specified directory,
- then removes the file. -}
-withTempFileIn :: FilePath -> Template -> (FilePath -> Handle -> IO a) -> IO a
-withTempFileIn tmpdir template a = bracket create remove use
+withTmpFileIn :: FilePath -> Template -> (FilePath -> Handle -> IO a) -> IO a
+withTmpFileIn tmpdir template a = bracket create remove use
where
create = openTempFile tmpdir template
remove (name, handle) = do
@@ -50,15 +50,15 @@ withTempFileIn tmpdir template a = bracket create remove use
{- Runs an action with a tmp directory located within the system's tmp
- directory (or within "." if there is none), then removes the tmp
- directory and all its contents. -}
-withTempDir :: Template -> (FilePath -> IO a) -> IO a
-withTempDir template a = do
+withTmpDir :: Template -> (FilePath -> IO a) -> IO a
+withTmpDir template a = do
tmpdir <- catchDefaultIO "." getTemporaryDirectory
- withTempDirIn tmpdir template a
+ withTmpDirIn tmpdir template a
{- Runs an action with a tmp directory located within a specified directory,
- then removes the tmp directory and all its contents. -}
-withTempDirIn :: FilePath -> Template -> (FilePath -> IO a) -> IO a
-withTempDirIn tmpdir template = bracket create remove
+withTmpDirIn :: FilePath -> Template -> (FilePath -> IO a) -> IO a
+withTmpDirIn tmpdir template = bracket create remove
where
remove d = whenM (doesDirectoryExist d) $
removeDirectoryRecursive d
diff --git a/Utility/UserInfo.hs b/Utility/UserInfo.hs
index 3a71c6baf..3a71c6baf 100755..100644
--- a/Utility/UserInfo.hs
+++ b/Utility/UserInfo.hs
diff --git a/Utility/WebApp.hs b/Utility/WebApp.hs
index 0614384a1..762819b2f 100644
--- a/Utility/WebApp.hs
+++ b/Utility/WebApp.hs
@@ -10,7 +10,7 @@
module Utility.WebApp where
import Common
-import Utility.TempFile
+import Utility.Tmp
import Utility.FileMode
import qualified Yesod