| |
@@ -375,6 +375,20 @@
|
| |
self.assertEqual(moved_to_parent, _mk_pkg_map())
|
| |
self.assertEqual(pkg_map, _mk_pkg_map([to_keep]))
|
| |
|
| |
+ def test_dont_remove_prepopulate_package(self):
|
| |
+ prep_pkg = {
|
| |
+ "path": "/build/required-1.0.0-1.x86_64.rpm",
|
| |
+ "flags": ["input", "prepopulate"],
|
| |
+ }
|
| |
+ pkg_map = _mk_pkg_map([prep_pkg])
|
| |
+ addon_pkgs, moved_to_parent, removed_pkgs = gather.trim_packages(
|
| |
+ self.compose, 'x86_64', self.addon, pkg_map, remove_pkgs={'rpm': ['required']})
|
| |
+
|
| |
+ self.assertEqual(removed_pkgs, _mk_pkg_map())
|
| |
+ self.assertEqual(addon_pkgs, _mk_pkg_map(set(["required"]), iterable_class=set))
|
| |
+ self.assertEqual(moved_to_parent, _mk_pkg_map())
|
| |
+ self.assertEqual(pkg_map, _mk_pkg_map([prep_pkg]))
|
| |
+
|
| |
def test_remove_package_present_in_parent(self):
|
| |
# packages present in parent will be removed from addon
|
| |
parent_pkgs = {
|
| |
If a package is listed in prepopulate file, it should not be removed from the variant during trimming.
Example situation:
This results in consumers being surprised about packages going missing. Just because a package is available in an addon is not an excuse for it to disappear (and possibly break dependencies).
The solution is to not trim anything pulled in due to prepopulate. As an end result, the same package may be included in multiple variants.