S3: Add fileprefix setting.
This commit is contained in:
parent
5fc8c2b07b
commit
ad4e152fd6
3 changed files with 17 additions and 3 deletions
|
@ -212,9 +212,11 @@ s3Action r noconn action = do
|
||||||
bucketFile :: Remote -> Key -> FilePath
|
bucketFile :: Remote -> Key -> FilePath
|
||||||
bucketFile r = munge . show
|
bucketFile r = munge . show
|
||||||
where
|
where
|
||||||
munge s = case M.lookup "mungekeys" $ fromJust $ config r of
|
munge s = case M.lookup "mungekeys" c of
|
||||||
Just "ia" -> iaMunge s
|
Just "ia" -> iaMunge $ prefix ++ s
|
||||||
_ -> s
|
_ -> prefix ++ s
|
||||||
|
prefix = M.findWithDefault "" "fileprefix" c
|
||||||
|
c = fromJust $ config r
|
||||||
|
|
||||||
bucketKey :: Remote -> String -> Key -> S3Object
|
bucketKey :: Remote -> String -> Key -> S3Object
|
||||||
bucketKey r bucket k = S3Object bucket (bucketFile r k) "" [] L.empty
|
bucketKey r bucket k = S3Object bucket (bucketFile r k) "" [] L.empty
|
||||||
|
|
6
debian/changelog
vendored
6
debian/changelog
vendored
|
@ -1,3 +1,9 @@
|
||||||
|
git-annex (3.20120808) UNRELEASED; urgency=low
|
||||||
|
|
||||||
|
* S3: Add fileprefix setting.
|
||||||
|
|
||||||
|
-- Joey Hess <joeyh@debian.org> Thu, 09 Aug 2012 13:51:47 -0400
|
||||||
|
|
||||||
git-annex (3.20120807) unstable; urgency=low
|
git-annex (3.20120807) unstable; urgency=low
|
||||||
|
|
||||||
* initremote: Avoid recording remote's description before checking
|
* initremote: Avoid recording remote's description before checking
|
||||||
|
|
|
@ -36,5 +36,11 @@ the S3 remote.
|
||||||
so by default, a bucket name is chosen based on the remote name
|
so by default, a bucket name is chosen based on the remote name
|
||||||
and UUID. This can be specified to pick a bucket name.
|
and UUID. This can be specified to pick a bucket name.
|
||||||
|
|
||||||
|
* `fileprefix` - By default, git-annex places files in a tree rooted at the
|
||||||
|
top of the S3 bucket. When this is set, it's prefixed to the filenames
|
||||||
|
used. For example, you could set it to "foo/" in one special remote,
|
||||||
|
and to "bar/" in another special remote, and both special remotes could
|
||||||
|
then use the same bucket.
|
||||||
|
|
||||||
* `x-amz-*` are passed through as http headers when storing keys
|
* `x-amz-*` are passed through as http headers when storing keys
|
||||||
in S3.
|
in S3.
|
||||||
|
|
Loading…
Reference in a new issue