-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* patches * fix * Update recipes/glib/all/conanfile.py Co-authored-by: Abril Rincón Blanco <git@rinconblanco.es> --------- Co-authored-by: Luis Caro Campos <3535649+jcar87@users.noreply.github.com> Co-authored-by: Abril Rincón Blanco <git@rinconblanco.es>
- Loading branch information
1 parent
7b5bbf2
commit 025b78a
Showing
4 changed files
with
146 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
diff --git a/gio/gdbus-2.0/codegen/utils.py b/gio/gdbus-2.0/codegen/utils.py | ||
index 0204610..f8d758c 100644 | ||
--- a/gio/gdbus-2.0/codegen/utils.py | ||
+++ b/gio/gdbus-2.0/codegen/utils.py | ||
@@ -19,7 +19,7 @@ | ||
# | ||
# Author: David Zeuthen <davidz@redhat.com> | ||
|
||
-import distutils.version | ||
+import re | ||
import os | ||
import sys | ||
|
||
@@ -159,11 +159,35 @@ def lookup_brief_docs(annotations): | ||
def version_cmp_key(key): | ||
# If the 'since' version is 'UNRELEASED', compare higher than anything else | ||
# If it is empty put a 0 in its place as this will | ||
- # allow LooseVersion to work and will always compare lower. | ||
+ # allow _parse_version() to work and will always compare lower. | ||
if key[0] == "UNRELEASED": | ||
v = "9999" | ||
elif key[0]: | ||
v = str(key[0]) | ||
else: | ||
v = "0" | ||
- return (distutils.version.LooseVersion(v), key[1]) | ||
+ return (_parse_version(v), key[1]) | ||
+ | ||
+ | ||
+def _parse_version(version): | ||
+ """ | ||
+ Parse a version string into a list of integers and strings. | ||
+ | ||
+ This function takes a version string and breaks it down into its component parts. | ||
+ It separates numeric and non-numeric segments, converting numeric segments to integers. | ||
+ | ||
+ Args: | ||
+ version (str): The version string to parse. | ||
+ | ||
+ Returns: | ||
+ list: A list where each element is either an integer (for numeric parts) | ||
+ or a string (for non-numeric parts). | ||
+ | ||
+ Example: | ||
+ >>> parseversion("1.2.3a") | ||
+ [1, 2, 3, 'a'] | ||
+ >>> parseversion("2.0.0-rc1") | ||
+ [2, 0, 0, 'rc1'] | ||
+ """ | ||
+ blocks = re.findall(r"(\d+|\w+)", version) | ||
+ return [int(b) if b.isdigit() else b for b in blocks] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
diff --git a/gio/gdbus-2.0/codegen/utils.py b/gio/gdbus-2.0/codegen/utils.py | ||
index 95559d3..2b7a176 100644 | ||
--- a/gio/gdbus-2.0/codegen/utils.py | ||
+++ b/gio/gdbus-2.0/codegen/utils.py | ||
@@ -19,7 +19,7 @@ | ||
# | ||
# Author: David Zeuthen <davidz@redhat.com> | ||
|
||
-import distutils.version | ||
+import re | ||
import os | ||
import sys | ||
|
||
@@ -155,11 +155,35 @@ def lookup_brief_docs(annotations): | ||
def version_cmp_key(key): | ||
# If the 'since' version is 'UNRELEASED', compare higher than anything else | ||
# If it is empty put a 0 in its place as this will | ||
- # allow LooseVersion to work and will always compare lower. | ||
+ # allow _parse_version() to work and will always compare lower. | ||
if key[0] == "UNRELEASED": | ||
v = "9999" | ||
elif key[0]: | ||
v = str(key[0]) | ||
else: | ||
v = "0" | ||
- return (distutils.version.LooseVersion(v), key[1]) | ||
+ return (_parse_version(v), key[1]) | ||
+ | ||
+ | ||
+def _parse_version(version): | ||
+ """ | ||
+ Parse a version string into a list of integers and strings. | ||
+ | ||
+ This function takes a version string and breaks it down into its component parts. | ||
+ It separates numeric and non-numeric segments, converting numeric segments to integers. | ||
+ | ||
+ Args: | ||
+ version (str): The version string to parse. | ||
+ | ||
+ Returns: | ||
+ list: A list where each element is either an integer (for numeric parts) | ||
+ or a string (for non-numeric parts). | ||
+ | ||
+ Example: | ||
+ >>> parseversion("1.2.3a") | ||
+ [1, 2, 3, 'a'] | ||
+ >>> parseversion("2.0.0-rc1") | ||
+ [2, 0, 0, 'rc1'] | ||
+ """ | ||
+ blocks = re.findall(r"(\d+|\w+)", version) | ||
+ return [int(b) if b.isdigit() else b for b in blocks] |