From fe723a209428867118fa868e59b34a02f5f8ec4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Mon, 20 May 2019 13:26:27 +0200 Subject: [PATCH] metadata: Include empty directories in metadata MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For example when a variant does not have any debuginfo packages, the metadata will contain path to a repository, but it will be missing the package path despite the (empty) directory being present on the filesystem. We should really only skip missing directories. Signed-off-by: Lubomír Sedlář --- pungi/metadata.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pungi/metadata.py b/pungi/metadata.py index c03e077e..82d0058d 100644 --- a/pungi/metadata.py +++ b/pungi/metadata.py @@ -178,7 +178,9 @@ def write_compose_info(compose): field_paths = getattr(variant.paths, field) for arch, dirpath in field_paths.items(): dirpath = os.path.join(compose.paths.compose.topdir(), dirpath) - if not (os.path.isdir(dirpath) and os.listdir(dirpath)): + if not os.path.isdir(dirpath): + # If the directory does not exist, do not include the path + # in metadata. field_paths[arch] = None ci_copy.dump(path)