Ticket #70601: 0001-py-awscli2-Support-empty-PAGER.patch

File 0001-py-awscli2-Support-empty-PAGER.patch, 2.5 KB (added by graywolf-s1, 3 weeks ago)

Patch fixing the issues

  • python/py-awscli2/Portfile

    From dcc8310d6ec954260b15001ca930060c5959f7d5 Mon Sep 17 00:00:00 2001
    From: Tomas Volf <~@wolfsden.cz>
    Date: Mon, 2 Sep 2024 14:29:22 +0200
    Subject: [PATCH] py-awscli2: Support empty PAGER.
    
    * python/py-awscli2/files/0001-help-Support-empty-PAGER.patch: New patch.
    * python/py-awscli2/Portfile (patchfiles): Use it.
    ---
     python/py-awscli2/Portfile                    |  3 +-
     .../files/0001-help-Support-empty-PAGER.patch | 31 +++++++++++++++++++
     2 files changed, 33 insertions(+), 1 deletion(-)
     create mode 100644 python/py-awscli2/files/0001-help-Support-empty-PAGER.patch
    
    diff --git a/python/py-awscli2/Portfile b/python/py-awscli2/Portfile
    index 506e49d0f05..4fd88ebcb0f 100644
    a b if {${name} ne ${subport}} { 
    6565    }
    6666
    6767    patch.pre_args-replace  -p0 -p1
    68     patchfiles          patch-requirements.diff
     68    patchfiles          patch-requirements.diff \
     69                        0001-help-Support-empty-PAGER.patch
    6970
    7071    post-patch {
    7172        reinplace \
  • new file python/py-awscli2/files/0001-help-Support-empty-PAGER.patch

    diff --git a/python/py-awscli2/files/0001-help-Support-empty-PAGER.patch b/python/py-awscli2/files/0001-help-Support-empty-PAGER.patch
    new file mode 100644
    index 00000000000..9aa2e6c8be7
    - +  
     1From f603189dbe697b663f66a1d1e432f7c1aa1ed115 Mon Sep 17 00:00:00 2001
     2From: Tomas Volf <~@wolfsden.cz>
     3Date: Mon, 2 Sep 2024 14:10:45 +0200
     4Subject: [PATCH] help: Support empty PAGER.
     5
     6* awscli/help.py (PosixHelpRenderer._send_output_to_pager): Support empty PAGER.
     7---
     8 awscli/help.py | 7 ++++---
     9 1 file changed, 4 insertions(+), 3 deletions(-)
     10
     11diff --git a/awscli/help.py b/awscli/help.py
     12index 1ce8571f3..c139a09bd 100644
     13--- a/awscli/help.py
     14+++ b/awscli/help.py
     15@@ -134,9 +134,10 @@ class PosixHelpRenderer(PagingHelpRenderer):
     16 
     17     def _send_output_to_pager(self, output):
     18         cmdline = self.get_pager_cmdline()
     19-        if not self._exists_on_path(cmdline[0]):
     20-            LOG.debug("Pager '%s' not found in PATH, printing raw help." %
     21-                      cmdline[0])
     22+        if not (cmdline and self._exists_on_path(cmdline[0])):
     23+            LOG.debug(
     24+                "Pager '%s' not found in PATH, printing raw help.",
     25+                cmdline[0] if cmdline else "<empty>")
     26             self.output_stream.write(output.decode('utf-8') + "\n")
     27             self.output_stream.flush()
     28             return
     29--
     302.46.0
     31