Drop support for building with aws older than 0.14.
debian stable has 0.14 so lose the complexity for old versions
This commit is contained in:
parent
55a5d9679a
commit
9dc7a10448
5 changed files with 3 additions and 38 deletions
|
@ -77,9 +77,7 @@ s3InputAForm defcreds = AWSInput
|
||||||
storageclasses =
|
storageclasses =
|
||||||
[ ("Standard redundancy", StandardRedundancy)
|
[ ("Standard redundancy", StandardRedundancy)
|
||||||
#ifdef WITH_S3
|
#ifdef WITH_S3
|
||||||
#if MIN_VERSION_aws(0,13,0)
|
|
||||||
, ("Infrequent access (cheaper for backups and archives)", StandardInfrequentAccess)
|
, ("Infrequent access (cheaper for backups and archives)", StandardInfrequentAccess)
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
, ("Reduced redundancy (costs less)", ReducedRedundancy)
|
, ("Reduced redundancy (costs less)", ReducedRedundancy)
|
||||||
]
|
]
|
||||||
|
|
|
@ -33,12 +33,6 @@ buildFlags = filter (not . null)
|
||||||
#endif
|
#endif
|
||||||
#ifdef WITH_S3
|
#ifdef WITH_S3
|
||||||
, "S3"
|
, "S3"
|
||||||
#if MIN_VERSION_aws(0,10,6)
|
|
||||||
++ "(multipartupload)"
|
|
||||||
#endif
|
|
||||||
#if MIN_VERSION_aws(0,13,0)
|
|
||||||
++ "(storageclasses)"
|
|
||||||
#endif
|
|
||||||
#else
|
#else
|
||||||
#warning Building without S3.
|
#warning Building without S3.
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -14,6 +14,7 @@ git-annex (7.20190323) UNRELEASED; urgency=medium
|
||||||
* renameremote: New command, changes the name that is used to enable
|
* renameremote: New command, changes the name that is used to enable
|
||||||
a special remote. Especially useful when you want to reuse the name
|
a special remote. Especially useful when you want to reuse the name
|
||||||
of an old remote for something new.
|
of an old remote for something new.
|
||||||
|
* Drop support for building with aws older than 0.14.
|
||||||
|
|
||||||
-- Joey Hess <id@joeyh.name> Tue, 09 Apr 2019 14:07:53 -0400
|
-- Joey Hess <id@joeyh.name> Tue, 09 Apr 2019 14:07:53 -0400
|
||||||
|
|
||||||
|
|
30
Remote/S3.hs
30
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 :: S3Info -> S3Handle -> (Either S3.Object S3VersionID) -> Annex Bool
|
||||||
checkKeyHelper info h loc = liftIO $ runResourceT $ do
|
checkKeyHelper info h loc = liftIO $ runResourceT $ do
|
||||||
#if MIN_VERSION_aws(0,10,0)
|
rsp <- sendS3Handle h req
|
||||||
rsp <- go
|
|
||||||
return (isJust $ S3.horMetadata rsp)
|
return (isJust $ S3.horMetadata rsp)
|
||||||
#else
|
|
||||||
catchMissingException $ do
|
|
||||||
void go
|
|
||||||
return True
|
|
||||||
#endif
|
|
||||||
where
|
where
|
||||||
go = sendS3Handle h req
|
|
||||||
req = case loc of
|
req = case loc of
|
||||||
Left o -> S3.headObject (bucket info) o
|
Left o -> S3.headObject (bucket info) o
|
||||||
Right (S3VersionID o vid) -> (S3.headObject (bucket info) o)
|
Right (S3VersionID o vid) -> (S3.headObject (bucket info) o)
|
||||||
{ S3.hoVersionId = Just vid }
|
{ 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 :: 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 = fst
|
||||||
<$> storeExportS3' hv r info magic f k loc p
|
<$> storeExportS3' hv r info magic f k loc p
|
||||||
|
@ -614,21 +594,17 @@ genBucket c gc u = do
|
||||||
(S3.putBucket (bucket info))
|
(S3.putBucket (bucket info))
|
||||||
{ S3.pbCannedAcl = acl info
|
{ S3.pbCannedAcl = acl info
|
||||||
, S3.pbLocationConstraint = locconstraint
|
, S3.pbLocationConstraint = locconstraint
|
||||||
#if MIN_VERSION_aws(0,13,0)
|
|
||||||
, S3.pbXStorageClass = storageclass
|
, S3.pbXStorageClass = storageclass
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
writeUUIDFile c u info h
|
writeUUIDFile c u info h
|
||||||
|
|
||||||
locconstraint = mkLocationConstraint $ T.pack datacenter
|
locconstraint = mkLocationConstraint $ T.pack datacenter
|
||||||
datacenter = fromJust $ M.lookup "datacenter" c
|
datacenter = fromJust $ M.lookup "datacenter" c
|
||||||
#if MIN_VERSION_aws(0,13,0)
|
|
||||||
-- "NEARLINE" as a storage class when creating a bucket is a
|
-- "NEARLINE" as a storage class when creating a bucket is a
|
||||||
-- nonstandard extension of Google Cloud Storage.
|
-- nonstandard extension of Google Cloud Storage.
|
||||||
storageclass = case getStorageClass c of
|
storageclass = case getStorageClass c of
|
||||||
sc@(S3.OtherStorageClass "NEARLINE") -> Just sc
|
sc@(S3.OtherStorageClass "NEARLINE") -> Just sc
|
||||||
_ -> Nothing
|
_ -> Nothing
|
||||||
#endif
|
|
||||||
|
|
||||||
{- Writes the UUID to an annex-uuid file within the bucket.
|
{- 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 :: RemoteConfig -> S3.StorageClass
|
||||||
getStorageClass c = case M.lookup "storageclass" c of
|
getStorageClass c = case M.lookup "storageclass" c of
|
||||||
Just "REDUCED_REDUNDANCY" -> S3.ReducedRedundancy
|
Just "REDUCED_REDUNDANCY" -> S3.ReducedRedundancy
|
||||||
#if MIN_VERSION_aws(0,13,0)
|
|
||||||
Just s -> S3.OtherStorageClass (T.pack s)
|
Just s -> S3.OtherStorageClass (T.pack s)
|
||||||
#endif
|
|
||||||
_ -> S3.Standard
|
_ -> S3.Standard
|
||||||
|
|
||||||
getPartSize :: RemoteConfig -> Maybe Integer
|
getPartSize :: RemoteConfig -> Maybe Integer
|
||||||
|
@ -946,9 +920,7 @@ s3Info c info = catMaybes
|
||||||
]
|
]
|
||||||
where
|
where
|
||||||
s3c = s3Configuration c
|
s3c = s3Configuration c
|
||||||
#if MIN_VERSION_aws(0,13,0)
|
|
||||||
showstorageclass (S3.OtherStorageClass t) = T.unpack t
|
showstorageclass (S3.OtherStorageClass t) = T.unpack t
|
||||||
#endif
|
|
||||||
showstorageclass sc = show sc
|
showstorageclass sc = show sc
|
||||||
|
|
||||||
getPublicWebUrls :: UUID -> S3Info -> RemoteConfig -> Key -> Annex [URLString]
|
getPublicWebUrls :: UUID -> S3Info -> RemoteConfig -> Key -> Annex [URLString]
|
||||||
|
|
|
@ -402,7 +402,7 @@ Executable git-annex
|
||||||
Build-Depends: network (< 3.0.0.0), network (>= 2.6.3.0)
|
Build-Depends: network (< 3.0.0.0), network (>= 2.6.3.0)
|
||||||
|
|
||||||
if flag(S3)
|
if flag(S3)
|
||||||
Build-Depends: aws (>= 0.9.2)
|
Build-Depends: aws (>= 0.14)
|
||||||
CPP-Options: -DWITH_S3
|
CPP-Options: -DWITH_S3
|
||||||
Other-Modules: Remote.S3
|
Other-Modules: Remote.S3
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue