Skip to content

Commit 2b0bd82

Browse files
diconico07jfkw
authored andcommitted
Ensure some level of compatibility with older libarchive
In order to allow users of distribution with old libarchive to use this service, catch the exception generated in this case and fallback to non reproducible behavior. A message is logged to inform user of the situation Signed-off-by: Nicolas Belouin <nicolas.belouin@suse.com>
1 parent b299a48 commit 2b0bd82

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

go_modules

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,17 @@ def main():
332332
archive_args["compression"],
333333
options=",".join(options),
334334
) as new_archive:
335-
new_archive.add_files(vendor_dir, mtime=mtime, ctime=mtime, atime=mtime)
335+
try:
336+
new_archive.add_files(
337+
vendor_dir, mtime=mtime, ctime=mtime, atime=mtime
338+
)
339+
except (
340+
TypeError
341+
): # If using old libarchive fallback to old non reproducible behavior
342+
log.warning(
343+
"python libarchive is too old, unable to produce reproducible output"
344+
)
345+
new_archive.add_files(vendor_dir)
336346
os.chdir(cwd)
337347

338348

0 commit comments

Comments
 (0)