1 Star 0 Fork 29

starlet_dx/flatpak

forked from src-openEuler/flatpak 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-support-new-pyparsing.patch 1.89 KB
一键复制 编辑 原始数据 按行查看 历史
From 8850e4d0da76a85c5f9926cd40e148e0b29bddac Mon Sep 17 00:00:00 2001
From: Phaedrus Leeds <[email protected]>
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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/starlet-dx/flatpak.git
[email protected]:starlet-dx/flatpak.git
starlet-dx
flatpak
flatpak
master

搜索帮助