Closed LeonidVas closed 2 years ago
Possible patch
From: Leonid Vasiliev <lvasiliev@tarantool.org>
Date: Tue, 11 Jan 2022 16:17:56 +0300
Subject: [PATCH] fix something
Cc: tarantool-patches@dev.tarantool.org
---
rpmrepo.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/rpmrepo.py b/rpmrepo.py
index a459c17..1cfd7af 100755
--- a/rpmrepo.py
+++ b/rpmrepo.py
@@ -492,6 +492,9 @@ def dump_primary(primary):
res += ' <rpm:provides>\n'
+ print("----------------------------------------------")
+ print(fmt['provides'])
+ print("----------------------------------------------")
for key in sorted(fmt['provides']):
provides = fmt['provides'][key]
entry = ['name="%s"' % provides['name']]
@@ -547,7 +550,7 @@ def parse_ver_str(ver_str):
raise RuntimeError("Can't parse version: '%s'" % ver_str)
epoch = match.group(1)[:-1] if match.group(1) else "0"
ver = match.group(2)
- rel = match.group(3)[1:] if match.group(3) else None
+ rel = match.group(3)[1:] if match.group(3) else ""
return epoch, ver, rel
--
2.36.0
Looks like the fix works fine. I didn't see any issues with using ''
instead of None
. I will open a PR with this fix.
As I sad I didn't see any issues with using ''
, sync process is OK, but looking at the code I can see some logic for None
values. Now I am not sure that using ''
is a proper way to fix the bug because ''
breaks the logic for None
values. Looks like we just need to sort items in a safe way, for example, sort by the first element of the key (it is a package name, the key itself is a tuple), not by the whole key.
for key in sorted(fmt['provides'], key=lambda x: x[0]):
...
Actually, I don't mind. But I have a few questions/thoughts:
release
as an empty string is more correct (maybe not).None
is the right way to go.
The tarantool repositories specific bug. It is assumed that the problem will be fixed by the tarantool team with access to the repository.