summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Sakoman <steve@sakoman.com>2022-01-07 04:24:13 -1000
committerMartin Jansa <Martin.Jansa@gmail.com>2022-04-15 11:12:53 +0200
commit9da138f4eb02c375414c921444d23b6236a9d935 (patch)
tree267950c341ff6ba7d163655ba5341086d06225af
parent1399d6c200c6f21fd2476e7524062b0c95e24f4b (diff)
downloadopenembedded-core-contrib-9da138f4eb02c375414c921444d23b6236a9d935.tar.gz
asciidoc: properly detect and compare Python versions >= 3.10
asciidoc.py cannot properly detect versions of Python >= 3.10 Backport patch from upstream to correct this: https://github.com/asciidoc-py/asciidoc-py/commit/44d2d6095246124c024230f89c1029794491839f Fixed upstream in version 9.04, so this patch is not required in master. Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/recipes-extended/asciidoc/asciidoc/detect-python-version.patch41
-rw-r--r--meta/recipes-extended/asciidoc/asciidoc_9.0.2.bb3
2 files changed, 43 insertions, 1 deletions
diff --git a/meta/recipes-extended/asciidoc/asciidoc/detect-python-version.patch b/meta/recipes-extended/asciidoc/asciidoc/detect-python-version.patch
new file mode 100644
index 0000000000..ce96f0ac69
--- /dev/null
+++ b/meta/recipes-extended/asciidoc/asciidoc/detect-python-version.patch
@@ -0,0 +1,41 @@
+From 74855dc24921a08ee654896b4c8a75cc3d029032 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
+Date: Fri, 30 Oct 2020 15:10:35 +0100
+Subject: [PATCH] Properly detect and compare Python version 3.10+ (#151)
+
+Upstream commit: https://github.com/asciidoc-py/asciidoc-py/commit/44d2d6095246124c024230f89c1029794491839f
+
+Slightly modified to cleanly apply to asciidoc 8.6.9:
+- VERSION and MIN_PYTHON_VERSION changed to reflect values in 8.6.9
+- line numbers corrected to eliminate offset warnings
+
+Upstream-Status: Backport
+Signed-off-by: Steve Sakoman <steve@sakoman.com>
+---
+ asciidoc.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/asciidoc.py b/asciidoc.py
+index 14641e9d..76a16c35 100755
+--- a/asciidoc.py
++++ b/asciidoc.py
+@@ -35,7 +35,7 @@ from collections import OrderedDict
+ # Used by asciidocapi.py #
+ VERSION = '9.0.2' # See CHANGELOG file for version history.
+
+-MIN_PYTHON_VERSION = '3.5' # Require this version of Python or better.
++MIN_PYTHON_VERSION = (3, 5) # Require this version of Python or better.
+
+ # ---------------------------------------------------------------------------
+ # Program constants.
+@@ -4719,8 +4719,8 @@ class Config:
+ directory.
+ cmd is the asciidoc command or asciidoc.py path.
+ """
+- if float(sys.version[:3]) < float(MIN_PYTHON_VERSION):
+- message.stderr('FAILED: Python %s or better required' % MIN_PYTHON_VERSION)
++ if sys.version_info[:2] < MIN_PYTHON_VERSION:
++ message.stderr('FAILED: Python %d.%d or better required' % MIN_PYTHON_VERSION)
+ sys.exit(1)
+ if not os.path.exists(cmd):
+ message.stderr('FAILED: Missing asciidoc command: %s' % cmd)
diff --git a/meta/recipes-extended/asciidoc/asciidoc_9.0.2.bb b/meta/recipes-extended/asciidoc/asciidoc_9.0.2.bb
index 5fd3832ef9..1dd8ce7ee0 100644
--- a/meta/recipes-extended/asciidoc/asciidoc_9.0.2.bb
+++ b/meta/recipes-extended/asciidoc/asciidoc_9.0.2.bb
@@ -9,7 +9,8 @@ LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=4e5d1baf6f20559e3bec172226a47e4e \
file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263 "
SRC_URI = "git://github.com/asciidoc/asciidoc-py3;protocol=https;branch=main \
- file://auto-catalogs.patch"
+ file://auto-catalogs.patch \
+ file://detect-python-version.patch"
SRCREV = "9a407dc9a497364c91421fd961954eddb565baf1"
DEPENDS = "libxml2-native libxslt-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"