From 39b94e9bb752d1a5590c94d2847d421dbcea8e6f Mon Sep 17 00:00:00 2001 From: joe Date: Thu, 28 Apr 2016 00:58:14 -0400 Subject: write hosts file to cache. --- lib/Kiki.hs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib/Kiki.hs') diff --git a/lib/Kiki.hs b/lib/Kiki.hs index 9fb71be..8090aac 100644 --- a/lib/Kiki.hs +++ b/lib/Kiki.hs @@ -240,6 +240,20 @@ refreshCache rt rootdir = do return (mkpath,commit) (mkpath, commit) <- getMkPathAndCommit (fromMaybe "" rootdir ++ "/var/cache/kiki/config") + -- Generete hosts file. + let hostspath = mkpath "hosts" + op = KeyRingOperation + { opFiles = Map.fromList $ + [ ( HomePub, streaminfo { typ=KeyRingFile, spill=KF_All, access=Pub } ) + , ( ArgFile hostspath, streaminfo { typ=Hosts, spill=KF_None, fill=KF_All, access=Pub } ) + ] + , opPassphrases = [] + , opHome = Just $ takeDirectory (rtPubring rt) + , opTransforms = [] + } + KikiResult _ report <- runKeyRing op + outputReport report + let write' wr f bs = do createDirectoryIfMissing True $ takeDirectory f wr f bs -- cgit v1.2.3