use warnings;
no warnings 'redefine';
use strict;
-use IkiWiki 2.00;
+use IkiWiki 3.00;
use IkiWiki::Render;
use Net::Amazon::S3;
}
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");
}
# 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.
}
# This is a wrapper around the real prune.
-sub prune ($) {
+sub prune ($;$) {
my $file=shift;
+ my $up_to=shift;
my @keys=IkiWiki::Plugin::amazon_s3::file2keys($file);
}
}
- return $IkiWiki::Plugin::amazon_s3::subs{'IkiWiki::prune'}->($file);
+ return $IkiWiki::Plugin::amazon_s3::subs{'IkiWiki::prune'}->($file, $up_to);
}
1