* git-remote-annex: Fix a reversion introduced in version 10.20241031
that broke cloning from a special remote.
* vpop: Only update state after successful checkout.
+ * S3: Support versioning=yes with a readonly bucket.
+ (Needs aws-0.24.3)
-- Joey Hess <id@joeyh.name> Mon, 11 Nov 2024 12:26:00 -0400
where
enableversioning b = do
#if MIN_VERSION_aws(0,21,1)
- showAction "enabling bucket versioning"
+ showAction "checking bucket versioning"
hdl <- mkS3HandleVar c gc u
+ let setversioning = S3.putBucketVersioning b S3.VersioningEnabled
withS3HandleOrFail u hdl $ \h ->
- void $ liftIO $ runResourceT $ sendS3Handle h $
- S3.putBucketVersioning b S3.VersioningEnabled
+#if MIN_VERSION_aws(0,24,3)
+ liftIO $ runResourceT $
+ tryS3 (sendS3Handle h setversioning) >>= \case
+ Right _ -> return ()
+ Left err -> do
+ res <- sendS3Handle h $
+ S3.getBucketVersioning b
+ case S3.gbvVersioning res of
+ Just S3.VersioningEnabled -> return ()
+ _ -> giveup $ "This bucket does not have versioning enabled, and enabling it failed: "
+ ++ T.unpack (S3.s3ErrorMessage err)
+#else
+ void $ liftIO $ runResourceT $ sendS3Handle h go
+#endif
#else
showLongNote $ unlines
[ "This version of git-annex cannot auto-enable S3 bucket versioning."