summaryrefslogtreecommitdiff
path: root/source/n/pssh
diff options
context:
space:
mode:
Diffstat (limited to 'source/n/pssh')
-rw-r--r--source/n/pssh/pssh-2.3.1-py3-import.patch13
-rw-r--r--source/n/pssh/pssh-2.3.1-py3-min-int-none.patch13
-rw-r--r--source/n/pssh/pssh-2.3.1-py3-non-blocking.patch35
-rw-r--r--source/n/pssh/pssh-2.3.1-py3-str-bytes-encode.patch13
-rw-r--r--source/n/pssh/pssh-read-stdin-as-bytes-in-Python-3.patch16
-rwxr-xr-xsource/n/pssh/pssh.SlackBuild36
-rw-r--r--source/n/pssh/slack-desc12
7 files changed, 120 insertions, 18 deletions
diff --git a/source/n/pssh/pssh-2.3.1-py3-import.patch b/source/n/pssh/pssh-2.3.1-py3-import.patch
new file mode 100644
index 00000000..d40104fb
--- /dev/null
+++ b/source/n/pssh/pssh-2.3.1-py3-import.patch
@@ -0,0 +1,13 @@
+diff --git a/psshlib/cli.py b/psshlib/cli.py
+index c14b309..ddfe0ee 100644
+--- a/psshlib/cli.py
++++ b/psshlib/cli.py
+@@ -6,7 +6,7 @@ import os
+ import shlex
+ import sys
+ import textwrap
+-import version
++from psshlib import version
+
+ _DEFAULT_PARALLELISM = 32
+ _DEFAULT_TIMEOUT = 0 # "infinity" by default
diff --git a/source/n/pssh/pssh-2.3.1-py3-min-int-none.patch b/source/n/pssh/pssh-2.3.1-py3-min-int-none.patch
new file mode 100644
index 00000000..c202bc8e
--- /dev/null
+++ b/source/n/pssh/pssh-2.3.1-py3-min-int-none.patch
@@ -0,0 +1,13 @@
+diff --git a/bin/pssh b/bin/pssh
+index 5b6c2a5..dc53a36 100755
+--- a/bin/pssh
++++ b/bin/pssh
+@@ -90,7 +90,7 @@ def do_pssh(hosts, cmdline, opts):
+ except FatalError:
+ sys.exit(1)
+
+- if min(statuses) < 0:
++ if None in statuses:
+ # At least one process was killed.
+ sys.exit(3)
+ # The any builtin was introduced in Python 2.5 (so we can't use it yet):
diff --git a/source/n/pssh/pssh-2.3.1-py3-non-blocking.patch b/source/n/pssh/pssh-2.3.1-py3-non-blocking.patch
new file mode 100644
index 00000000..bcf4b4fd
--- /dev/null
+++ b/source/n/pssh/pssh-2.3.1-py3-non-blocking.patch
@@ -0,0 +1,35 @@
+# https://github.com/nplanel/parallel-ssh/commit/ee379dc5c69e4e0f62f92fb48f9a9ce6af0b2ac4.patch
+From ee379dc5c69e4e0f62f92fb48f9a9ce6af0b2ac4 Mon Sep 17 00:00:00 2001
+From: Nicolas PLANEL <nplanel@gmail.com>
+Date: Fri, 23 Oct 2015 01:20:25 +1100
+Subject: [PATCH] fixup : wakeup_writefd must be non-blocking
+
+wakeup_writefd should be non-blocking as signal.set_wakeup_fd()
+API request it.
+
+"ValueError: the fd 4 must be in non-blocking mode"
+---
+ psshlib/manager.py | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/psshlib/manager.py b/psshlib/manager.py
+index 7dbf4e3..db35e76 100644
+--- a/psshlib/manager.py
++++ b/psshlib/manager.py
+@@ -2,6 +2,7 @@
+
+ from errno import EINTR
+ import os
++import fcntl
+ import select
+ import signal
+ import sys
+@@ -209,6 +210,7 @@ def __init__(self):
+
+ # Setup the wakeup file descriptor to avoid hanging on lost signals.
+ wakeup_readfd, wakeup_writefd = os.pipe()
++ fcntl.fcntl(wakeup_writefd, fcntl.F_SETFL, os.O_NONBLOCK)
+ self.register_read(wakeup_readfd, self.wakeup_handler)
+ # TODO: remove test when we stop supporting Python <2.5
+ if hasattr(signal, 'set_wakeup_fd'):
+
diff --git a/source/n/pssh/pssh-2.3.1-py3-str-bytes-encode.patch b/source/n/pssh/pssh-2.3.1-py3-str-bytes-encode.patch
new file mode 100644
index 00000000..1a6b4cc3
--- /dev/null
+++ b/source/n/pssh/pssh-2.3.1-py3-str-bytes-encode.patch
@@ -0,0 +1,13 @@
+diff --git a/psshlib/askpass_server.py b/psshlib/askpass_server.py
+index 4293164..4680749 100644
+--- a/psshlib/askpass_server.py
++++ b/psshlib/askpass_server.py
+@@ -69,7 +69,7 @@ class PasswordServer(object):
+ buffer = self.buffermap[fd]
+ conn = self.socketmap[fd]
+ try:
+- bytes_written = conn.send(buffer)
++ bytes_written = conn.send(buffer.encode('utf-8'))
+ except socket.error:
+ _, e, _ = sys.exc_info()
+ number = e.args[0]
diff --git a/source/n/pssh/pssh-read-stdin-as-bytes-in-Python-3.patch b/source/n/pssh/pssh-read-stdin-as-bytes-in-Python-3.patch
new file mode 100644
index 00000000..c64d7746
--- /dev/null
+++ b/source/n/pssh/pssh-read-stdin-as-bytes-in-Python-3.patch
@@ -0,0 +1,16 @@
+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)
diff --git a/source/n/pssh/pssh.SlackBuild b/source/n/pssh/pssh.SlackBuild
index a251d4b9..c8a9dad1 100755
--- a/source/n/pssh/pssh.SlackBuild
+++ b/source/n/pssh/pssh.SlackBuild
@@ -1,6 +1,6 @@
-#!/bin/sh
+#!/bin/bash
-# Copyright 2008, 2009, 2010, 2011 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2008, 2009, 2010, 2011, 2018 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,19 +22,30 @@
# required: package "python" version 2.2 or higher installed
-VERSION=2.3.1
-BUILD=1
+cd $(dirname $0) ; CWD=$(pwd)
+
+PKGNAM=pssh
+VERSION=${VERSION:-$(echo pssh*.tar.gz | cut -d - -f 2 | rev | cut -f 3- -d . | rev)}
+BUILD=${BUILD:-3}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
- i?86) export ARCH=i486 ;;
+ i?86) export ARCH=i586 ;;
arm*) export ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) export ARCH=$( uname -m ) ;;
esac
fi
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
+ exit 0
+fi
+
PREFIX=/usr
if [ "$ARCH" = "x86_64" ]; then
@@ -43,7 +54,6 @@ else
LIBDIRSUFFIX=""
fi
-CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-pssh
rm -rf $PKG
@@ -60,13 +70,15 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-for library in psshlib/* ; do
- # This will force removepkg to remove all runtime-compiled *.pyc files
- touch ${library}c
-done
+# fix python3 issues
+zcat $CWD/pssh-2.3.1-py3-import.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/pssh-2.3.1-py3-min-int-none.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/pssh-2.3.1-py3-non-blocking.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/pssh-2.3.1-py3-str-bytes-encode.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/pssh-read-stdin-as-bytes-in-Python-3.patch.gz | patch -p1 --verbose || exit 1
-# Install:
-python setup.py build install --root=$PKG
+# Install
+python3 setup.py build install --root=$PKG
# Compress manual pages:
find $PKG/usr/man -type f -exec gzip -9 {} \;
diff --git a/source/n/pssh/slack-desc b/source/n/pssh/slack-desc
index 0a4f043e..cb4a87c0 100644
--- a/source/n/pssh/slack-desc
+++ b/source/n/pssh/slack-desc
@@ -1,19 +1,19 @@
# HOW TO EDIT THIS FILE:
-# The "handy ruler" below makes it easier to edit a package description. Line
+# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
-# on the right side marks the last column you can put a character in. You must
-# make exactly 11 lines for the formatting to be correct. It's also
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
pssh: pssh (tools for collective remote system management)
pssh:
pssh: Pssh, a.k.a. "parallel ssh", are Python-written wrapper scripts for
-pssh: OpenSSH and rsync tools. They are useful for simultaneous control
-pssh: of large number of machines, using parallel ssh sessions. Included
+pssh: OpenSSH and rsync tools. They are useful for simultaneous control
+pssh: of large number of machines, using parallel ssh sessions. Included
pssh: are parallel versions of ssh, scp, and rsync, as well as a parallel
pssh: kill command.
pssh:
pssh: Pssh has been written by Brent Chun <bnc at theether.org>, and is
pssh: currently maintained by Andrew McNabb <amcnabb at mcnabbs.org>.
-pssh: Homepage: http://parallel-ssh.googlecode.com
+pssh: Homepage: https://code.google.com/archive/p/parallel-ssh/