unit test: more closely mimic rpm2cpio behavior when reading past header
This commit is contained in:
parent
accdeb3c63
commit
aebff00673
1 changed files with 3 additions and 2 deletions
|
|
@ -57,10 +57,11 @@ class TestHeaderSizes(unittest.TestCase):
|
|||
|
||||
# The following bit uses rpmlib to read the header, which advances the file
|
||||
# pointer past it. This is the same approach rpm2cpio uses.
|
||||
ts = rpm.TransactionSet()
|
||||
ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES | rpm._RPMVSF_NODIGESTS | rpm.RPMVSF_NOHDRCHK)
|
||||
fd = os.open(fn, os.O_RDONLY)
|
||||
try:
|
||||
os.lseek(fd, s_lead + s_sig, 0) # seek to header start
|
||||
hdr, h_start = rpm.readHeaderFromFD(fd)
|
||||
hdr = ts.hdrFromFdno(fd)
|
||||
p_offset = os.lseek(fd, 0, os.SEEK_CUR)
|
||||
finally:
|
||||
os.close(fd)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue