From d7ace46f780d6c3e80fe0dff711c0373844a7165 Mon Sep 17 00:00:00 2001
From: Alexandre Detiste <tchet@debian.org>
Date: Wed, 23 Oct 2024 10:39:58 +0200
Subject: [PATCH] refresh patches

---
 debian/patches/py3k-tests.patch               | 21 +------------
 ...e-check-easy-install-script_help_fix.patch | 31 ++++++-------------
 debian/patches/series                         |  1 -
 debian/patches/tests-mock-TERM.patch          | 23 --------------
 debian/patches/tests_pip_fix.patch            |  9 ++----
 5 files changed, 13 insertions(+), 72 deletions(-)
 delete mode 100644 debian/patches/tests-mock-TERM.patch

diff --git a/debian/patches/py3k-tests.patch b/debian/patches/py3k-tests.patch
index 6d6f915..0e7c73e 100644
--- a/debian/patches/py3k-tests.patch
+++ b/debian/patches/py3k-tests.patch
@@ -7,24 +7,7 @@ We don't currently use this, because their tox config isn't shipped in
 their source tarball.
 
 Forwarded: not-needed
----
- scripts/activate-global-python-argcomplete | 2 +-
- test/prog                                  | 2 +-
- test/test.py                               | 4 ++--
- 3 files changed, 4 insertions(+), 4 deletions(-)
 
-diff --git a/scripts/activate-global-python-argcomplete b/scripts/activate-global-python-argcomplete
-index 96017cb..cab027c 100755
---- a/scripts/activate-global-python-argcomplete
-+++ b/scripts/activate-global-python-argcomplete
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/env python3
- # PYTHON_ARGCOMPLETE_OK
- 
- # Copyright 2012-2023, Andrey Kislyuk and argcomplete contributors.
-diff --git a/test/prog b/test/prog
-index 614f50a..168ca36 100755
 --- a/test/prog
 +++ b/test/prog
 @@ -1,4 +1,4 @@
@@ -33,8 +16,6 @@ index 614f50a..168ca36 100755
  # PYTHON_ARGCOMPLETE_OK
  """Test script used by test.TestBash."""
  
-diff --git a/test/test.py b/test/test.py
-index c8f9419..cc3944f 100755
 --- a/test/test.py
 +++ b/test/test.py
 @@ -1,4 +1,4 @@
@@ -43,7 +24,7 @@ index c8f9419..cc3944f 100755
  import argparse
  import contextlib
  import os
-@@ -1376,7 +1376,7 @@ class TestBashZshGlobalBase(TestBashZshBase):
+@@ -1381,7 +1381,7 @@
              self.sh.run_command("export PATH=$PATH:./bin")
              self.sh.run_command("export PYTHONPATH=.:$PYTHONPATH")
              test_package = os.path.join(TEST_DIR, "test_package")
diff --git a/debian/patches/python-argcomplete-check-easy-install-script_help_fix.patch b/debian/patches/python-argcomplete-check-easy-install-script_help_fix.patch
index 473b625..8c71b4d 100644
--- a/debian/patches/python-argcomplete-check-easy-install-script_help_fix.patch
+++ b/debian/patches/python-argcomplete-check-easy-install-script_help_fix.patch
@@ -1,32 +1,21 @@
 From: =?utf-8?b?Ik1hcmMgRGVxdcOobmVzIChEdWNrKSI=?= <Duck@DuckCorp.org>
 Date: Sat, 4 Nov 2023 10:34:21 +0200
-Subject: Add -h/--help support to
- python-argcomplete-check-easy-install-script
-
+Subject: Add -h/--help support to python-argcomplete-check-easy-install-script
 Forwarded: no
----
- scripts/python-argcomplete-check-easy-install-script | 2 +-
- test/test.py                                         | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/scripts/python-argcomplete-check-easy-install-script b/scripts/python-argcomplete-check-easy-install-script
-index 07961a2..f51061a 100755
---- a/scripts/python-argcomplete-check-easy-install-script
-+++ b/scripts/python-argcomplete-check-easy-install-script
-@@ -15,7 +15,7 @@ Usage:
+--- a/argcomplete/scripts/python_argcomplete_check_easy_install_script.py
++++ b/argcomplete/scripts/python_argcomplete_check_easy_install_script.py
+@@ -20,7 +20,7 @@
  
- import sys
  
