From bb463dca0ce2db0e942f5c485dbae4c0ee9de643 Mon Sep 17 00:00:00 2001 From: Marc Schiffbauer Date: Mon, 28 Dec 2015 17:53:11 +0100 Subject: app-backup/obnam: added patch to make sftp plugin work with paramiko Package-Manager: portage-2.2.26 --- ...-obnamlib-sftp-Add-prefetch-size-argument.patch | 31 ++++++++++++ app-backup/obnam/obnam-1.18.2-r1.ebuild | 55 ++++++++++++++++++++++ app-backup/obnam/obnam-1.18.2.ebuild | 51 -------------------- 3 files changed, 86 insertions(+), 51 deletions(-) create mode 100644 app-backup/obnam/files/obnam-1.18.2-obnamlib-sftp-Add-prefetch-size-argument.patch create mode 100644 app-backup/obnam/obnam-1.18.2-r1.ebuild delete mode 100644 app-backup/obnam/obnam-1.18.2.ebuild (limited to 'app-backup') 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 new file mode 100644 index 00000000000..20a8e7cb6b7 --- /dev/null +++ b/app-backup/obnam/files/obnam-1.18.2-obnamlib-sftp-Add-prefetch-size-argument.patch @@ -0,0 +1,31 @@ +From 738e9291ed15980bdac568fc5f9507a43897ba52 Mon Sep 17 00:00:00 2001 +From: Kyle Manna +Date: Fri, 6 Nov 2015 08:12:50 -0800 +Subject: [PATCH] obnamlib: sftp: Add prefetch size argument + +Paramiko made this argument required in v1.16. Details at +https://github.com/paramiko/paramiko/commit/49072f3537a8981e9d448c22481a1d2b92c03643 + +Attempt to fetch the entire file. I'm unsure if this is the original +intent. If the entire file isn't to be fetched, then the prefetch() is +probably not needed. +--- + obnamlib/plugins/sftp_plugin.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/obnamlib/plugins/sftp_plugin.py b/obnamlib/plugins/sftp_plugin.py +index c4d5c2f..a5bc72b 100644 +--- a/obnamlib/plugins/sftp_plugin.py ++++ b/obnamlib/plugins/sftp_plugin.py +@@ -555,7 +555,7 @@ class SftpFS(obnamlib.VirtualFileSystem): + def cat(self, pathname): + self._delay() + f = self.open(pathname, 'rb') +- f.prefetch() ++ f.prefetch(self.lstat(pathname).st_size) + chunks = [] + while True: + chunk = f.read(self.chunk_size) +-- +2.6.2 + diff --git a/app-backup/obnam/obnam-1.18.2-r1.ebuild b/app-backup/obnam/obnam-1.18.2-r1.ebuild new file mode 100644 index 00000000000..dff2085b7a6 --- /dev/null +++ b/app-backup/obnam/obnam-1.18.2-r1.ebuild @@ -0,0 +1,55 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +PYTHON_COMPAT=( python2_7 ) +PYTHON_REQ_USE="threads" + +inherit distutils-r1 + +DESCRIPTION="A backup program that supports encryption and deduplication" +HOMEPAGE="http://obnam.org/" +SRC_URI="http://git.liw.fi/cgi-bin/cgit/cgit.cgi/obnam/snapshot/${P}.tar.gz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +DEPEND="${PYTHON_DEPS} + dev-python/cliapp[${PYTHON_USEDEP}] + dev-python/fuse-python[${PYTHON_USEDEP}] + dev-python/larch[${PYTHON_USEDEP}] + dev-python/paramiko[${PYTHON_USEDEP}] + dev-python/pyyaml[${PYTHON_USEDEP}] + dev-python/tracing[${PYTHON_USEDEP}] + dev-python/ttystatus[${PYTHON_USEDEP}] + " +RDEPEND="${DEPEND}" + +src_prepare() { + epatch "${FILESDIR}/${P}-obnamlib-sftp-Add-prefetch-size-argument.patch" +} + +src_compile() { + addwrite /proc/self/comm + distutils-r1_src_compile +} + +src_install() { + distutils-r1_src_install + find "${D}" -name "obnam-viewprof*" -delete + insinto /etc + doins "${FILESDIR}"/obnam.conf + keepdir /var/log/obnam +} + +pkg_postinst() { + if [[ $REPLACING_VERSIONS < "1.2" ]]; then + elog "You will need to setup a config file before running obnam for the first time." + elog "For details, please see the obnam(1) manual page." + elog "An example file has been installed as /etc/obnam.conf for your convenience." + fi +} diff --git a/app-backup/obnam/obnam-1.18.2.ebuild b/app-backup/obnam/obnam-1.18.2.ebuild deleted file mode 100644 index 8b909251b95..00000000000 --- a/app-backup/obnam/obnam-1.18.2.ebuild +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright 1999-2015 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id$ - -EAPI=5 - -PYTHON_COMPAT=( python2_7 ) -PYTHON_REQ_USE="threads" - -inherit distutils-r1 - -DESCRIPTION="A backup program that supports encryption and deduplication" -HOMEPAGE="http://obnam.org/" -SRC_URI="http://git.liw.fi/cgi-bin/cgit/cgit.cgi/obnam/snapshot/${P}.tar.gz" - -LICENSE="GPL-3" -SLOT="0" -KEYWORDS="~amd64 ~x86" -IUSE="" - -DEPEND="${PYTHON_DEPS} - dev-python/cliapp[${PYTHON_USEDEP}] - dev-python/fuse-python[${PYTHON_USEDEP}] - dev-python/larch[${PYTHON_USEDEP}] - >dev-python/paramiko-1.13.0[${PYTHON_USEDEP}] - dev-python/pyyaml[${PYTHON_USEDEP}] - dev-python/tracing[${PYTHON_USEDEP}] - dev-python/ttystatus[${PYTHON_USEDEP}] - " -RDEPEND="${DEPEND}" - -src_compile() { - addwrite /proc/self/comm - distutils-r1_src_compile -} - -src_install() { - distutils-r1_src_install - find "${D}" -name "obnam-viewprof*" -delete - insinto /etc - doins "${FILESDIR}"/obnam.conf - keepdir /var/log/obnam -} - -pkg_postinst() { - if [[ $REPLACING_VERSIONS < "1.2" ]]; then - elog "You will need to setup a config file before running obnam for the first time." - elog "For details, please see the obnam(1) manual page." - elog "An example file has been installed as /etc/obnam.conf for your convenience." - fi -} -- cgit v1.2.1