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 <patrick.mccarty@intel.com>
This commit is contained in:
Patrick McCarty
2017-01-23 14:48:53 -08:00
committed by tmarcu
parent 9fc98a03b1
commit bcffbb7096
+4
View File
@@ -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: