Commit 5e794279 authored by Michael Terry's avatar Michael Terry

snap: Update to duplicity 0.8.01

parent 05422eab
Pipeline #95478 passed with stage
in 24 minutes and 58 seconds
=== modified file 'duplicity/backends/_boto_multi.py'
--- duplicity/backends/_boto_multi.py 2019-06-17 15:10:58 +0000
+++ duplicity/backends/_boto_multi.py 2019-06-24 22:27:26 +0000
@@ -113,6 +113,8 @@
self._pool.join()
def upload(self, filename, key, headers=None):
+ import boto
+
chunk_size = globals.s3_multipart_chunk_size
# Check minimum chunk size for S3
=== modified file 'duplicity/backends/_boto_single.py'
--- duplicity/backends/_boto_single.py 2019-06-17 15:10:58 +0000
+++ duplicity/backends/_boto_single.py 2019-06-24 22:27:26 +0000
@@ -182,6 +182,8 @@
del self.storage_uri
def resetConnection(self):
+ import boto
+
if getattr(self, u'conn', False):
self.conn.close()
self.bucket = None
=== modified file 'duplicity/backends/giobackend.py'
--- duplicity/backends/giobackend.py 2018-07-23 14:55:39 +0000
+++ duplicity/backends/giobackend.py 2019-05-29 23:32:13 +0000
@@ -139,12 +139,12 @@
def _put(self, source_path, remote_filename):
from gi.repository import Gio # @UnresolvedImport # pylint: disable=import-error
source_file = Gio.File.new_for_path(source_path.name)
- target_file = self.remote_file.get_child_for_display_name(remote_filename)
+ target_file = self.remote_file.get_child_for_display_name(util.fsdecode(remote_filename))
self.__copy_file(source_file, target_file)
def _get(self, filename, local_path):
from gi.repository import Gio # @UnresolvedImport # pylint: disable=import-error
- source_file = self.remote_file.get_child_for_display_name(filename)
+ source_file = self.remote_file.get_child_for_display_name(util.fsdecode(filename))
target_file = Gio.File.new_for_path(local_path.name)
self.__copy_file(source_file, target_file)
@@ -165,12 +165,12 @@
return files
def _delete(self, filename):
- target_file = self.remote_file.get_child_for_display_name(filename)
+ target_file = self.remote_file.get_child_for_display_name(util.fsdecode(filename))
target_file.delete(None)
def _query(self, filename):
from gi.repository import Gio # @UnresolvedImport # pylint: disable=import-error
- target_file = self.remote_file.get_child_for_display_name(filename)
+ target_file = self.remote_file.get_child_for_display_name(util.fsdecode(filename))
info = target_file.query_info(Gio.FILE_ATTRIBUTE_STANDARD_SIZE,
Gio.FileQueryInfoFlags.NONE, None)
return {u'size': info.get_size()}
=== modified file 'duplicity/backends/pydrivebackend.py'
--- duplicity/backends/pydrivebackend.py 2019-05-19 16:14:00 +0000
+++ duplicity/backends/pydrivebackend.py 2019-05-29 23:32:13 +0000
@@ -23,6 +23,7 @@
import duplicity.backend
from duplicity import log
+from duplicity import util
from duplicity.errors import BackendException
@@ -115,6 +116,10 @@
self.id_cache = {}
def file_by_name(self, filename):
+ from pydrive.files import ApiRequestError
+
+ filename = util.fsdecode(filename) # PyDrive deals with unicode filenames
+
if filename in self.id_cache:
# It might since have been locally moved, renamed or deleted, so we
# need to validate the entry.
@@ -164,20 +169,20 @@
drive_file = self.file_by_name(remote_filename)
if drive_file is None:
# No existing file, make a new one
- drive_file = self.drive.CreateFile({u'title': remote_filename,
+ drive_file = self.drive.CreateFile({u'title': util.fsdecode(remote_filename),
u'parents': [{u"kind": u"drive#fileLink",
u"id": self.folder}]})
- log.Info(u"PyDrive backend: creating new file '%s'" % (remote_filename,))
+ log.Info(u"PyDrive backend: creating new file '%s'" % (util.fsdecode(remote_filename),))
else:
log.Info(u"PyDrive backend: replacing existing file '%s' with id '%s'" % (
- remote_filename, drive_file[u'id']))
- drive_file.SetContentFile(source_path.name)
+ util.fsdecode(remote_filename), drive_file[u'id']))
+ drive_file.SetContentFile(util.fsdecode(source_path.name))
drive_file.Upload()
self.id_cache[remote_filename] = drive_file[u'id']
def _get(self, remote_filename, local_path):
drive_file = self.file_by_name(remote_filename)
- drive_file.GetContentFile(local_path.name)
+ drive_file.GetContentFile(util.fsdecode(local_path.name))
def _list(self):
drive_files = self.drive.ListFile({
@@ -198,7 +203,7 @@
if file_id != u'':
self.drive.auth.service.files().delete(fileId=file_id).execute()
else:
- log.Warn(u"File '%s' does not exist while trying to delete it" % (filename,))
+ log.Warn(u"File '%s' does not exist while trying to delete it" % (util.fsdecode(filename),))
def _query(self, filename):
drive_file = self.file_by_name(filename)
@@ -209,6 +214,7 @@
return {u'size': size}
def _error_code(self, operation, error):
+ from pydrive.files import ApiRequestError, FileNotUploadedError
if isinstance(error, FileNotUploadedError):
return log.ErrorCode.backend_not_found
elif isinstance(error, ApiRequestError):
=== modified file 'bin/duplicity'
--- bin/duplicity 2019-06-29 21:05:41 +0000
+++ bin/duplicity 2019-07-14 23:55:56 +0000
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# duplicity -- Encrypted bandwidth efficient backup
=== modified file 'duplicity/backends/_boto_single.py'
--- duplicity/backends/_boto_single.py 2019-06-24 22:24:53 +0000
+++ duplicity/backends/_boto_single.py 2019-06-27 22:34:51 +0000
@@ -29,6 +29,7 @@
from duplicity import log
from duplicity.errors import FatalBackendException, BackendException
from duplicity import progress
+from duplicity import util
BOTO_MIN_VERSION = u"2.1.1"
@@ -203,6 +204,8 @@
self.resetConnection()
def _put(self, source_path, remote_filename):
+ remote_filename = util.fsdecode(remote_filename)
+
if globals.s3_european_buckets:
if not globals.s3_use_new_style:
raise FatalBackendException(u"European bucket creation was requested, but not new-style "
@@ -267,6 +270,7 @@
rough_upload_speed))
def _get(self, remote_filename, local_path):
+ remote_filename = util.fsdecode(remote_filename)
key_name = self.key_prefix + remote_filename
self.pre_process_download(remote_filename, wait=True)
key = self._listed_keys[key_name]
@@ -300,9 +304,11 @@
return filename_list
def _delete(self, filename):
+ filename = util.fsdecode(filename)
self.bucket.delete_key(self.key_prefix + filename)
def _query(self, filename):
+ filename = util.fsdecode(filename)
key = self.bucket.lookup(self.key_prefix + filename)
if key is None:
return {u'size': -1}
=== modified file 'duplicity/util.py'
--- duplicity/util.py 2019-03-10 21:46:31 +0000
+++ duplicity/util.py 2019-06-11 02:04:38 +0000
@@ -119,7 +119,7 @@
# Encoded, likely in filesystem encoding
return fsdecode(m)
else:
- return None
+ return u''
def maybe_ignore_errors(fn):
......@@ -46,7 +46,7 @@ parts:
- dump
plugin: python
python-version: python3
source: https://launchpad.net/duplicity/0.8-series/0.8.00/+download/duplicity-0.8.00.tar.gz
source: https://launchpad.net/duplicity/0.8-series/0.8.01/+download/duplicity-0.8.01.tar.gz
source-type: tar
python-packages:
- cffi==1.11.5 # gets pulled in by pyrax, and we need to lock to same version as Ubuntu ships
......@@ -63,11 +63,8 @@ parts:
- python3-swiftclient
override-prime: |
snapcraftctl prime
patch -d lib/python3.6/site-packages -p0 < fsdecode.patch
patch -d lib/python3.6/site-packages -p0 < uexc.patch
patch -d lib/python3.6/site-packages -p0 < boto.patch
patch -d lib/python3.6/site-packages -p0 < s3fsdecode.patch
rm fsdecode.patch uexc.patch boto.patch s3fsdecode.patch
patch -p0 < python3.patch
rm python3.patch
deja-dup:
plugin: meson
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment