commit:     bf5e888dc8750035086b4e51358335f1d4ade924
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 14 01:21:10 2021 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Thu Jan 14 01:23:23 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bf5e888d

kde-frameworks/syntax-highlighting: Fix another bash/zsh syntax bug

See also: https://invent.kde.org/frameworks/syntax-highlighting/-/issues/5

Reported-by: Toralf Förster <toralf <AT> gentoo.org>
Package-Manager: Portage-3.0.13, Repoman-3.0.2
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../syntax-highlighting-5.77.0-bash-zsh-fix.patch  | 122 +++++++++++++++++++++
 ...ntax-highlighting-5.77.0-bash-zsh-version.patch |  39 +++++++
 .../syntax-highlighting-5.77.0-r2.ebuild           |  37 +++++++
 .../syntax-highlighting-5.78.0-r1.ebuild           |  33 ++++++
 4 files changed, 231 insertions(+)

diff --git 
a/kde-frameworks/syntax-highlighting/files/syntax-highlighting-5.77.0-bash-zsh-fix.patch
 
b/kde-frameworks/syntax-highlighting/files/syntax-highlighting-5.77.0-bash-zsh-fix.patch
new file mode 100644
index 00000000000..2ec92edb9c8
--- /dev/null
+++ 
b/kde-frameworks/syntax-highlighting/files/syntax-highlighting-5.77.0-bash-zsh-fix.patch
@@ -0,0 +1,122 @@
+From ba9b3c5e0ed2fb33b9a896ec910590410978befe Mon Sep 17 00:00:00 2001
+From: Jonathan Poelen <[email protected]>
+Date: Mon, 11 Jan 2021 01:29:01 +0100
+Subject: [PATCH] Bash: fix #5: $ at the end of a double quoted string
+
+---
+ autotests/folding/highlight.sh.fold   | 1 +
+ autotests/html/highlight.sh.dark.html | 1 +
+ autotests/html/highlight.sh.html      | 1 +
+ autotests/input/highlight.sh          | 1 +
+ autotests/reference/highlight.sh.ref  | 1 +
+ data/syntax/bash.xml                  | 5 +++--
+ data/syntax/zsh.xml                   | 3 +--
+ 7 files changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/autotests/folding/highlight.sh.fold 
b/autotests/folding/highlight.sh.fold
+index 652fef8f..d7a6b210 100644
+--- a/autotests/folding/highlight.sh.fold
++++ b/autotests/folding/highlight.sh.fold
+@@ -16,6 +16,7 @@ echo 'single quoted string'
+ echo "double quoted string"
+ echo $'string with esc\apes\x0din it'
+ echo $"string meant to be translated"
++echo "$"
+ 
+ 
+ # comments:
+diff --git a/autotests/html/highlight.sh.dark.html 
b/autotests/html/highlight.sh.dark.html
+index d1d4fb8a..8cbd0929 100644
+--- a/autotests/html/highlight.sh.dark.html
++++ b/autotests/html/highlight.sh.dark.html
+@@ -22,6 +22,7 @@
+ <span style="color:#7f8c8d;">echo</span> <span 
style="color:#f44f4f;">&quot;double quoted string&quot;</span>
+ <span style="color:#7f8c8d;">echo</span> <span 
style="color:#f44f4f;">$'string with esc</span><span 
style="color:#2980b9;">\a</span><span style="color:#f44f4f;">pes</span><span 
style="color:#2980b9;">\x0d</span><span style="color:#f44f4f;">in it'</span>
+ <span style="color:#7f8c8d;">echo</span> <span 
style="color:#f44f4f;">$&quot;</span><span style="color:#f44f4f;">string meant 
to be translated&quot;</span>
++<span style="color:#7f8c8d;">echo</span> <span 
style="color:#f44f4f;">&quot;$&quot;</span>
+ 
+ 
+ <span style="color:#7a7c7d;"># comments:</span>
+diff --git a/autotests/html/highlight.sh.html 
b/autotests/html/highlight.sh.html
+index 5d687d86..d176b1cb 100644
+--- a/autotests/html/highlight.sh.html
++++ b/autotests/html/highlight.sh.html
+@@ -22,6 +22,7 @@
+ <span style="color:#644a9b;font-weight:bold;">echo</span> <span 
style="color:#bf0303;">&quot;double quoted string&quot;</span>
+ <span style="color:#644a9b;font-weight:bold;">echo</span> <span 
style="color:#bf0303;">$'string with esc</span><span 
style="color:#0057ae;">\a</span><span style="color:#bf0303;">pes</span><span 
style="color:#0057ae;">\x0d</span><span style="color:#bf0303;">in it'</span>
+ <span style="color:#644a9b;font-weight:bold;">echo</span> <span 
style="color:#bf0303;">$&quot;</span><span style="color:#bf0303;">string meant 
to be translated&quot;</span>
++<span style="color:#644a9b;font-weight:bold;">echo</span> <span 
style="color:#bf0303;">&quot;$&quot;</span>
+ 
+ 
+ <span style="color:#898887;"># comments:</span>
+diff --git a/autotests/input/highlight.sh b/autotests/input/highlight.sh
+index 177e104f..5c2ae7b1 100644
+--- a/autotests/input/highlight.sh
++++ b/autotests/input/highlight.sh
+@@ -16,6 +16,7 @@ echo 'single quoted string'
+ echo "double quoted string"
+ echo $'string with esc\apes\x0din it'
+ echo $"string meant to be translated"
++echo "$"
+ 
+ 
+ # comments:
+diff --git a/autotests/reference/highlight.sh.ref 
b/autotests/reference/highlight.sh.ref
+index 181c36af..edaf18ab 100644
+--- a/autotests/reference/highlight.sh.ref
++++ b/autotests/reference/highlight.sh.ref
+@@ -16,6 +16,7 @@
+ <Builtin>echo</Builtin><Normal Text> </Normal Text><String DoubleQ>"double 
quoted string"</String DoubleQ><br/>
+ <Builtin>echo</Builtin><Normal Text> </Normal Text><String SingleQ>$'string 
with esc</String SingleQ><String Escape>\a</String Escape><String 
SingleQ>pes</String SingleQ><String Escape>\x0d</String Escape><String 
SingleQ>in it'</String SingleQ><br/>
+ <Builtin>echo</Builtin><Normal Text> </Normal Text><String Transl.>$"</String 
Transl.><String DoubleQ>string meant to be translated"</String DoubleQ><br/>
++<Builtin>echo</Builtin><Normal Text> </Normal Text><String 
DoubleQ>"$"</String DoubleQ><br/>
+ <Normal Text></Normal Text><br/>
+ <Normal Text></Normal Text><br/>
+ <Comment># comments:</Comment><br/>
+diff --git a/data/syntax/bash.xml b/data/syntax/bash.xml
+index 3171247b..3b804f90 100644
+--- a/data/syntax/bash.xml
++++ b/data/syntax/bash.xml
+@@ -30,7 +30,7 @@
+         <!ENTITY heredocq 
"(?|&quot;([^&quot;]+)&quot;|'([^']+)'|\\(.[^&wordseps;&substseps;]*))">
+ ]>
+ 
+-<language name="Bash" version="20" kateversion="5.62" section="Scripts" 
extensions="*.sh;*.bash;*.ebuild;*.eclass;*.nix;.bashrc;.bash_profile;.bash_login;.profile;PKGBUILD;APKBUILD"
 mimetype="application/x-shellscript" casesensitive="1" author="Wilbert 
