2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-02-04 13:02:25 +00:00

Omit TRANS.TBL files from osimport

Avoid clutter of TRANS.TBL files while importing an ISO
This commit is contained in:
Jarrod Johnson 2020-02-27 16:36:47 -05:00
parent f798239f90
commit 29b4045817

View File

@ -35,6 +35,8 @@ def extract_entries(entries, flags=0, callback=None, totalsize=None):
sizedone = 0
with libarchive.extract.new_archive_write_disk(flags) as write_p:
for entry in entries:
if str(entry).endswith('TRANS.TBL'):
continue
write_header(write_p, entry._entry_p)
read_p = entry._archive_p
while 1:
@ -133,6 +135,8 @@ def scan_iso(filename):
filecontents = {}
with libarchive.file_reader(filename) as reader:
for ent in reader:
if str(ent).endswith('TRANS.TBL'):
continue
filesizes[str(ent)] = ent.size
if str(ent) in READFILES:
filecontents[str(ent)] = b''
@ -199,4 +203,4 @@ def import_image(filename):
if __name__ == '__main__':
sys.exit(import_image(sys.argv[1]))
sys.exit(import_image(sys.argv[1]))