summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Command/Fsck.hs20
-rw-r--r--Remote/Helper/Special.hs2
-rw-r--r--Remote/S3.hs4
-rw-r--r--debian/changelog4
-rw-r--r--doc/todo/enable_fsck_--fast_for_S3_remotes.mdwn3
5 files changed, 21 insertions, 12 deletions
diff --git a/Command/Fsck.hs b/Command/Fsck.hs
index 39dba08dd..eea0ebc11 100644
--- a/Command/Fsck.hs
+++ b/Command/Fsck.hs
@@ -112,14 +112,15 @@ performRemote key file backend numcopies remote =
dispatch (Left err) = do
showNote err
return False
- dispatch (Right True) = withtmp $ \tmpfile ->
- ifM (getfile tmpfile)
- ( go True (Just tmpfile)
- , do
+ dispatch (Right True) = withtmp $ \tmpfile -> do
+ r <- getfile tmpfile
+ case r of
+ Nothing -> go True Nothing
+ Just True -> go True (Just tmpfile)
+ Just False -> do
warning "failed to download file from remote"
void $ go True Nothing
return False
- )
dispatch (Right False) = go False Nothing
go present localcopy = check
[ verifyLocationLogRemote key file remote present
@@ -137,13 +138,14 @@ performRemote key file backend numcopies remote =
cleanup `after` a tmp
getfile tmp = ifM (checkDiskSpace (Just tmp) key 0)
( ifM (Remote.retrieveKeyFileCheap remote key tmp)
- ( return True
+ ( return (Just True)
, ifM (Annex.getState Annex.fast)
- ( return False
- , Remote.retrieveKeyFile remote key Nothing tmp dummymeter
+ ( return Nothing
+ , Just <$>
+ Remote.retrieveKeyFile remote key Nothing tmp dummymeter
)
)
- , return False
+ , return (Just False)
)
dummymeter _ = noop
diff --git a/Remote/Helper/Special.hs b/Remote/Helper/Special.hs
index 696a43a7a..7dd861a4e 100644
--- a/Remote/Helper/Special.hs
+++ b/Remote/Helper/Special.hs
@@ -199,7 +199,7 @@ specialRemote' cfg c preparestorer prepareretriever prepareremover preparecheckp
readBytes $ \encb ->
storer (enck k) (ByteContent encb) p
- -- call retrieve-r to get chunks; decrypt them; stream to dest file
+ -- call retriever to get chunks; decrypt them; stream to dest file
retrieveKeyFileGen k dest p enc =
safely $ prepareretriever k $ safely . go
where
diff --git a/Remote/S3.hs b/Remote/S3.hs
index d290f9596..d8914d822 100644
--- a/Remote/S3.hs
+++ b/Remote/S3.hs
@@ -129,7 +129,7 @@ s3Setup' new u mcreds c = if configIA c then archiveorg else defaulthost
c' <- setRemoteCredPair noEncryptionUsed c (AWS.creds u) mcreds
-- Ensure user enters a valid bucket name, since
-- this determines the name of the archive.org item.
- let validbucket = replace " " "-" $ map toLower $
+ let validbucket = replace " " "-" $
fromMaybe (error "specify bucket=") $
getBucketName c'
let archiveconfig =
@@ -447,7 +447,7 @@ extractS3Info c = do
}
getBucketName :: RemoteConfig -> Maybe BucketName
-getBucketName = M.lookup "bucket"
+getBucketName = map toLower <$$> M.lookup "bucket"
getStorageClass :: RemoteConfig -> S3.StorageClass
getStorageClass c = case M.lookup "storageclass" c of
diff --git a/debian/changelog b/debian/changelog
index fa707a0af..ffca9cda3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,10 @@ git-annex (5.20150421) UNRELEASED; urgency=medium
(endpoint, port, storage class)
* S3: git annex enableremote will not create a bucket name, which
failed since the bucket already exists.
+ * Fix bogus failure of fsck --fast.
+ * S3: Fix incompatability with bucket names used by hS3; the aws library
+ cannot handle upper-case bucket names. git-annex now converts them to
+ lower case automatically.
-- Joey Hess <id@joeyh.name> Tue, 21 Apr 2015 15:54:10 -0400
diff --git a/doc/todo/enable_fsck_--fast_for_S3_remotes.mdwn b/doc/todo/enable_fsck_--fast_for_S3_remotes.mdwn
index 2d269e61c..77392b36d 100644
--- a/doc/todo/enable_fsck_--fast_for_S3_remotes.mdwn
+++ b/doc/todo/enable_fsck_--fast_for_S3_remotes.mdwn
@@ -25,3 +25,6 @@ failed
while ``git annex fsck -f S3remote`` works fine. But, to check for the presence of a file (which is my understanding of what ``--fast`` is for here), it shouldn't be necessary to download the file.
+
+> [[fixed|done]]; it was not supposed to fail at all in this case, and
+> won't anymore. --[[Joey]]