|
|
@@ -46,10 +46,10 @@ class S3(Publisher): |
|
|
|
redirect_meta = redirect['to'] |
|
|
|
k.key = item.path.replace(str(root), '') |
|
|
|
kmd5 = bucket.get_key(item.path.replace(str(root), '')) |
|
|
|
#print 'f:', `item.path`, `kmd5.etag[1:-1], k.compute_md5(open(item.path))[0]` |
|
|
|
#print('f:', repr(item.path), repr(kmd5.etag[1:-1], k.compute_md5(open(item.path))[0])) |
|
|
|
if kmd5 is None or \ |
|
|
|
kmd5.etag[1:-1] != k.compute_md5(open(item.path))[0]: |
|
|
|
print 'updating:', `item.path.replace(str(root), '')` |
|
|
|
kmd5.etag[1:-1] != k.compute_md5(open(item.path, 'rb'))[0]: |
|
|
|
print('updating:', repr(item.path.replace(str(root), ''))) |
|
|
|
k.set_contents_from_filename(item.path) |
|
|
|
if redirect_meta: |
|
|
|
k.set_metadata('website-redirect-location', redirect_meta) |