-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
it seems that the work marked as todo could bite people encountering an epoch >0
with current code , it seems to alway go to 0 even if with rocky 8 /el8 we ecounter a package like mod_ssl that has epcoh to 1.
# For some reason `nevra.release` contains also the architecture
return "{N}-{E}:{V}-{RA}".format(N=nevra.name, E=nevra.epoch or 0,
V=nevra.version, RA=nevra.release)
fix would be something like
# diff -Nur /usr/lib/python3.6/site-packages/dir2module/dir2module.py.ori /usr/lib/python3.6/site-packages/dir2module/dir2module.py
--- /usr/lib/python3.6/site-packages/dir2module/dir2module.py.ori 2025-01-30 04:23:57.028125116 +0100
+++ /usr/lib/python3.6/site-packages/dir2module/dir2module.py 2025-01-30 04:32:01.371964924 +0100
@@ -172,7 +172,13 @@
if not filename.endswith(".rpm"):
raise ValueError("File name doesn't end with '.rpm': {}".format(self.path))
- # @TODO: construct NEVRA from rpm header
+ # @TODO: construct NEVRA from rpm header DONE
+ fdno = os.open(self.path, os.O_RDONLY)
+ ts = rpm.ts()
+ hdr = ts.hdrFromFdno(fdno)
+ os.close(fdno)
+ return "{N}-{E}:{V}-{R}.{A}".format(N=hdr[rpm.RPMTAG_NAME] , E=hdr[rpm.RPMTAG_EPOCH] or 0,
+ V=hdr[rpm.RPMTAG_VERSION] , R=hdr[rpm.RPMTAG_RELEASE], A=hdr[rpm.RPMTAG_ARCH] )
subject = Subject(filename)
nevras = subject.get_nevra_possibilities(forms=[hawkey.FORM_NEVRA])
for nevra in nevras:
Metadata
Metadata
Assignees
Labels
No labels