Berendsen ([email protected])" license="LGPL">
++<language name="Bash" version="21" kateversion="5.62" section="Scripts" 
extensions="*.sh;*.bash;*.ebuild;*.eclass;*.nix;.bashrc;.bash_profile;.bash_login;.profile;PKGBUILD;APKBUILD"
 mimetype="application/x-shellscript" casesensitive="1" author="Wilbert 
Berendsen ([email protected])" license="LGPL">
+ 
+ <!-- (c) 2004 by Wilbert Berendsen ([email protected])
+     Changes by Matthew Woehlke ([email protected])
+@@ -943,7 +943,8 @@
+         <DetectChar attribute="Backquote" context="RegularBackq" char="`"/>
+       </context>
+       <context attribute="String DoubleQ" lineEndContext="#stay" 
name="StringDQDispatchVariables">
+-        <IncludeRules context="DispatchVariables"/>
++        <IncludeRules context="DispatchSubstVariables"/>
++        <IncludeRules context="DispatchVarnameVariables"/>
+         <DetectChar attribute="String DoubleQ" context="#pop" char="$"/>
+       </context>
+       <context attribute="String DoubleQ" lineEndContext="#pop" 
name="StringDQEscape">
+diff --git a/data/syntax/zsh.xml b/data/syntax/zsh.xml
+index ada258c8..5aa83290 100644
+--- a/data/syntax/zsh.xml
++++ b/data/syntax/zsh.xml
+@@ -55,7 +55,7 @@
+         <!ENTITY int "(?:[0-9]++(_++[0-9]++)*+)">
+         <!ENTITY exp "(?:[eE][-+]?&int;)">
+ ]>
+-<language name="Zsh" version="12" kateversion="5.62" section="Scripts" 
extensions="*.sh;*.zsh;.zshrc;.zprofile;.zlogin;.zlogout;.profile" 
mimetype="application/x-shellscript" casesensitive="1" author="Jonathan Poelen 
([email protected])" license="MIT">
++<language name="Zsh" version="13" kateversion="5.62" section="Scripts" 
extensions="*.sh;*.zsh;.zshrc;.zprofile;.zlogin;.zlogout;.profile" 
mimetype="application/x-shellscript" casesensitive="1" author="Jonathan Poelen 
([email protected])" license="MIT">
+ 
+   <highlighting>
+     <list name="keywords">
+@@ -893,7 +893,6 @@
+       </context>
+       <context attribute="String DoubleQ" lineEndContext="#stay" 
name="StringDQDispatchVariables">
+         <IncludeRules context="DispatchSubstVariables"/>
+-        <Detect2Chars attribute="String SingleQ" context="#pop!StringEsc" 
char="$" char1="'"/>
+         <IncludeRules context="DispatchVarNameVariables"/>
+         <DetectChar attribute="String DoubleQ" context="#pop" char="$"/>
+       </context>
+-- 
+GitLab
+

