From 9dc7a10448f33a48ff7f3ef8fc6e3d3e03cf6eac Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 19 Apr 2019 14:27:59 -0400 Subject: [PATCH] Drop support for building with aws older than 0.14. debian stable has 0.14 so lose the complexity for old versions --- Assistant/WebApp/Configurators/AWS.hs | 2 -- BuildFlags.hs | 6 ------ CHANGELOG | 1 + Remote/S3.hs | 30 +-------------------------- git-annex.cabal | 2 +- 5 files changed, 3 insertions(+), 38 deletions(-) diff --git a/Assistant/WebApp/Configurators/AWS.hs b/Assistant/WebApp/Configurators/AWS.hs index 981477e114..e4d2826adf 100644 --- a/Assistant/WebApp/Configurators/AWS.hs +++ b/Assistant/WebApp/Configurators/AWS.hs @@ -77,9 +77,7 @@ s3InputAForm defcreds = AWSInput storageclasses = [ ("Standard redundancy", StandardRedundancy) #ifdef WITH_S3 -#if MIN_VERSION_aws(0,13,0) , ("Infrequent access (cheaper for backups and archives)", StandardInfrequentAccess) -#endif #endif , ("Reduced redundancy (costs less)", ReducedRedundancy) ] diff --git a/BuildFlags.hs b/BuildFlags.hs index 74ac576b6f..38287c1ab0 100644 --- a/BuildFlags.hs +++ b/BuildFlags.hs @@ -33,12 +33,6 @@ buildFlags = filter (not . null) #endif #ifdef WITH_S3 , "S3" -#if MIN_VERSION_aws(0,10,6) - ++ "(multipartupload)" -#endif -#if MIN_VERSION_aws(0,13,0) - ++ "(storageclasses)" -#endif #else #warning Building without S3. #endif diff --git a/CHANGELOG b/CHANGELOG index e791d57906..df789933e5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -14,6 +14,7 @@ git-annex (7.20190323) UNRELEASED; urgency=medium * renameremote: New command, changes the name that is used to enable a special remote. Especially useful when you want to reuse the name of an old remote for something new. + * Drop support for building with aws older than 0.14. -- Joey Hess Tue, 09 Apr 2019 14:07:53 -0400 diff --git a/Remote/S3.hs b/Remote/S3.hs index e5d81f45eb..54dc0272ca 100644 --- a/Remote/S3.hs +++ b/Remote/S3.hs @@ -344,34 +344,14 @@ checkKey hv r c info k = withS3Handle hv $ \case checkKeyHelper :: S3Info -> S3Handle -> (Either S3.Object S3VersionID) -> Annex Bool checkKeyHelper info h loc = liftIO $ runResourceT $ do -#if MIN_VERSION_aws(0,10,0) - rsp <- go + rsp <- sendS3Handle h req return (isJust $ S3.horMetadata rsp) -#else - catchMissingException $ do - void go - return True -#endif where - go = sendS3Handle h req req = case loc of Left o -> S3.headObject (bucket info) o Right (S3VersionID o vid) -> (S3.headObject (bucket info) o) { S3.hoVersionId = Just vid } -#if ! MIN_VERSION_aws(0,10,0) - {- Catch exception headObject returns when an object is not present - - in the bucket, and returns False. All other exceptions indicate a - - check error and are let through. -} - catchMissingException :: Annex Bool -> Annex Bool - catchMissingException a = catchJust missing a (const $ return False) - where - missing :: AWS.HeaderException -> Maybe () - missing e - | AWS.headerErrorMessage e == "ETag missing" = Just () - | otherwise = Nothing -#endif - storeExportS3 :: S3HandleVar -> Remote -> S3Info -> Maybe Magic -> FilePath -> Key -> ExportLocation -> MeterUpdate -> Annex Bool storeExportS3 hv r info magic f k loc p = fst <$> storeExportS3' hv r info magic f k loc p @@ -614,21 +594,17 @@ genBucket c gc u = do (S3.putBucket (bucket info)) { S3.pbCannedAcl = acl info , S3.pbLocationConstraint = locconstraint -#if MIN_VERSION_aws(0,13,0) , S3.pbXStorageClass = storageclass -#endif } writeUUIDFile c u info h locconstraint = mkLocationConstraint $ T.pack datacenter datacenter = fromJust $ M.lookup "datacenter" c -#if MIN_VERSION_aws(0,13,0) -- "NEARLINE" as a storage class when creating a bucket is a -- nonstandard extension of Google Cloud Storage. storageclass = case getStorageClass c of sc@(S3.OtherStorageClass "NEARLINE") -> Just sc _ -> Nothing -#endif {- Writes the UUID to an annex-uuid file within the bucket. - @@ -830,9 +806,7 @@ getBucketName = map toLower <$$> M.lookup "bucket" getStorageClass :: RemoteConfig -> S3.StorageClass getStorageClass c = case M.lookup "storageclass" c of Just "REDUCED_REDUNDANCY" -> S3.ReducedRedundancy -#if MIN_VERSION_aws(0,13,0) Just s -> S3.OtherStorageClass (T.pack s) -#endif _ -> S3.Standard getPartSize :: RemoteConfig -> Maybe Integer @@ -946,9 +920,7 @@ s3Info c info = catMaybes ] where s3c = s3Configuration c -#if MIN_VERSION_aws(0,13,0) showstorageclass (S3.OtherStorageClass t) = T.unpack t -#endif showstorageclass sc = show sc getPublicWebUrls :: UUID -> S3Info -> RemoteConfig -> Key -> Annex [URLString] diff --git a/git-annex.cabal b/git-annex.cabal index d49640ae87..b2d28bba88 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -402,7 +402,7 @@ Executable git-annex Build-Depends: network (< 3.0.0.0), network (>= 2.6.3.0) if flag(S3) - Build-Depends: aws (>= 0.9.2) + Build-Depends: aws (>= 0.14) CPP-Options: -DWITH_S3 Other-Modules: Remote.S3