From c8ae52aa42927ff1bd5d48124cab4f7412b07fcd Mon Sep 17 00:00:00 2001 From: shirely16 Date: Tue, 25 Jan 2022 11:36:00 +0800 Subject: [PATCH] Fix compiler error when using pyparsing >= 3.0.2 --- backport-support-new-pyparsing.patch | 48 ++++++++++++++++++++++++++++ flatpak.spec | 6 +++- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 backport-support-new-pyparsing.patch diff --git a/backport-support-new-pyparsing.patch b/backport-support-new-pyparsing.patch new file mode 100644 index 0000000..ed1f8c9 --- /dev/null +++ b/backport-support-new-pyparsing.patch @@ -0,0 +1,48 @@ +From 8850e4d0da76a85c5f9926cd40e148e0b29bddac Mon Sep 17 00:00:00 2001 +From: Phaedrus Leeds +Date: Thu, 16 Dec 2021 10:50:10 -0800 +Subject: [PATCH] Fix runtime error when using pyparsing >= 3.0.2 + +Ever since this commit +(https://github.com/pyparsing/pyparsing/commit/4ab17bb55) +variant-schema-compiler has failed to execute when used by Flatpak like +this: +$ variant-schema-compiler/variant-schema-compiler --outfile-header +common/flatpak-variant-private.h --outfile +common/flatpak-variant-impl-private.h --prefix var +./data/flatpak-variants.gv + +For some reason our use of leaveWhitespace() to ensure that a named type +has a ' right before its name no longer works. But fortunately pyparsing +has a Combine() which does exactly what we want. + +See https://github.com/flatpak/flatpak/issues/4534 + +Fixes https://gitlab.gnome.org/alexl/variant-schema-compiler/-/issues/4 + +Reference:https://gitlab.gnome.org/alexl/variant-schema-compiler/-/commit/8850e4d0da76a85c5f9926cd40e148e0b29bddac + +diff --git a/variant-schema-compiler/variant-schema-compiler b/variant-schema-compiler/variant-schema-compiler +index 8b54232..7807f7c 100755 +--- a/variant-schema-compiler/variant-schema-compiler ++++ b/variant-schema-compiler/variant-schema-compiler +@@ -4,6 +4,7 @@ import argparse + import sys + import os + from pyparsing import * ++pyparsing_version = tuple(int(x) for x in __version__.split('.')) + + typename_prefix = "" + funcname_prefix = "" +@@ -1741,6 +1742,8 @@ def handleNameableType(toks): + return type + + nameableType = (Optional((Suppress("'") + ident).leaveWhitespace()) + (arrayType ^ maybeType ^ dictType ^ structType)).setParseAction(handleNameableType) ++if pyparsing_version >= (3, 0, 4): ++ nameableType = (Optional((Suppress("'") + ident)) + (arrayType ^ maybeType ^ dictType ^ structType)).setParseAction(handleNameableType) + + typeSpec <<= basicType ^ variantType ^ namedType ^ nameableType + +-- +2.30.0 + diff --git a/flatpak.spec b/flatpak.spec index 335022b..91d6fe2 100644 --- a/flatpak.spec +++ b/flatpak.spec @@ -1,6 +1,6 @@ Name: flatpak Version: 1.10.2 -Release: 2 +Release: 3 Summary: Application deployment framework for desktop apps License: LGPLv2+ URL: http://flatpak.org/ @@ -19,6 +19,7 @@ Patch6006: backport-0007-CVE-2021-41133.patch Patch6007: backport-0008-CVE-2021-41133.patch Patch6008: backport-run-Handle-unknown-syscalls-as-intended.patch Patch6009: backport-Fix-handling-of-syscalls-only-allowed-by-de.patch +Patch6010: backport-support-new-pyparsing.patch BuildRequires: pkgconfig(appstream-glib) pkgconfig(gio-unix-2.0) pkgconfig(gobject-introspection-1.0) >= 1.40.0 pkgconfig(json-glib-1.0) pkgconfig(libarchive) >= 2.8.0 BuildRequires: pkgconfig(libsoup-2.4) pkgconfig(libxml-2.0) >= 2.4 pkgconfig(ostree-1) >= 2020.8 pkgconfig(polkit-gobject-1) pkgconfig(libseccomp) pkgconfig(xau) @@ -124,6 +125,9 @@ flatpak remote-list --system &> /dev/null || : %{_mandir}/man5/flatpak-remote.5* %changelog +* Tue Jan 25 2022 hanhui - 1.10.2-3 +- Fix compiler error when using pyparsing >= 3.0.2 + * Thu Oct 21 2021 xingxing - 1.10.2-2 - Fix CVE-2021-41133 -- Gitee