diff --git 
a/kde-frameworks/syntax-highlighting/files/syntax-highlighting-5.77.0-bash-zsh-version.patch
 
b/kde-frameworks/syntax-highlighting/files/syntax-highlighting-5.77.0-bash-zsh-version.patch
new file mode 100644
index 00000000000..2a7f2684bfb
--- /dev/null
+++ 
b/kde-frameworks/syntax-highlighting/files/syntax-highlighting-5.77.0-bash-zsh-version.patch
@@ -0,0 +1,39 @@
+From 70b56cf8b3d1a85e15d1e09aa8490e5183967de0 Mon Sep 17 00:00:00 2001
+From: Christoph Cullmann <[email protected]>
+Date: Wed, 30 Dec 2020 17:35:48 +0100
+Subject: [PATCH] increment version
+
+---
+ data/syntax/bash.xml | 2 +-
+ data/syntax/zsh.xml  | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/data/syntax/bash.xml b/data/syntax/bash.xml
+index 676b630d..3171247b 100644
+--- a/data/syntax/bash.xml
++++ b/data/syntax/bash.xml
+@@ -30,7 +30,7 @@
+         <!ENTITY heredocq 
"(?|&quot;([^&quot;]+)&quot;|'([^']+)'|\\(.[^&wordseps;&substseps;]*))">
+ ]>
+ 
+-<language name="Bash" version="19" kateversion="5.62" section="Scripts" 
extensions="*.sh;*.bash;*.ebuild;*.eclass;*.nix;.bashrc;.bash_profile;.bash_login;.profile;PKGBUILD;APKBUILD"
 mimetype="application/x-shellscript" casesensitive="1" author="Wilbert 
Berendsen ([email protected])" license="LGPL">
++<language name="Bash" version="20" kateversion="5.62" section="Scripts" 
extensions="*.sh;*.bash;*.ebuild;*.eclass;*.nix;.bashrc;.bash_profile;.bash_login;.profile;PKGBUILD;APKBUILD"
 mimetype="application/x-shellscript" casesensitive="1" author="Wilbert 
