refactor: make a generally usable function
fix: remove support code for ancient pyinstaller
the "else" branch was needed for pyinstaller < 20160820 because it did
not have the LD_LIBRARY_PATH_ORIG env var, so we just killed LDLP
because we had no better way.
but with borg tests running under fakeroot, this is troublesome as
fakeroot uses this also and can't find its library without it.
so, just remove it, we do not need to support old pyinstaller.
due to block buffering (in borg, pipes, sshd, ssh) partial lines might
be received. for plain text, this causes cosmetic issues, for json it
causes tracebacks due to parse errors.
the code now makes sure handle_remote_line() only gets called with a
complete line (which is terminated by any universal newline char, a
pure \r seems to be needed for remote progress displays).
it also fixes a yet undiscovered partial utf-8-sequence decoding issue
that might occur for the same reason.
the client_supports_log_v3 flag was added to differentiate 1.1.0 beta3
to beta5 clients (which did not support parsing json log format from
server) from >= 1.1.0beta6 clients (which support it).
for clients older than 1.1.0b3, no json log format will be negotiated
anyway.
by removing the client_supports_log_v3 flag support, we drop support for
clients using 1.1.0beta3..5.
thus, a client is now expected to either support old log format (like
borg 1.0.x) or new json format (like borg 1.1.0 >= beta6).
client server comment
===========================================
any 0.29+ uses $LOG plain remote log format
any 1.0.x uses $LOG plain remote log format
1.0.x 1.1.0 uses $LOG plain remote log format
1.1.0b1/b2 1.1.0 (uses $LOG plain remote log format)
1.1.0b3-b5 1.1.0 (malfunction)
1.1.0b6 1.1.0 (uses json remote log format)
1.1.0rc 1.1.0 uses json remote log format
1.1.x 1.1.0 uses json remote log format
(beta testing is over and betas are unsupported now)
Note: client_supports_log_v3 flag was added in changeset
18a2902c9c
if borg stderr is not connected to a tty, but to ssh (when using
borg client/server), sys.stderr is block buffered (tty: line buffered).
thus we better flush explicitly after emitting a line as the receiving
side can not handle partial json at the end of the block.
also, it might solve some delays, when output didn't arrive at
receiving side in time.
- deduplicated .bash_profile creation
- now we always have XDISTN=... and LANG=... (not just for pyenv)
- username is just given where needed ("ubuntu" vs "vagrant")
- override for cygwin not needed as init is not global any more
Buffer: delete support for multiple threads
Thread-local objects are a fairly complex footgun, so avoid them in
the first place. When a Compressor uses a Buffer (for example),
just create multiple Compressor instances for each thread, owned by
each thread. Minimize multiple ownership of objects across
threads if at all possible!