summaryrefslogtreecommitdiffhomepage
path: root/Storage.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-08-31 14:30:35 -0400
committerJoey Hess <joeyh@joeyh.name>2016-08-31 14:33:22 -0400
commit019c080687ce4a07031bdfe2263397f4f868c3c3 (patch)
tree187c7abb67ce1c0bc126a48501de4e7ed3e1f7e0 /Storage.hs
parent176dbd5798a7def03ea6c61713a0c216ab1e1674 (diff)
downloadkeysafe-019c080687ce4a07031bdfe2263397f4f868c3c3.tar.gz
added --store-directory
Diffstat (limited to 'Storage.hs')
-rw-r--r--Storage.hs18
1 files changed, 9 insertions, 9 deletions
diff --git a/Storage.hs b/Storage.hs
index c9446c5..43e16cd 100644
--- a/Storage.hs
+++ b/Storage.hs
@@ -16,15 +16,15 @@ import System.FilePath
import Control.Monad
import qualified Data.Set as S
-allStorageLocations :: IO StorageLocations
-allStorageLocations = do
+allStorageLocations :: Maybe LocalStorageDirectory -> IO StorageLocations
+allStorageLocations d = do
servers <- networkServers
return $ StorageLocations $
- map networkStorage servers <> map uploadQueue servers
+ map networkStorage servers <> map (uploadQueue d) servers
-localStorageLocations :: StorageLocations
-localStorageLocations = StorageLocations $
- map (localStorage userStorageDir . ("local" </>) . show)
+localStorageLocations :: Maybe LocalStorageDirectory -> StorageLocations
+localStorageLocations d = StorageLocations $
+ map (localStorage (storageDir d) . ("local" </>) . show)
[1..100 :: Int]
type UpdateProgress = IO ()
@@ -99,7 +99,7 @@ retrieveShares (StorageLocations locs) sis updateprogress = do
-- all of them.
go (unusedlocs++[loc]) usedlocs' rest shares'
-uploadQueued :: IO ()
-uploadQueued = do
+uploadQueued :: Maybe LocalStorageDirectory -> IO ()
+uploadQueued d = do
servers <- networkServers
- forM_ servers $ \s -> moveShares (uploadQueue s) (networkStorage s)
+ forM_ servers $ \s -> moveShares (uploadQueue d s) (networkStorage s)