From 69691f0f15cc09a1f35372d36895861038df382b Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Sun, 11 Apr 2021 15:06:37 -0500 Subject: [PATCH] ftp: fix tab completion We need the 'repo' variable in enter_completion() which assumes it's global, so make it global. Fixes: c4d10541ed1e ("ftp: convert to internal command") Signed-off-by: Johannes Berg --- config/configure | 4 +++- lib/bup/cmd/ftp.py | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/config/configure b/config/configure index 2223c7e..d8f6b4b 100755 --- a/config/configure +++ b/config/configure @@ -104,13 +104,15 @@ else # Earlier versions didn't support --embed bup_python_ldflags_embed=$("$bup_python_config" --ldflags) || exit $? fi +bup_python_cflags="$bup_python_cflags -fPIC" + case "$OSTYPE" in darwin*) # For at least 10.3+ (2003+) bup_python_ldflags="$bup_python_ldflags -bundle -undefined dynamic_lookup" ;; *) - bup_python_ldflags="$bup_python_ldflags -shared -fPIC" + bup_python_ldflags="$bup_python_ldflags -shared" ;; esac diff --git a/lib/bup/cmd/ftp.py b/lib/bup/cmd/ftp.py index bed1b9a..40449a6 100755 --- a/lib/bup/cmd/ftp.py +++ b/lib/bup/cmd/ftp.py @@ -14,6 +14,8 @@ from bup.io import byte_stream, path_msg from bup.repo import LocalRepo +repo = None + class OptionError(Exception): pass @@ -122,6 +124,8 @@ def main(argv): git.check_repo_or_die() + global repo + sys.stdout.flush() out = byte_stream(sys.stdout) stdin = byte_stream(sys.stdin) -- 2.39.2