diff options
author | Joey Hess <joey@kitenet.net> | 2012-12-13 00:45:27 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-12-13 00:45:27 -0400 |
commit | 7db480af0f944ca0e6c062cd1243c63ad7f878d1 (patch) | |
tree | 21d7efe0b866dd7db1a5396a842652f49c676e84 /Utility | |
parent | 94554782894ec6c26da3b46312d5d1d16d596458 (diff) |
whitespace fixes
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/DirWatcher.hs | 43 | ||||
-rw-r--r-- | Utility/Gpg.hs | 2 | ||||
-rw-r--r-- | Utility/JSONStream.hs | 6 | ||||
-rw-r--r-- | Utility/TempFile.hs | 2 |
4 files changed, 25 insertions, 28 deletions
diff --git a/Utility/DirWatcher.hs b/Utility/DirWatcher.hs index b70e84b77..d564f8bcf 100644 --- a/Utility/DirWatcher.hs +++ b/Utility/DirWatcher.hs @@ -35,13 +35,12 @@ canWatch = True canWatch = False #endif -/* With inotify, discrete events will be received when making multiple changes - * to the same filename. For example, adding it, deleting it, and adding it - * again will be three events. - * - * OTOH, with kqueue, often only one event is received, indicating the most - * recent state of the file. - */ +{- With inotify, discrete events will be received when making multiple changes + - to the same filename. For example, adding it, deleting it, and adding it + - again will be three events. + - + - OTOH, with kqueue, often only one event is received, indicating the most + - recent state of the file. -} eventsCoalesce :: Bool #if WITH_INOTIFY eventsCoalesce = False @@ -53,14 +52,13 @@ eventsCoalesce = undefined #endif #endif -/* With inotify, file closing is tracked to some extent, so an add event - * will always be received for a file once its writer closes it, and - * (typically) not before. This may mean multiple add events for the same file. - * - * OTOH, with kqueue, add events will often be received while a file is - * still being written to, and then no add event will be received once the - * writer closes it. - */ +{- With inotify, file closing is tracked to some extent, so an add event + - will always be received for a file once its writer closes it, and + - (typically) not before. This may mean multiple add events for the same file. + - + - OTOH, with kqueue, add events will often be received while a file is + - still being written to, and then no add event will be received once the + - writer closes it. -} closingTracked :: Bool #if WITH_INOTIFY closingTracked = True @@ -72,9 +70,8 @@ closingTracked = undefined #endif #endif -/* With inotify, modifications to existing files can be tracked. - * Kqueue does not support this. - */ +{- With inotify, modifications to existing files can be tracked. + - Kqueue does not support this. -} modifyTracked :: Bool #if WITH_INOTIFY modifyTracked = True @@ -86,11 +83,11 @@ modifyTracked = undefined #endif #endif -/* Starts a watcher thread. The runStartup action is passed a scanner action - * to run, that will return once the initial directory scan is complete. - * Once runStartup returns, the watcher thread continues running, - * and processing events. Returns a DirWatcherHandle that can be used - * to shutdown later. */ +{- Starts a watcher thread. The runStartup action is passed a scanner action + - to run, that will return once the initial directory scan is complete. + - Once runStartup returns, the watcher thread continues running, + - and processing events. Returns a DirWatcherHandle that can be used + - to shutdown later. -} #if WITH_INOTIFY type DirWatcherHandle = INotify.INotify watchDir :: FilePath -> Pruner -> WatchHooks -> (IO () -> IO ()) -> IO DirWatcherHandle diff --git a/Utility/Gpg.hs b/Utility/Gpg.hs index 8c7a3ac38..ca017ed3a 100644 --- a/Utility/Gpg.hs +++ b/Utility/Gpg.hs @@ -16,7 +16,7 @@ import System.Posix.Env (setEnv, unsetEnv, getEnv) import Common newtype KeyIds = KeyIds [String] - deriving (Ord, Eq) + deriving (Ord, Eq) stdParams :: [CommandParam] -> IO [String] stdParams params = do diff --git a/Utility/JSONStream.hs b/Utility/JSONStream.hs index aaa332bca..f3e93c3da 100644 --- a/Utility/JSONStream.hs +++ b/Utility/JSONStream.hs @@ -14,9 +14,9 @@ module Utility.JSONStream ( import Text.JSON {- Text.JSON does not support building up a larger JSON document piece by - piece as a stream. To support streaming, a hack. The JSObject is converted - to a string with its final "}" is left off, allowing it to be added to - later. -} + - piece as a stream. To support streaming, a hack. The JSObject is converted + - to a string with its final "}" is left off, allowing it to be added to + - later. -} start :: JSON a => [(String, a)] -> String start l | last s == endchar = init s diff --git a/Utility/TempFile.hs b/Utility/TempFile.hs index 688baa491..6dbea693a 100644 --- a/Utility/TempFile.hs +++ b/Utility/TempFile.hs @@ -22,7 +22,7 @@ import System.FilePath viaTmp :: (FilePath -> String -> IO ()) -> FilePath -> String -> IO () viaTmp a file content = do pid <- getProcessID - let tmpfile = file ++ ".tmp" ++ show pid + let tmpfile = file ++ ".tmp" ++ show pid createDirectoryIfMissing True (parentDir file) a tmpfile content renameFile tmpfile file |