diff options
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 |