[Rpm-maint] [rpm-software-management/rpm] Add real-life examples of Python RPM (PR #3177)
Jakub Kadlčík
notifications at github.com
Thu Aug 22 13:54:50 UTC 2024
@FrostyX commented on this pull request.
> + if what == rpm.RPMCALLBACK_INST_OPEN_FILE:
+ nvr, path = mydata
+ fd = os.open(path, os.O_RDONLY)
+ self.fdnos[nvr] = fd
+ return fd
+
+ elif what == rpm.RPMCALLBACK_INST_CLOSE_FILE:
+ nvr, path = mydata
+ os.close(self.fdnos[nvr])
+
+
+ts = rpm.TransactionSet()
+for path in sys.argv[1:]:
+ with open(path, "r") as fp:
+ hdr = ts.hdrFromFdno(fp.fileno())
+ ts.addInstall(hdr, (hdr.nvr, path), "i")
Good catch, thank you. Updated.
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3177#discussion_r1727108735
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/pull/3177/review/2254599690 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20240822/1900b158/attachment.html>
More information about the Rpm-maint
mailing list