diff options
author | joe <joe@jerkface.net> | 2014-04-11 21:44:22 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2014-04-11 21:44:22 -0400 |
commit | a6064eab0e9524ff9221d2079b7e425b3f9a70ba (patch) | |
tree | ac113e933af2086b45128cd20a261fda23c48e44 | |
parent | b3d3372abf46ee1ec308c77201c00ab6d8bfeff2 (diff) |
moved getHomeDir to cross_merge
-rw-r--r-- | kiki.hs | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -1305,7 +1305,10 @@ writeOutKeyrings lkmap db = do | |||
1305 | -- warn $ "writing "++f | 1305 | -- warn $ "writing "++f |
1306 | L.writeFile f (encode m) | 1306 | L.writeFile f (encode m) |
1307 | 1307 | ||
1308 | cross_merge doDecrypt grip0 keyrings wallets f = do | 1308 | cross_merge doDecrypt homespec keyrings_ wallets f = do |
1309 | (homedir,secring,pubring,grip0) <- getHomeDir homespec | ||
1310 | let keyrings = secring:pubring:keyrings_ | ||
1311 | |||
1309 | let relock = do | 1312 | let relock = do |
1310 | (fsns,failed_locks) <- lockFiles keyrings | 1313 | (fsns,failed_locks) <- lockFiles keyrings |
1311 | (wsns,failed_wlocks) <- lockFiles wallets | 1314 | (wsns,failed_wlocks) <- lockFiles wallets |
@@ -1375,7 +1378,7 @@ cross_merge doDecrypt grip0 keyrings wallets f = do | |||
1375 | 1378 | ||
1376 | -- unlockFiles fsns ----------- Originally, I did this to enable altering the gpg keyrings | 1379 | -- unlockFiles fsns ----------- Originally, I did this to enable altering the gpg keyrings |
1377 | ------------------------------- from external tools. | 1380 | ------------------------------- from external tools. |
1378 | (db',_) <- f (sec_n,grip) db | 1381 | (db',_) <- f (sec_n,grip) db pubring |
1379 | -- lk <- relock --------------- The design is not quite safe, so it is disabled for now. | 1382 | -- lk <- relock --------------- The design is not quite safe, so it is disabled for now. |
1380 | let lk = (fsns,failed_locks) -- | 1383 | let lk = (fsns,failed_locks) -- |
1381 | ------------------------------- | 1384 | ------------------------------- |
@@ -2407,17 +2410,13 @@ main = do | |||
2407 | let keypairs = catMaybes keypairs0 | 2410 | let keypairs = catMaybes keypairs0 |
2408 | btcpairs = catMaybes btcpairs0 | 2411 | btcpairs = catMaybes btcpairs0 |
2409 | 2412 | ||
2410 | (homedir,secring,pubring,grip0) <- getHomeDir ( join . take 1 <$> Map.lookup "--homedir" margs) | ||
2411 | |||
2412 | let keyrings = secring:pubring:keyrings_ | ||
2413 | |||
2414 | {- | 2413 | {- |
2415 | putStrLn $ "keypairs = "++show keypairs | 2414 | putStrLn $ "keypairs = "++show keypairs |
2416 | putStrLn $ "publics = "++show publics | 2415 | putStrLn $ "publics = "++show publics |
2417 | putStrLn $ "keyrings = "++show keyrings | 2416 | putStrLn $ "keyrings = "++show keyrings |
2418 | -} | 2417 | -} |
2419 | 2418 | ||
2420 | cross_merge decrypt grip0 keyrings wallets $ \(secfile,grip) db -> do | 2419 | cross_merge decrypt ( join . take 1 <$> Map.lookup "--homedir" margs) keyrings_ wallets $ \(secfile,grip) db pubring -> do |
2421 | 2420 | ||
2422 | use_db0 <- return db | 2421 | use_db0 <- return db |
2423 | 2422 | ||