From c760c747ce86ff39e848b5d9b5599504e9e1c561 Mon Sep 17 00:00:00 2001 From: Elvis Pranskevichus Date: Sat, 12 Oct 2024 22:18:50 -0700 Subject: [PATCH] Fix single-file source support The file needs to be put into a subdirectory in the tarball because we are expecting to be stripping it. --- metapkg/packages/sources.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/metapkg/packages/sources.py b/metapkg/packages/sources.py index ab17b3d..250131d 100644 --- a/metapkg/packages/sources.py +++ b/metapkg/packages/sources.py @@ -219,7 +219,10 @@ def _tarball( comp = ".gz" target_path = target_dir / name_tpl.format(part=part, comp=comp) with tarfile.open(target_path, "w:gz") as tf: - tf.add(str(src), arcname=src.name) + tf.add( + str(src), + arcname=str(pathlib.Path(src.name) / src.name), + ) elif src.suffix == ".tgz": comp = ".gz" elif src.suffix == ".tbz2":