Installing or upgrading an rpm consists of adding a header and the package to the transaction set
rpmloc = "/path/to/foo-1.0.1.noarch.rpm" fdno = os.open(rpmloc, os.O_RDONLY) hdr = ts.hdrFromFdno(fdno) os.close(fdno) ts.addInstall(hdr,(hdr,rpmloc), "u") cb = simpleCallback() ts.run(cb.callback,'')
Now we can see our callback in action:
Installing foo foo: 33.33% done foo: 68.68% done foo: 100.0% done