metadata: Include empty directories in metadata

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ář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2019-05-20 13:26:27 +02:00
parent 283bae11da
commit fe723a2094
1 changed files with 3 additions and 1 deletions

View File

@ -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)