22265690 require dependency on release/evaluation should be dropped for renamed packages
authorJohn Beck <John.Beck@Oracle.COM>
Wed, 09 Dec 2015 09:15:22 -0800
changeset 5175 c63cda9960d4
parent 5174 85d6cad6ebf8
child 5176 6ed69e0ee716
22265690 require dependency on release/evaluation should be dropped for renamed packages
tools/userland-mangler
--- a/tools/userland-mangler	Wed Nov 18 07:25:06 2015 -0800
+++ b/tools/userland-mangler	Wed Dec 09 09:15:22 2015 -0800
@@ -19,7 +19,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
 #
 #
 # userland-mangler - a file mangling utility
@@ -291,17 +291,29 @@
 			manifest.actions.remove(action)
 
 	# Check for pkg.obsolete and if found, remove any depend actions.
+	# Also remove any require dependency on the release/evalauation
+	# package for renamed packages.
 	manifest_is_obsolete = False
+	manifest_is_renamed = 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 (action.attrs["name"] == "pkg.renamed" and
+		    action.attrs["value"] == "true"):
+			manifest_is_renamed = True
 
 	if manifest_is_obsolete:
 		for action in manifest.gen_actions_by_type("depend"):
 			manifest.actions.remove(action)
 
+	if manifest_is_renamed:
+		for action in manifest.gen_actions_by_type("depend"):
+			if (action.attrs["type"] == "require" and
+			    action.attrs["fmri"] == "release/evaluation"):
+				manifest.actions.remove(action)
+
 def load_manifest(manifest_file):
 	manifest = pkg.manifest.Manifest()
 	manifest.set_content(pathname=manifest_file)