diff options
| author | Joey Hess <joey@kitenet.net> | 2014-05-10 11:13:47 -0300 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-05-10 11:13:47 -0300 |
| commit | eb6e6fe11290971b37a18d9a78f6d9b78228c06f (patch) | |
| tree | 5c7669b6ce12a8e7c95e918e69548de31eb4fba7 /Utility | |
| parent | 6088df9105a10ef446cc236982c2e30857182a84 (diff) | |
| parent | d7ad05acaaf05c7af066c1d41f3e70e61a9bec96 (diff) | |
Merge branch 'joeyconfig'
Diffstat (limited to 'Utility')
| -rw-r--r-- | Utility/Applicative.hs | 2 | ||||
| -rw-r--r-- | Utility/Data.hs | 2 | ||||
| -rw-r--r-- | Utility/Directory.hs | 4 | ||||
| -rw-r--r-- | Utility/Env.hs | 2 | ||||
| -rw-r--r-- | Utility/Exception.hs | 4 | ||||
| -rw-r--r-- | Utility/FileMode.hs | 3 | ||||
| -rw-r--r-- | Utility/FileSystemEncoding.hs | 2 | ||||
| -rw-r--r-- | Utility/LinuxMkLibs.hs | 4 | ||||
| -rw-r--r-- | Utility/Misc.hs | 2 | ||||
| -rw-r--r-- | Utility/Monad.hs | 2 | ||||
| -rw-r--r-- | Utility/Path.hs | 2 | ||||
| -rw-r--r-- | Utility/PosixFiles.hs | 2 | ||||
| -rw-r--r-- | Utility/Process.hs | 6 | ||||
| -rw-r--r-- | Utility/QuickCheck.hs | 2 | ||||
| -rw-r--r-- | Utility/SafeCommand.hs | 2 | ||||
| -rw-r--r-- | Utility/Scheduled.hs | 2 | ||||
| -rw-r--r-- | Utility/ThreadScheduler.hs | 6 | ||||
| -rw-r--r-- | Utility/Tmp.hs | 2 | ||||
| -rw-r--r-- | Utility/UserInfo.hs | 2 |
19 files changed, 30 insertions, 23 deletions
diff --git a/Utility/Applicative.hs b/Utility/Applicative.hs index 64400c80..fd8944b2 100644 --- a/Utility/Applicative.hs +++ b/Utility/Applicative.hs @@ -2,7 +2,7 @@ - - Copyright 2012 Joey Hess <joey@kitenet.net> - - - Licensed under the GNU GPL version 3 or higher. + - License: BSD-2-clause -} module Utility.Applicative where diff --git a/Utility/Data.hs b/Utility/Data.hs index 35925829..2df12b36 100644 --- a/Utility/Data.hs +++ b/Utility/Data.hs @@ -2,7 +2,7 @@ - - Copyright 2013 Joey Hess <joey@kitenet.net> - - - Licensed under the GNU GPL version 3 or higher. + - License: BSD-2-clause -} module Utility.Data where diff --git a/Utility/Directory.hs b/Utility/Directory.hs index f1bcfada..d92327c0 100644 --- a/Utility/Directory.hs +++ b/Utility/Directory.hs @@ -2,7 +2,7 @@ - - Copyright 2011-2014 Joey Hess <joey@kitenet.net> - - - Licensed under the GNU GPL version 3 or higher. + - License: BSD-2-clause -} {-# LANGUAGE CPP #-} @@ -43,7 +43,7 @@ dirContents d = map (d </>) . filter (not . dirCruft) <$> getDirectoryContents d - When the directory does not exist, no exception is thrown, - instead, [] is returned. -} dirContentsRecursive :: FilePath -> IO [FilePath] -dirContentsRecursive topdir = dirContentsRecursiveSkipping (const False) True topdir +dirContentsRecursive = dirContentsRecursiveSkipping (const False) True {- Skips directories whose basenames match the skipdir. -} dirContentsRecursiveSkipping :: (FilePath -> Bool) -> Bool -> FilePath -> IO [FilePath] diff --git a/Utility/Env.hs b/Utility/Env.hs index 90ed58f6..6763c24e 100644 --- a/Utility/Env.hs +++ b/Utility/Env.hs @@ -2,7 +2,7 @@ - - Copyright 2013 Joey Hess <joey@kitenet.net> - - - Licensed under the GNU GPL version 3 or higher. + - License: BSD-2-clause -} {-# LANGUAGE CPP #-} diff --git a/Utility/Exception.hs b/Utility/Exception.hs index cf2c615c..1fecf65d 100644 --- a/Utility/Exception.hs +++ b/Utility/Exception.hs @@ -2,7 +2,7 @@ - - Copyright 2011-2012 Joey Hess <joey@kitenet.net> - - - Licensed under the GNU GPL version 3 or higher. + - License: BSD-2-clause -} {-# LANGUAGE ScopedTypeVariables #-} @@ -18,7 +18,7 @@ import Utility.Data {- Catches IO errors and returns a Bool -} catchBoolIO :: IO Bool -> IO Bool -catchBoolIO a = catchDefaultIO False a +catchBoolIO = catchDefaultIO False {- Catches IO errors and returns a Maybe -} catchMaybeIO :: IO a -> IO (Maybe a) diff --git a/Utility/FileMode.hs b/Utility/FileMode.hs index 4302f8bd..c2ef683a 100644 --- a/Utility/FileMode.hs +++ b/Utility/FileMode.hs @@ -2,7 +2,7 @@ - - Copyright 2010-2012 Joey Hess <joey@kitenet.net> - - - Licensed under the GNU GPL version 3 or higher. + - License: BSD-2-clause -} {-# LANGUAGE CPP #-} @@ -13,6 +13,7 @@ import System.IO import Control.Monad import Control.Exception (bracket) import System.PosixCompat.Types +import Utility.PosixFiles #ifndef mingw32_HOST_OS import System.Posix.Files #endif diff --git a/Utility/FileSystemEncoding.hs b/Utility/FileSystemEncoding.hs index 690942cb..b81fdc53 100644 --- a/Utility/FileSystemEncoding.hs +++ b/Utility/FileSystemEncoding.hs @@ -2,7 +2,7 @@ - - Copyright 2012-2014 Joey Hess <joey@kitenet.net> - - - Licensed under the GNU GPL version 3 or higher. + - License: BSD-2-clause -} {-# LANGUAGE CPP #-} diff --git a/Utility/LinuxMkLibs.hs b/Utility/LinuxMkLibs.hs index 76e6266d..1dc4e1ea 100644 --- a/Utility/LinuxMkLibs.hs +++ b/Utility/LinuxMkLibs.hs @@ -2,7 +2,7 @@ - - Copyright 2013 Joey Hess <joey@kitenet.net> - - - Licensed under the GNU GPL version 3 or higher. + - License: BSD-2-clause -} module Utility.LinuxMkLibs where @@ -49,7 +49,7 @@ inTop top f = top ++ f - link to. Note that some of the libraries may not exist - (eg, linux-vdso.so) -} parseLdd :: String -> [FilePath] -parseLdd = catMaybes . map (getlib . dropWhile isSpace) . lines +parseLdd = mapMaybe (getlib . dropWhile isSpace) . lines where getlib l = headMaybe . words =<< lastMaybe (split " => " l) diff --git a/Utility/Misc.hs b/Utility/Misc.hs index 9c19df83..949f41e7 100644 --- a/Utility/Misc.hs +++ b/Utility/Misc.hs @@ -2,7 +2,7 @@ - - Copyright 2010-2011 Joey Hess <joey@kitenet.net> - - - Licensed under the GNU GPL version 3 or higher. + - License: BSD-2-clause -} {-# LANGUAGE CPP #-} diff --git a/Utility/Monad.hs b/Utility/Monad.hs index 1ba43c5f..eba3c428 100644 --- a/Utility/Monad.hs +++ b/Utility/Monad.hs @@ -2,7 +2,7 @@ - - Copyright 2010-2012 Joey Hess <joey@kitenet.net> - - - Licensed under the GNU GPL version 3 or higher. + - License: BSD-2-clause -} module Utility.Monad where diff --git a/Utility/Path.hs b/Utility/Path.hs index 570350d6..99c9438b 100644 --- a/Utility/Path.hs +++ b/Utility/Path.hs @@ -2,7 +2,7 @@ - - Copyright 2010-2014 Joey Hess <joey@kitenet.net> - - - Licensed under the GNU GPL version 3 or higher. + - License: BSD-2-clause -} {-# LANGUAGE PackageImports, CPP #-} diff --git a/Utility/PosixFiles.hs b/Utility/PosixFiles.hs index 23edc25c..5abbb578 100644 --- a/Utility/PosixFiles.hs +++ b/Utility/PosixFiles.hs @@ -4,7 +4,7 @@ - - Copyright 2014 Joey Hess <joey@kitenet.net> - - - Licensed under the GNU GPL version 3 or higher. + - License: BSD-2-clause -} {-# LANGUAGE CPP #-} diff --git a/Utility/Process.hs b/Utility/Process.hs index 1945e4b9..549ae570 100644 --- a/Utility/Process.hs +++ b/Utility/Process.hs @@ -3,7 +3,7 @@ - - Copyright 2012 Joey Hess <joey@kitenet.net> - - - Licensed under the GNU GPL version 3 or higher. + - License: BSD-2-clause -} {-# LANGUAGE CPP, Rank2Types #-} @@ -31,6 +31,7 @@ module Utility.Process ( stdinHandle, stdoutHandle, stderrHandle, + processHandle, devNull, ) where @@ -313,6 +314,9 @@ bothHandles :: (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) -> (Han bothHandles (Just hin, Just hout, _, _) = (hin, hout) bothHandles _ = error "expected bothHandles" +processHandle :: (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) -> ProcessHandle +processHandle (_, _, _, pid) = pid + {- Debugging trace for a CreateProcess. -} debugProcess :: CreateProcess -> IO () debugProcess p = do diff --git a/Utility/QuickCheck.hs b/Utility/QuickCheck.hs index 7f7234c7..a498ee61 100644 --- a/Utility/QuickCheck.hs +++ b/Utility/QuickCheck.hs @@ -2,7 +2,7 @@ - - Copyright 2012-2014 Joey Hess <joey@kitenet.net> - - - Licensed under the GNU GPL version 3 or higher. + - License: BSD-2-clause -} {-# OPTIONS_GHC -fno-warn-orphans #-} diff --git a/Utility/SafeCommand.hs b/Utility/SafeCommand.hs index c8318ec2..04fcf390 100644 --- a/Utility/SafeCommand.hs +++ b/Utility/SafeCommand.hs @@ -2,7 +2,7 @@ - - Copyright 2010-2013 Joey Hess <joey@kitenet.net> - - - Licensed under the GNU GPL version 3 or higher. + - License: BSD-2-clause -} module Utility.SafeCommand where diff --git a/Utility/Scheduled.hs b/Utility/Scheduled.hs index d3ae0620..305410c5 100644 --- a/Utility/Scheduled.hs +++ b/Utility/Scheduled.hs @@ -2,7 +2,7 @@ - - Copyright 2013-2014 Joey Hess <joey@kitenet.net> - - - Licensed under the GNU GPL version 3 or higher. + - License: BSD-2-clause -} module Utility.Scheduled ( diff --git a/Utility/ThreadScheduler.hs b/Utility/ThreadScheduler.hs index 9d4cfd0a..fc026d7e 100644 --- a/Utility/ThreadScheduler.hs +++ b/Utility/ThreadScheduler.hs @@ -3,7 +3,7 @@ - Copyright 2012, 2013 Joey Hess <joey@kitenet.net> - Copyright 2011 Bas van Dijk & Roel van Dijk - - - Licensed under the GNU GPL version 3 or higher. + - License: BSD-2-clause -} {-# LANGUAGE CPP #-} @@ -11,9 +11,11 @@ module Utility.ThreadScheduler where import Control.Monad +import Control.Concurrent +#ifndef mingw32_HOST_OS import Control.Monad.IfElse import System.Posix.IO -import Control.Concurrent +#endif #ifndef mingw32_HOST_OS import System.Posix.Signals #ifndef __ANDROID__ diff --git a/Utility/Tmp.hs b/Utility/Tmp.hs index f46e1a5e..0dc9f2c0 100644 --- a/Utility/Tmp.hs +++ b/Utility/Tmp.hs @@ -2,7 +2,7 @@ - - Copyright 2010-2013 Joey Hess <joey@kitenet.net> - - - Licensed under the GNU GPL version 3 or higher. + - License: BSD-2-clause -} {-# LANGUAGE CPP #-} diff --git a/Utility/UserInfo.hs b/Utility/UserInfo.hs index 9c3bfd42..617c3e94 100644 --- a/Utility/UserInfo.hs +++ b/Utility/UserInfo.hs @@ -2,7 +2,7 @@ - - Copyright 2012 Joey Hess <joey@kitenet.net> - - - Licensed under the GNU GPL version 3 or higher. + - License: BSD-2-clause -} {-# LANGUAGE CPP #-} |
