summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2019-07-01 10:31:30 -0400
committerJoe Crayne <joe@jerkface.net>2019-07-01 10:31:30 -0400
commit2ffa63e3d6160c63df72fea11a91fc055d7120e8 (patch)
tree6f01194a21be1bb1e0ef0e1a059fa4718ad23f71
parent0727326d606771790f05bcc5eada9086e7784339 (diff)
Avoid redundant names call.
-rw-r--r--lib/Kiki.hs8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Kiki.hs b/lib/Kiki.hs
index e8ea5f5..64e2d7d 100644
--- a/lib/Kiki.hs
+++ b/lib/Kiki.hs
@@ -464,13 +464,11 @@ refreshCache :: KeyRingRuntime -> Maybe FilePath -> IO ()
464refreshCache rt rootdir = do 464refreshCache rt rootdir = do
465 (mkpath, commit) <- getMkPathAndCommit (fromMaybe "" rootdir ++ "/var/cache/kiki/config") 465 (mkpath, commit) <- getMkPathAndCommit (fromMaybe "" rootdir ++ "/var/cache/kiki/config")
466 generateHostsFile mkpath rt 466 generateHostsFile mkpath rt
467 let bUnprivileged = False -- TODO
468 oname = Char8.concat $ do
469 (_,(os,_)) <- maybeToList (names rt)
470 take 1 os
471 fromMaybe (error "No working key.") $ do 467 fromMaybe (error "No working key.") $ do
472 (wkaddr,_) <- names rt 468 (wkaddr,(onames,_)) <- names rt
473 Just $ do 469 Just $ do
470 let oname = Char8.concat $ take 1 onames
471 bUnprivileged = False -- TODO
474 if (oname == "") && (not bUnprivileged) then error "Missing tor key" else do 472 if (oname == "") && (not bUnprivileged) then error "Missing tor key" else do
475 -- sshcpathpub0 = fromMaybe "" rootdir ++ osHomeDir </> ".ssh" </> "id_rsa.pub" 473 -- sshcpathpub0 = fromMaybe "" rootdir ++ osHomeDir </> ".ssh" </> "id_rsa.pub"
476 -- sshspathpub0 = fromMaybe "" rootdir ++ "/etc/ssh/ssh_host_rsa_key.pub" 474 -- sshspathpub0 = fromMaybe "" rootdir ++ "/etc/ssh/ssh_host_rsa_key.pub"