diff options
author | Joey Hess <joey@kitenet.net> | 2011-10-03 22:24:57 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-10-03 23:29:48 -0400 |
commit | 8ef2095fa00408ce6729596a42bc0abdc7778098 (patch) | |
tree | d6fc3c9f9519ba2ce617a804ce1c5f33f59a9109 /Remote/S3real.hs | |
parent | 003a604a6e48a8a0ffd1564e3399b54e8c673e92 (diff) |
factor out common imports
no code changes
Diffstat (limited to 'Remote/S3real.hs')
-rw-r--r-- | Remote/S3real.hs | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/Remote/S3real.hs b/Remote/S3real.hs index cafa4f15a..b2ea4b0c8 100644 --- a/Remote/S3real.hs +++ b/Remote/S3real.hs @@ -7,31 +7,21 @@ module Remote.S3 (remote) where -import Control.Exception.Extensible (IOException) import Network.AWS.AWSConnection import Network.AWS.S3Object import Network.AWS.S3Bucket hiding (size) import Network.AWS.AWSResult import qualified Data.ByteString.Lazy.Char8 as L import qualified Data.Map as M -import Data.Maybe -import Data.List import Data.Char -import Data.String.Utils -import Control.Monad (when) -import Control.Monad.State (liftIO) import System.Environment -import System.Posix.Files import System.Posix.Env (setEnv) -import Types +import AnnexCommon import Types.Remote import Types.Key import qualified Git -import qualified Annex import UUID -import Messages -import Locations import Config import Remote.Helper.Special import Remote.Helper.Encryptable @@ -123,7 +113,7 @@ s3Setup u c = handlehost $ M.lookup "host" c store :: Remote Annex -> Key -> Annex Bool store r k = s3Action r False $ \(conn, bucket) -> do - g <- Annex.gitRepo + g <- gitRepo res <- liftIO $ storeHelper (conn, bucket) r k $ gitAnnexLocation g k s3Bool res @@ -132,7 +122,7 @@ storeEncrypted r (cipher, enck) k = s3Action r False $ \(conn, bucket) -> -- To get file size of the encrypted content, have to use a temp file. -- (An alternative would be chunking to to a constant size.) withTmp enck $ \tmp -> do - g <- Annex.gitRepo + g <- gitRepo let f = gitAnnexLocation g k liftIO $ withEncryptedContent cipher (L.readFile f) $ \s -> L.writeFile tmp s res <- liftIO $ storeHelper (conn, bucket) r enck tmp |