diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-08-31 14:30:35 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-08-31 14:33:22 -0400 |
commit | 019c080687ce4a07031bdfe2263397f4f868c3c3 (patch) | |
tree | 187c7abb67ce1c0bc126a48501de4e7ed3e1f7e0 /Storage.hs | |
parent | 176dbd5798a7def03ea6c61713a0c216ab1e1674 (diff) | |
download | keysafe-019c080687ce4a07031bdfe2263397f4f868c3c3.tar.gz |
added --store-directory
Diffstat (limited to 'Storage.hs')
-rw-r--r-- | Storage.hs | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -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) |