Berendsen ([email protected])" license="LGPL">
+ 
+ <!-- (c) 2004 by Wilbert Berendsen ([email protected])
+     Changes by Matthew Woehlke ([email protected])
+diff --git a/data/syntax/zsh.xml b/data/syntax/zsh.xml
+index 120b345e..ada258c8 100644
+--- a/data/syntax/zsh.xml
++++ b/data/syntax/zsh.xml
+@@ -55,7 +55,7 @@
+         <!ENTITY int "(?:[0-9]++(_++[0-9]++)*+)">
+         <!ENTITY exp "(?:[eE][-+]?&int;)">
+ ]>
+-<language name="Zsh" version="11" kateversion="5.62" section="Scripts" 
extensions="*.sh;*.zsh;.zshrc;.zprofile;.zlogin;.zlogout;.profile" 
mimetype="application/x-shellscript" casesensitive="1" author="Jonathan Poelen 
([email protected])" license="MIT">
++<language name="Zsh" version="12" kateversion="5.62" section="Scripts" 
extensions="*.sh;*.zsh;.zshrc;.zprofile;.zlogin;.zlogout;.profile" 
mimetype="application/x-shellscript" casesensitive="1" author="Jonathan Poelen 
([email protected])" license="MIT">
+ 
+   <highlighting>
+     <list name="keywords">
+-- 
+2.30.0
+

diff --git 
a/kde-frameworks/syntax-highlighting/syntax-highlighting-5.77.0-r2.ebuild 
b/kde-frameworks/syntax-highlighting/syntax-highlighting-5.77.0-r2.ebuild
new file mode 100644
index 00000000000..3d8083137a2
--- /dev/null
+++ b/kde-frameworks/syntax-highlighting/syntax-highlighting-5.77.0-r2.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+ECM_TEST="forceoptional"
+QTMIN=5.15.1
+inherit ecm kde.org
+
+DESCRIPTION="Framework for syntax highlighting"
+SRC_URI+=" 
https://dev.gentoo.org/~asturm/distfiles/${P}-bash-zsh-fixes.patch.xz";
+
+LICENSE="MIT"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
+IUSE="nls"
+
+BDEPEND="
+       dev-lang/perl
+       nls? ( >=dev-qt/linguist-tools-${QTMIN}:5 )
+"
+DEPEND="
+       >=dev-qt/qtgui-${QTMIN}:5
+       >=dev-qt/qtnetwork-${QTMIN}:5
+       >=dev-qt/qtxmlpatterns-${QTMIN}:5
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+       "${WORKDIR}"/${P}-bash-zsh-fixes.patch
+       "${FILESDIR}"/${PN}-5.77.0-bash-zsh-version.patch
+       "${FILESDIR}"/${PN}-5.77.0-bash-zsh-fix.patch
+)
+
+src_install() {
+       ecm_src_install
+       dobin "${BUILD_DIR}"/bin/katehighlightingindexer
+}

diff --git 
a/kde-frameworks/syntax-highlighting/syntax-highlighting-5.78.0-r1.ebuild 
b/kde-frameworks/syntax-highlighting/syntax-highlighting-5.78.0-r1.ebuild
new file mode 100644
index 00000000000..4dabf263ae7
--- /dev/null
+++ b/kde-frameworks/syntax-highlighting/syntax-highlighting-5.78.0-r1.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+ECM_TEST="forceoptional"
+QTMIN=5.15.1
+inherit ecm kde.org
+
+DESCRIPTION="Framework for syntax highlighting"
+LICENSE="MIT"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
+IUSE="nls"
+
+BDEPEND="
+       dev-lang/perl
+       nls? ( >=dev-qt/linguist-tools-${QTMIN}:5 )
+"
+DEPEND="
+       >=dev-qt/qtgui-${QTMIN}:5
+       >=dev-qt/qtnetwork-${QTMIN}:5
+       >=dev-qt/qtxmlpatterns-${QTMIN}:5
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-5.77.0-bash-zsh-fix.patch
+)
+
+src_install() {
+       ecm_src_install
+       dobin "${BUILD_DIR}"/bin/katehighlightingindexer
+}

Reply via email to