]> arthur.barton.de Git - bup.git/blobdiff - lib/bup/ssh.py
PackWriter._end: always try to release objcache and parentfd
[bup.git] / lib / bup / ssh.py
index ae560908fc7439c8dd11eb16284d5974dd523745..b6352293b54a642d47ce11e1d13c24cb889f9b54 100644 (file)
@@ -5,7 +5,7 @@ Connect to a remote host via SSH and execute a command on the host.
 from __future__ import absolute_import, print_function
 import sys, os, re, subprocess
 
-from bup import helpers, path
+from bup import path
 from bup.compat import environ
 
 def connect(rhost, port, subcmd, stderr=None):
@@ -14,11 +14,16 @@ def connect(rhost, port, subcmd, stderr=None):
     if rhost is None or rhost == b'-':
         argv = [path.exe(), subcmd]
     else:
-        buglvl = helpers.atoi(environ.get(b'BUP_DEBUG'))
-        force_tty = helpers.atoi(environ.get(b'BUP_FORCE_TTY'))
+        buglvl = int(environ.get(b'BUP_DEBUG', 0))
+        force_tty = int(environ.get(b'BUP_FORCE_TTY', 0))
+        tty_width = environ.get(b'BUP_TTY_WIDTH', None)
+        if tty_width is not None:
+            tty_width = b'BUP_TTY_WIDTH=%d' % int(tty_width)
+        else:
+            tty_width = b''
         cmd = b"""
-                   sh -c 'BUP_DEBUG=%d BUP_FORCE_TTY=%d bup %s'
-               """ % (buglvl, force_tty, subcmd)
+                   sh -c 'BUP_DEBUG=%d BUP_FORCE_TTY=%d %s bup %s'
+               """ % (buglvl, force_tty, tty_width, subcmd)
         argv = [b'ssh']
         if port:
             argv.extend((b'-p', port))