21960309 Userland mangler should drop depend actions from obsolete packages
authorJohn Beck <John.Beck@Oracle.COM>
Tue, 06 Oct 2015 07:41:40 -0700
changeset 4973 be26c0c14fa7
parent 4972 882943f5c0d0
child 4974 134621002c51
21960309 Userland mangler should drop depend actions from obsolete packages
tools/userland-mangler
--- a/tools/userland-mangler	Fri Oct 02 10:36:56 2015 -0700
+++ b/tools/userland-mangler	Tue Oct 06 07:41:40 2015 -0700
@@ -290,6 +290,18 @@
 		for action in manifest.gen_actions_by_type("license"):
 			manifest.actions.remove(action)
 
+	# Check for pkg.obsolete and if found, remove any depend actions.
+	manifest_is_obsolete = False
+
+	for action in manifest.gen_actions_by_type("set"):
+		if (action.attrs["name"] == "pkg.obsolete" and
+		    action.attrs["value"] == "true"):
+			manifest_is_obsolete = True
+
+	if manifest_is_obsolete:
+		for action in manifest.gen_actions_by_type("depend"):
+			manifest.actions.remove(action)
+
 def load_manifest(manifest_file):
 	manifest = pkg.manifest.Manifest()
 	manifest.set_content(pathname=manifest_file)