X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/bb93fccf0690344aa77f9538a508959a6de09847..41af1c62fe3bf326cc31e49ef6eee8c06dffd498:/IkiWiki/Plugin/amazon_s3.pm diff --git a/IkiWiki/Plugin/amazon_s3.pm b/IkiWiki/Plugin/amazon_s3.pm index 93c10b629..cfd8cd347 100644 --- a/IkiWiki/Plugin/amazon_s3.pm +++ b/IkiWiki/Plugin/amazon_s3.pm @@ -4,7 +4,7 @@ package IkiWiki::Plugin::amazon_s3; use warnings; no warnings 'redefine'; use strict; -use IkiWiki 2.00; +use IkiWiki 3.00; use IkiWiki::Render; use Net::Amazon::S3; @@ -133,7 +133,11 @@ sub getbucket { } if (! $bucket) { - error(gettext("Failed to create bucket in S3: "). + # Try to use existing bucket. + $bucket=$s3->bucket($config{amazon_s3_bucket}); + } + if (! $bucket) { + error(gettext("Failed to create S3 bucket: "). $s3->err.": ".$s3->errstr."\n"); } @@ -178,7 +182,7 @@ sub writefile ($$$;$$) { # First, write the file to disk. my $ret=$IkiWiki::Plugin::amazon_s3::subs{'IkiWiki::writefile'}->($file, $destdir, $content, $binary, $writer); - + my @keys=IkiWiki::Plugin::amazon_s3::file2keys("$destdir/$file"); # Store the data in S3.