--if len(sys.argv) != 2:
-+if len(sys.argv) != 2 or sys.argv[1] in ["-h", "--help"]:
-     sys.exit(__doc__)
+ def main():
+-    if len(sys.argv) != 2:
++    if len(sys.argv) != 2 or sys.argv[1] in ["-h", "--help"]:
+         sys.exit(__doc__)
  
- sys.tracebacklimit = 0
-diff --git a/test/test.py b/test/test.py
-index 8db5718..e9a0e3a 100755
+     sys.tracebacklimit = 0
 --- a/test/test.py
 +++ b/test/test.py
-@@ -1378,7 +1378,7 @@ class TestBashZshGlobalBase(TestBashZshBase):
+@@ -1383,7 +1383,7 @@
              self.sh.run_command("cd " + os.getcwd())
              self.sh.run_command("export PATH=$PATH:./bin")
              self.sh.run_command("export PYTHONPATH=.:$PYTHONPATH")
diff --git a/debian/patches/series b/debian/patches/series
index 09b7c71..87925eb 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,3 @@
 py3k-tests.patch
 tests_pip_fix.patch
 python-argcomplete-check-easy-install-script_help_fix.patch
-tests-mock-TERM.patch
diff --git a/debian/patches/tests-mock-TERM.patch b/debian/patches/tests-mock-TERM.patch
deleted file mode 100644
index b22ad6c..0000000
--- a/debian/patches/tests-mock-TERM.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Description: Fix zsh-related tests failure when TERM variable is set
- When running zsh-related tests in the Ubuntu autopkgtest infrastructure, the
- TERM environment variable is set to "linux". This causes the test-suite to
- fail because zsh's output is impact by the TERM variable. We now override the
- variable when running the zsh-related tests to make the test-suite pass.
-Author: Olivier Gayot <olivier.gayot@canonical.com>
-Bug: https://github.com/kislyuk/argcomplete/issues/496
-Bug-Debian: https://bugs.debian.org/1077792
-Bug-Ubuntu: https://launchpad.net/bugs/2075572
-Forwarded: https://github.com/kislyuk/argcomplete/pull/497
-Last-Update: 2024-08-02
----
-This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---- a/test/test.py
-+++ b/test/test.py
-@@ -65,6 +65,7 @@
- 
- def _repl_sh(command, args, non_printable_insert):
-     os.environ["PS1"] = "$"
-+    os.environ["TERM"] = ""
-     child = pexpect.spawn(command, args, echo=False, encoding="utf-8")
-     ps1 = PEXPECT_PROMPT[:5] + non_printable_insert + PEXPECT_PROMPT[5:]
-     ps2 = PEXPECT_CONTINUATION_PROMPT[:5] + non_printable_insert + PEXPECT_CONTINUATION_PROMPT[5:]
diff --git a/debian/patches/tests_pip_fix.patch b/debian/patches/tests_pip_fix.patch
index 5098e81..f6016ac 100644
--- a/debian/patches/tests_pip_fix.patch
+++ b/debian/patches/tests_pip_fix.patch
@@ -6,15 +6,10 @@ This avoids tripping over Debian's posix_prefix default installation
 scheme
 
 Forwarded: not-needed
----
- test/test.py | 4 ++++
- 1 file changed, 4 insertions(+)
 
-diff --git a/test/test.py b/test/test.py
-index cc3944f..8db5718 100755
 --- a/test/test.py
 +++ b/test/test.py
-@@ -1331,6 +1331,9 @@ class TestZsh(TestBashZshBase, unittest.TestCase):
+@@ -1332,6 +1332,9 @@
  class TestBashZshGlobalBase(TestBashZshBase):
      install_cmd = 'eval "$(activate-global-python-argcomplete --dest=-)"'
  
@@ -24,7 +19,7 @@ index cc3944f..8db5718 100755
      def test_redirection_completion(self):
          with TempDir(prefix="test_dir_py", dir="."):
              self.sh.run_command("cd " + os.getcwd())
-@@ -1375,6 +1378,7 @@ class TestBashZshGlobalBase(TestBashZshBase):
+@@ -1380,6 +1383,7 @@
              self.sh.run_command("cd " + os.getcwd())
              self.sh.run_command("export PATH=$PATH:./bin")
              self.sh.run_command("export PYTHONPATH=.:$PYTHONPATH")
-- 
GitLab