Avoid verbatim bidi formatting characters in source comments to make rpminspect complain less

Resolves: RHEL-2237
This commit is contained in:
Mike FABIAN 2023-10-09 17:53:40 +02:00
parent ef82f087d0
commit d01e950b76
2 changed files with 58 additions and 3 deletions

View File

@ -0,0 +1,48 @@
diff -ru ibus-typing-booster-2.1.0.orig/engine/itb_util.py ibus-typing-booster-2.1.0/engine/itb_util.py
--- ibus-typing-booster-2.1.0.orig/engine/itb_util.py 2018-07-24 08:43:58.000000000 +0200
+++ ibus-typing-booster-2.1.0/engine/itb_util.py 2023-10-09 18:24:53.617131025 +0200
@@ -1757,6 +1757,9 @@
TR9> and its matching PDI or, if it has no matching PDI, the end of the
TR9> paragraph
+ U+2069 POP DIRECTIONAL ISOLATE
+ U+2068 FIRST STRONG ISOLATE
+
Examples:
>>> is_right_to_left('Hallo!')
@@ -1765,16 +1768,16 @@
>>> is_right_to_left('﷼')
True
- >>> is_right_to_left('⁨﷼⁩')
+ >>> is_right_to_left('\u2068﷼\u2069')
False
- >>> is_right_to_left('⁨﷼⁩﷼')
+ >>> is_right_to_left('\u2068﷼\u2069﷼')
True
- >>> is_right_to_left('a﷼')
+ >>> is_right_to_left('a\u2068﷼\u2069﷼')
False
- >>> is_right_to_left('a﷼')
+ >>> is_right_to_left('\u2068a\u2069\u2068﷼\u2069﷼')
True
'''
skip = False
@@ -1806,10 +1809,10 @@
Examples:
>>> bidi_embed('a')
- 'a'
+ '\u202Aa\u202C'
>>> bidi_embed('﷼')
- '‫﷼‬'
+ '\u202B﷼\u202C'
'''
if is_right_to_left(text):
return chr(0x202B) + text + chr(0x202C) # RLE + text + PDF
ibus-typing-booster-2.1.0/engine のみに存在: itb_util.py.orig

View File

@ -1,6 +1,6 @@
Name: ibus-typing-booster
Version: 2.1.0
Release: 6%{?dist}
Release: 7%{?dist}
Summary: A completion input method
License: GPLv3+
Group: System Environment/Libraries
@ -8,6 +8,7 @@ URL: https://mike-fabian.github.io/ibus-typing-booster/
Source0: https://github.com/mike-fabian/ibus-typing-booster/releases/download/%{version}/ibus-typing-booster-%{version}.tar.gz
Patch0: gating.patch
Patch1: Prevent-also-BackSpace-from-reopening-a-preedit-when.patch
Patch2: avoid-verbatim-bidi-formatting-characters-in-the-source.patch
Requires: ibus >= 1.5.3
Requires: m17n-lib
%{?__python3:Requires: %{__python3}}
@ -79,8 +80,9 @@ Unicode symbols.
%prep
%setup -q
%patch0 -p1 -b .gating
%patch1 -p1 -b .backspace
%patch -P 0 -p1 -b .gating
%patch -P 1 -p1 -b .backspace
%patch -P 2 -p1 -b .avoid-bidi-formatting-characters-in-source
%build
export PYTHON=%{__python3}
@ -198,6 +200,11 @@ make check || cat ./tests/test-suite.log
%changelog
* Mon Oct 09 2023 Mike FABIAN <mfabian@redhat.com> - 2.1.0-7
- Avoid verbatim bidi formatting characters in source comments
to make rpminspect complain less.
- Resolves: RHEL-2237
* Tue Sep 19 2023 Lumír Balhar <lbalhar@redhat.com> - 2.1.0-6
- Fix requirements of Python 3
- Resolves: RHEL-2237