Gentoo Archives: gentoo-commits

From: Marc Schiffbauer <mschiff@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-backup/obnam/, app-backup/obnam/files/
Date: Mon, 28 Dec 2015 16:53:50
Message-Id: 1451321615.bb463dca0ce2db0e942f5c485dbae4c0ee9de643.mschiff@gentoo
1 commit: bb463dca0ce2db0e942f5c485dbae4c0ee9de643
2 Author: Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
3 AuthorDate: Mon Dec 28 16:53:11 2015 +0000
4 Commit: Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
5 CommitDate: Mon Dec 28 16:53:35 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bb463dca
7
8 app-backup/obnam: added patch to make sftp plugin work with paramiko
9
10 Package-Manager: portage-2.2.26
11
12 ...-obnamlib-sftp-Add-prefetch-size-argument.patch | 31 ++++++++++++++++++++++
13 ...{obnam-1.18.2.ebuild => obnam-1.18.2-r1.ebuild} | 6 ++++-
14 2 files changed, 36 insertions(+), 1 deletion(-)
15
16 diff --git a/app-backup/obnam/files/obnam-1.18.2-obnamlib-sftp-Add-prefetch-size-argument.patch b/app-backup/obnam/files/obnam-1.18.2-obnamlib-sftp-Add-prefetch-size-argument.patch
17 new file mode 100644
18 index 0000000..20a8e7c
19 --- /dev/null
20 +++ b/app-backup/obnam/files/obnam-1.18.2-obnamlib-sftp-Add-prefetch-size-argument.patch
21 @@ -0,0 +1,31 @@
22 +From 738e9291ed15980bdac568fc5f9507a43897ba52 Mon Sep 17 00:00:00 2001
23 +From: Kyle Manna <kyle@×××××××××.com>
24 +Date: Fri, 6 Nov 2015 08:12:50 -0800
25 +Subject: [PATCH] obnamlib: sftp: Add prefetch size argument
26 +
27 +Paramiko made this argument required in v1.16. Details at
28 +https://github.com/paramiko/paramiko/commit/49072f3537a8981e9d448c22481a1d2b92c03643
29 +
30 +Attempt to fetch the entire file. I'm unsure if this is the original
31 +intent. If the entire file isn't to be fetched, then the prefetch() is
32 +probably not needed.
33 +---
34 + obnamlib/plugins/sftp_plugin.py | 2 +-
35 + 1 file changed, 1 insertion(+), 1 deletion(-)
36 +
37 +diff --git a/obnamlib/plugins/sftp_plugin.py b/obnamlib/plugins/sftp_plugin.py
38 +index c4d5c2f..a5bc72b 100644
39 +--- a/obnamlib/plugins/sftp_plugin.py
40 ++++ b/obnamlib/plugins/sftp_plugin.py
41 +@@ -555,7 +555,7 @@ class SftpFS(obnamlib.VirtualFileSystem):
42 + def cat(self, pathname):
43 + self._delay()
44 + f = self.open(pathname, 'rb')
45 +- f.prefetch()
46 ++ f.prefetch(self.lstat(pathname).st_size)
47 + chunks = []
48 + while True:
49 + chunk = f.read(self.chunk_size)
50 +--
51 +2.6.2
52 +
53
54 diff --git a/app-backup/obnam/obnam-1.18.2.ebuild b/app-backup/obnam/obnam-1.18.2-r1.ebuild
55 similarity index 90%
56 rename from app-backup/obnam/obnam-1.18.2.ebuild
57 rename to app-backup/obnam/obnam-1.18.2-r1.ebuild
58 index 8b90925..dff2085 100644
59 --- a/app-backup/obnam/obnam-1.18.2.ebuild
60 +++ b/app-backup/obnam/obnam-1.18.2-r1.ebuild
61 @@ -22,13 +22,17 @@ DEPEND="${PYTHON_DEPS}
62 dev-python/cliapp[${PYTHON_USEDEP}]
63 dev-python/fuse-python[${PYTHON_USEDEP}]
64 dev-python/larch[${PYTHON_USEDEP}]
65 - >dev-python/paramiko-1.13.0[${PYTHON_USEDEP}]
66 + dev-python/paramiko[${PYTHON_USEDEP}]
67 dev-python/pyyaml[${PYTHON_USEDEP}]
68 dev-python/tracing[${PYTHON_USEDEP}]
69 dev-python/ttystatus[${PYTHON_USEDEP}]
70 "
71 RDEPEND="${DEPEND}"
72
73 +src_prepare() {
74 + epatch "${FILESDIR}/${P}-obnamlib-sftp-Add-prefetch-size-argument.patch"
75 +}
76 +
77 src_compile() {
78 addwrite /proc/self/comm
79 distutils-r1_src_compile