From bcffbb70965f4efa4e90c771aa07390c16661763 Mon Sep 17 00:00:00 2001 From: Patrick McCarty Date: Mon, 23 Jan 2017 14:48:53 -0800 Subject: [PATCH] Exclude empty subpackages from the SRPM file lists The string "(contains no files)" is printed when running 'rpm -ql ...' for an empty subpackage. Since that output is more useful for interactive use, make sure the string is excluded from the final SRPM file lists that begin with files-*. Signed-off-by: Patrick McCarty --- bundle-chroot-builder.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bundle-chroot-builder.py b/bundle-chroot-builder.py index 336e66a..bde0120 100755 --- a/bundle-chroot-builder.py +++ b/bundle-chroot-builder.py @@ -331,6 +331,10 @@ def create_chroots(args, state_dir, bundles, yum_conf): if package_name not in package_mapping: package_mapping[package_name] = set() for path in path_list: + # RPM prints out a specific string for subpackages that contain no + # files. It should be excluded from the SRPM file list. + if re.match(br"\(contains no files\)\n", path): + continue package_mapping[package_name].add(path) for package_name, paths in package_mapping.items(): with open(out_dir + "/files-{}".format(package_name), "wb") as file: