[patch] fix to make _stringToVersion match rpm's parseEVR behavior
Christoph Thiel <[email protected]>
| Newsgroups | gmane.linux.rpm.metadata |
|---|---|
| Message-ID | <[email protected]> |
Hi there, while looking into one of our bugs, I found that createrepo's _stringToVersion didn't match rpm's parseEVR. Please find the patch attached. Best, Christoph _______________________________________________ Rpm-metadata mailing list [email protected] https://lists.dulug.duke.edu/mailman/listinfo/rpm-metadata
createrepo-EVR.patch
(text/x-patch, 453 B)
--- dumpMetadata.py
+++ dumpMetadata.py
@@ -321,11 +321,12 @@
def _stringToVersion(self, strng):
i = strng.find(':')
- if i != -1:
+ if i != -1 and strng[:i].isdigit():
epoch = strng[:i]
else:
+ i = -1
epoch = self.noepoch
- j = strng.find('-')
+ j = strng.rfind('-')
if j != -1:
if strng[i + 1:j] == '':
version = None