aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorLeo <thinkabit.ukim@gmail.com>2019-09-26 15:51:54 -0300
committerKevin Daudt <kdaudt@alpinelinux.org>2019-10-25 19:06:03 +0000
commit52dfc8ba1c43615643924a8cc795902bb4c9b93f (patch)
treedb6357f377b5a9a9a1632c496a0c6078a94e6c71 /main
parent711b445b9eed4d01bcb6073a3071968cd42d5a16 (diff)
downloadaports-52dfc8ba1c43615643924a8cc795902bb4c9b93f.tar.bz2
aports-52dfc8ba1c43615643924a8cc795902bb4c9b93f.tar.xz
main/pssh: switch to python3
Closes !156
Diffstat (limited to 'main')
-rw-r--r--main/pssh/APKBUILD44
-rw-r--r--main/pssh/python3.patch56
2 files changed, 73 insertions, 27 deletions
diff --git a/main/pssh/APKBUILD b/main/pssh/APKBUILD
index 7bc9b23cdb..c643051dbf 100644
--- a/main/pssh/APKBUILD
+++ b/main/pssh/APKBUILD
@@ -2,45 +2,35 @@
# Maintainer: Johannes Matheis <jomat+alpinebuild@jmt.gr>
pkgname=pssh
pkgver=2.3.1
-pkgrel=1
+pkgrel=2
pkgdesc="PSSH provides parallel versions of OpenSSH and related tools: pssh, pscp, prsync, pnuke, and pslurp"
url="https://code.google.com/p/parallel-ssh/"
arch="noarch"
-license="BSD"
-depends="python2"
-depends_dev=""
-makedepends="python2-dev"
-install=""
+license="BSD-3-Clause"
+depends="python3 cmd:ssh"
+makedepends="py3-setuptools"
subpackages="$pkgname-doc"
-source="https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/parallel-ssh/pssh-$pkgver.tar.gz"
+source="https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/parallel-ssh/pssh-$pkgver.tar.gz
+ python3.patch
+ "
-_builddir="${srcdir}"/"${pkgname}"-"${pkgver}"
prepare() {
- local i
- cd "$_builddir"
- for i in $source; do
- case $i in
- *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
- esac
- done
+ default_prepare
+ sed -i -e "s|man/man1'|share/&|g" setup.py
}
build() {
- cd "$_builddir"
- python2 setup.py build || return 1
+ cd "$builddir"
+ python3 setup.py build
}
package() {
- cd "$_builddir"
- python2 setup.py install --prefix=/usr --root="$pkgdir" || return 1
+ cd "$builddir"
+ python3 setup.py install --prefix=/usr --root="$pkgdir"
- install -d "${pkgdir}"/usr/libexec/pssh
- mv "${pkgdir}"/usr/bin/pssh-askpass "${pkgdir}"/usr/libexec/pssh
-
- install -d "${pkgdir}"/usr/share
- mv "${pkgdir}"/usr/man "${pkgdir}"/usr/share
+ install -d "$pkgdir"/usr/libexec/pssh
+ mv "$pkgdir"/usr/bin/pssh-askpass "$pkgdir"/usr/libexec/pssh
}
-md5sums="53e70d53064f658bf8f44880340e8e5c pssh-2.3.1.tar.gz"
-sha256sums="539f8d8363b722712310f3296f189d1ae8c690898eca93627fc89a9cb311f6b4 pssh-2.3.1.tar.gz"
-sha512sums="c39e1c2b0a3bc2bd736f1e7d2f402db6a128e81d6a80ce7e97f39e7fae93f7a20037b43b5725bed5ba911f54e36a9b65c509d858a53c696989b76b1322e7680f pssh-2.3.1.tar.gz"
+sha512sums="c39e1c2b0a3bc2bd736f1e7d2f402db6a128e81d6a80ce7e97f39e7fae93f7a20037b43b5725bed5ba911f54e36a9b65c509d858a53c696989b76b1322e7680f pssh-2.3.1.tar.gz
+d37666fcf8a274a594c8f16c69e569aa6c8bd9d9496ea47657f3267c1b4d3ed2a0c106c365f5e0631fbb51f2bcfacc78a2c708d8a62f3ce2ea018e8c185b16f9 python3.patch"
diff --git a/main/pssh/python3.patch b/main/pssh/python3.patch
new file mode 100644
index 0000000000..3f3dcc9973
--- /dev/null
+++ b/main/pssh/python3.patch
@@ -0,0 +1,56 @@
+From 8afbefc445059be55dfd20785ee81e4533ae3af1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rogut=C4=97s=20Sparnuotos?= <rogutes@googlemail.com>
+Date: Sun, 26 Feb 2012 11:05:48 +0200
+Subject: [PATCH] Imports are absolute by default in Python3.
+
+---
+ psshlib/cli.py | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/psshlib/cli.py b/psshlib/cli.py
+index c14b309..c342cde 100644
+--- a/psshlib/cli.py
++++ b/psshlib/cli.py
+@@ -6,7 +6,8 @@ import os
+ import shlex
+ import sys
+ import textwrap
+-import version
++
++from psshlib import version
+
+ _DEFAULT_PARALLELISM = 32
+ _DEFAULT_TIMEOUT = 0 # "infinity" by default
+--
+1.7.9.1
+
+--- a/psshlib/manager.py.orig 2012-02-02 17:13:09.000000000 +0100
++++ b/psshlib/manager.py 2016-01-17 11:52:13.764088460 +0100
+@@ -4,0 +5 @@
++import fcntl
+@@ -211,0 +213 @@
++ fcntl.fcntl(wakeup_writefd, fcntl.F_SETFL, os.O_NONBLOCK)
+
+--- a/psshlib/askpass_server.py.orig 2012-02-02 17:13:09.000000000 +0100
++++ b/psshlib/askpass_server.py 2016-01-17 11:43:37.006779012 +0100
+@@ -72 +72 @@
+- bytes_written = conn.send(buffer)
++ bytes_written = conn.send(buffer.encode())
+
+diff --git a/bin/pssh b/bin/pssh
+index 860bad2..5fe726d 100755
+--- a/bin/pssh
++++ b/bin/pssh
+@@ -65,7 +65,10 @@ def do_pssh(hosts, cmdline, opts):
+ if opts.errdir and not os.path.exists(opts.errdir):
+ os.makedirs(opts.errdir)
+ if opts.send_input:
+- stdin = sys.stdin.read()
++ if hasattr(sys.stdin, 'buffer'):
++ stdin = sys.stdin.buffer.read()
++ else:
++ stdin = sys.stdin.read()
+ else:
+ stdin = None
+ manager = Manager(opts)
+