summaryrefslogtreecommitdiff
path: root/src/Propellor
diff options
context:
space:
mode:
authorJoey Hess2016-12-26 12:08:02 -0400
committerJoey Hess2016-12-26 12:09:38 -0400
commit5605c9665e57b22c7415691984f31f75b3337cd9 (patch)
tree8f5790d1bb4dab6220e21449caf6ed1d5f802405 /src/Propellor
parent1d868470e4ec6ec6211206003279ac4bc8465c4f (diff)
parent44bf67b7a2da75ef80e32d6409cc41a6ab8b6ffe (diff)
Merge branch 'joeyconfig'
Diffstat (limited to 'src/Propellor')
-rw-r--r--src/Propellor/CmdLine.hs2
-rw-r--r--src/Propellor/Gpg.hs7
-rw-r--r--src/Propellor/PrivData.hs4
-rw-r--r--src/Propellor/Property.hs2
-rw-r--r--src/Propellor/Property/Debootstrap.hs2
-rw-r--r--src/Propellor/Property/Gpg.hs2
-rw-r--r--src/Propellor/Shim.hs2
7 files changed, 7 insertions, 14 deletions
diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs
index 7840cc33..f26e0834 100644
--- a/src/Propellor/CmdLine.hs
+++ b/src/Propellor/CmdLine.hs
@@ -19,6 +19,7 @@ import Propellor.Types.CmdLine
import qualified Propellor.Property.Docker as Docker
import qualified Propellor.Property.Chroot as Chroot
import qualified Propellor.Shim as Shim
+import Utility.FileSystemEncoding
usage :: Handle -> IO ()
usage h = hPutStrLn h $ unlines
@@ -95,6 +96,7 @@ data CanRebuild = CanRebuild | NoRebuild
-- | Runs propellor on hosts, as controlled by command-line options.
defaultMain :: [Host] -> IO ()
defaultMain hostlist = withConcurrentOutput $ do
+ useFileSystemEncoding
Shim.cleanEnv
checkDebugMode
cmdline <- processCmdLine
diff --git a/src/Propellor/Gpg.hs b/src/Propellor/Gpg.hs
index fd2fca79..6ac153cc 100644
--- a/src/Propellor/Gpg.hs
+++ b/src/Propellor/Gpg.hs
@@ -16,7 +16,6 @@ import Utility.Process.NonConcurrent
import Utility.Monad
import Utility.Misc
import Utility.Tmp
-import Utility.FileSystemEncoding
import Utility.Env
import Utility.Directory
@@ -183,7 +182,7 @@ gpgDecrypt :: FilePath -> IO String
gpgDecrypt f = do
gpgbin <- getGpgBin
ifM (doesFileExist f)
- ( writeReadProcessEnv gpgbin ["--decrypt", f] Nothing Nothing (Just fileEncoding)
+ ( writeReadProcessEnv gpgbin ["--decrypt", f] Nothing Nothing Nothing
, return ""
)
@@ -201,6 +200,4 @@ gpgEncrypt f s = do
encrypted <- writeReadProcessEnv gpgbin opts Nothing (Just writer) Nothing
viaTmp writeFile f encrypted
where
- writer h = do
- fileEncoding h
- hPutStr h s
+ writer h = hPutStr h s
diff --git a/src/Propellor/PrivData.hs b/src/Propellor/PrivData.hs
index 2e9cdbab..8ca51e23 100644
--- a/src/Propellor/PrivData.hs
+++ b/src/Propellor/PrivData.hs
@@ -57,7 +57,6 @@ import Utility.Misc
import Utility.FileMode
import Utility.Env
import Utility.Table
-import Utility.FileSystemEncoding
import Utility.Directory
-- | Allows a Property to access the value of a specific PrivDataField,
@@ -171,7 +170,6 @@ getPrivData field context m = do
setPrivData :: PrivDataField -> Context -> IO ()
setPrivData field context = do
putStrLn "Enter private data on stdin; ctrl-D when done:"
- fileEncoding stdin
setPrivDataTo field context . PrivData =<< hGetContentsStrict stdin
unsetPrivData :: PrivDataField -> Context -> IO ()
@@ -274,7 +272,7 @@ readPrivData :: String -> PrivMap
readPrivData = fromMaybe M.empty . readish
readPrivDataFile :: FilePath -> IO PrivMap
-readPrivDataFile f = readPrivData <$> readFileStrictAnyEncoding f
+readPrivDataFile f = readPrivData <$> readFileStrict f
makePrivDataDir :: IO ()
makePrivDataDir = createDirectoryIfMissing False privDataDir
diff --git a/src/Propellor/Property.hs b/src/Propellor/Property.hs
index ae4fc914..8f51035b 100644
--- a/src/Propellor/Property.hs
+++ b/src/Propellor/Property.hs
@@ -222,7 +222,7 @@ changesFile p f = checkResult getstat comparestat p
changesFileContent :: Checkable p i => p i -> FilePath -> Property i
changesFileContent p f = checkResult getmd5 comparemd5 p
where
- getmd5 = catchMaybeIO $ MD5.md5 . MD5.Str <$> readFileStrictAnyEncoding f
+ getmd5 = catchMaybeIO $ MD5.md5 . MD5.Str <$> readFileStrict f
comparemd5 oldmd5 = do
newmd5 <- getmd5
return $ if oldmd5 == newmd5 then NoChange else MadeChange
diff --git a/src/Propellor/Property/Debootstrap.hs b/src/Propellor/Property/Debootstrap.hs
index f8cb6e0e..db114e01 100644
--- a/src/Propellor/Property/Debootstrap.hs
+++ b/src/Propellor/Property/Debootstrap.hs
@@ -148,7 +148,7 @@ sourceInstall' = withTmpDir "debootstrap" $ \tmpd -> do
. filter ("debootstrap_" `isInfixOf`)
. filter (".tar." `isInfixOf`)
. extractUrls baseurl <$>
- readFileStrictAnyEncoding indexfile
+ readFileStrict indexfile
nukeFile indexfile
tarfile <- case urls of
diff --git a/src/Propellor/Property/Gpg.hs b/src/Propellor/Property/Gpg.hs
index 74e9df5a..27baa4ba 100644
--- a/src/Propellor/Property/Gpg.hs
+++ b/src/Propellor/Property/Gpg.hs
@@ -2,7 +2,6 @@ module Propellor.Property.Gpg where
import Propellor.Base
import qualified Propellor.Property.Apt as Apt
-import Utility.FileSystemEncoding
import System.PosixCompat
@@ -35,7 +34,6 @@ keyImported key@(GpgKeyId keyid) user@(User u) = prop
( return NoChange
, makeChange $ withHandle StdinHandle createProcessSuccess
(proc "su" ["-c", "gpg --import", u]) $ \h -> do
- fileEncoding h
hPutStr h (unlines keylines)
hClose h
)
diff --git a/src/Propellor/Shim.hs b/src/Propellor/Shim.hs
index 27545afb..811ae7f0 100644
--- a/src/Propellor/Shim.hs
+++ b/src/Propellor/Shim.hs
@@ -9,7 +9,6 @@ module Propellor.Shim (setup, cleanEnv, file) where
import Propellor.Base
import Utility.LinuxMkLibs
import Utility.FileMode
-import Utility.FileSystemEncoding
import Data.List
import System.Posix.Files
@@ -57,7 +56,6 @@ shebang = "#!/bin/sh"
checkAlreadyShimmed :: FilePath -> IO FilePath -> IO FilePath
checkAlreadyShimmed f nope = ifM (doesFileExist f)
( withFile f ReadMode $ \h -> do
- fileEncoding h
s <- hGetLine h
if s == shebang
then return f