mirror of
https://github.com/clearlinux/bundle-chroot-builder.git
synced 2026-08-19 12:06:37 +00:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user