19799164 content free packages shouldn't have a TPNO. s11-update
authorNorm Jacobs <Norm.Jacobs@Oracle.COM>
Wed, 05 Nov 2014 09:37:34 -0800
branchs11-update
changeset 3532 b2e7186fdcce
parent 3522 ba9e5b4b76ad
child 3535 a05569ec203e
19799164 content free packages shouldn't have a TPNO.
components/apache2-modules/mod_wsgi/mod_wsgi.p5m
components/gcc47/developer-gcc-47.p5m
components/gcc47/system-library-gcc-gcc-runtime-47.p5m
components/gcc48/developer-gcc-48.p5m
components/gcc48/developer-gcc-c++.p5m
components/gcc48/developer-gcc-c.p5m
components/gcc48/developer-gcc-gfortran.p5m
components/gcc48/developer-gcc-gobjc.p5m
components/gcc48/developer-gcc.p5m
components/gcc48/system-library-gcc-gcc-runtime-48.p5m
components/gcc48/system-library-gcc-gcc-runtime.p5m
components/python/importlib/importlib.p5m
components/python/jsonrpclib/jsonrpclib.p5m
components/python/ordereddict/ordereddict.p5m
components/python/pycups/pycups.p5m
components/python/unittest2/unittest2.p5m
tools/userland-mangler
--- a/components/apache2-modules/mod_wsgi/mod_wsgi.p5m	Mon Dec 08 13:21:00 2014 -0800
+++ b/components/apache2-modules/mod_wsgi/mod_wsgi.p5m	Wed Nov 05 09:37:34 2014 -0800
@@ -20,14 +20,13 @@
 #
 
 #
-# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
 #
 
 set name=pkg.fmri \
     value=pkg:/web/server/apache-22/module/[email protected]$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
 set name=pkg.summary value="mod_wsgi plugin for Apache Web Server v2.2"
 set name=com.oracle.info.description value="the mod_wsgi plugin for Apache Web Server v2.2"
-set name=com.oracle.info.tpno value=7687
 set name=info.classification \
     value="org.opensolaris.category.2008:Web Services/Application and Web Servers"
 set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
--- a/components/gcc47/developer-gcc-47.p5m	Mon Dec 08 13:21:00 2014 -0800
+++ b/components/gcc47/developer-gcc-47.p5m	Wed Nov 05 09:37:34 2014 -0800
@@ -26,7 +26,6 @@
 set name=pkg.summary value="GCC $(GCC_VERSION)"
 set name=com.oracle.info.description \
     value="the GNU Compiler Collection - GCC $(GCC_VERSION)"
-set name=com.oracle.info.tpno value=14467
 set name=info.classification value=org.opensolaris.category.2008:Development/C \
     value=org.opensolaris.category.2008:Development/C++ \
     value=org.opensolaris.category.2008:Development/Fortran \
--- a/components/gcc47/system-library-gcc-gcc-runtime-47.p5m	Mon Dec 08 13:21:00 2014 -0800
+++ b/components/gcc47/system-library-gcc-gcc-runtime-47.p5m	Wed Nov 05 09:37:34 2014 -0800
@@ -26,7 +26,6 @@
 set name=pkg.summary value="GCC $(GCC_VERSION) - GCC Runtime"
 set name=com.oracle.info.description \
     value="the GNU Compiler Collection - Compiler Runtime Libraries"
-set name=com.oracle.info.tpno value=14467
 set name=info.classification value=org.opensolaris.category.2008:Development/C \
     value=org.opensolaris.category.2008:Development/C++ \
     value=org.opensolaris.category.2008:Development/Fortran \
--- a/components/gcc48/developer-gcc-48.p5m	Mon Dec 08 13:21:00 2014 -0800
+++ b/components/gcc48/developer-gcc-48.p5m	Wed Nov 05 09:37:34 2014 -0800
@@ -26,7 +26,6 @@
 set name=pkg.summary value="GCC $(GCC_VERSION)"
 set name=com.oracle.info.description \
     value="the GNU Compiler Collection - GCC $(GCC_VERSION)"
-set name=com.oracle.info.tpno value=15448
 set name=info.classification value=org.opensolaris.category.2008:Development/C \
     value=org.opensolaris.category.2008:Development/C++ \
     value=org.opensolaris.category.2008:Development/Fortran \
--- a/components/gcc48/developer-gcc-c++.p5m	Mon Dec 08 13:21:00 2014 -0800
+++ b/components/gcc48/developer-gcc-c++.p5m	Wed Nov 05 09:37:34 2014 -0800
@@ -26,7 +26,6 @@
 set name=pkg.summary value="GCC - C++ Compiler"
 set name=com.oracle.info.description \
     value="the GNU Compiler Collection - C++ Compiler"
-set name=com.oracle.info.tpno value=15448
 set name=info.classification value=org.opensolaris.category.2008:Development/C \
     value=org.opensolaris.category.2008:Development/C++ \
     value=org.opensolaris.category.2008:Development/GNU
--- a/components/gcc48/developer-gcc-c.p5m	Mon Dec 08 13:21:00 2014 -0800
+++ b/components/gcc48/developer-gcc-c.p5m	Wed Nov 05 09:37:34 2014 -0800
@@ -26,7 +26,6 @@
 set name=pkg.summary value="GCC - C Compiler"
 set name=com.oracle.info.description \
     value="the GNU Compiler Collection - C Compiler"
-set name=com.oracle.info.tpno value=15448
 set name=info.classification value=org.opensolaris.category.2008:Development/C \
     value=org.opensolaris.category.2008:Development/GNU
 set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
--- a/components/gcc48/developer-gcc-gfortran.p5m	Mon Dec 08 13:21:00 2014 -0800
+++ b/components/gcc48/developer-gcc-gfortran.p5m	Wed Nov 05 09:37:34 2014 -0800
@@ -26,7 +26,6 @@
 set name=pkg.summary value="GCC - GNU Fortran Compiler"
 set name=com.oracle.info.description \
     value="the GNU Compiler Collection - Fortran Compiler"
-set name=com.oracle.info.tpno value=15448
 set name=info.classification \
     value=org.opensolaris.category.2008:Development/Fortran \
     value=org.opensolaris.category.2008:Development/GNU
--- a/components/gcc48/developer-gcc-gobjc.p5m	Mon Dec 08 13:21:00 2014 -0800
+++ b/components/gcc48/developer-gcc-gobjc.p5m	Wed Nov 05 09:37:34 2014 -0800
@@ -26,7 +26,6 @@
 set name=pkg.summary value="GCC - Objective-C Compiler"
 set name=com.oracle.info.description \
     value="the GNU Compiler Collection - Objective-C Compiler"
-set name=com.oracle.info.tpno value=15448
 set name=info.classification value=org.opensolaris.category.2008:Development/C \
     value=org.opensolaris.category.2008:Development/GNU \
     value="org.opensolaris.category.2008:Development/Objective C"
--- a/components/gcc48/developer-gcc.p5m	Mon Dec 08 13:21:00 2014 -0800
+++ b/components/gcc48/developer-gcc.p5m	Wed Nov 05 09:37:34 2014 -0800
@@ -25,7 +25,6 @@
     value=pkg:/developer/[email protected]$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
 set name=pkg.summary value=GCC
 set name=com.oracle.info.description value="the GNU Compiler Collection"
-set name=com.oracle.info.tpno value=15448
 set name=info.classification value=org.opensolaris.category.2008:Development/C \
     value=org.opensolaris.category.2008:Development/C++ \
     value=org.opensolaris.category.2008:Development/Fortran \
--- a/components/gcc48/system-library-gcc-gcc-runtime-48.p5m	Mon Dec 08 13:21:00 2014 -0800
+++ b/components/gcc48/system-library-gcc-gcc-runtime-48.p5m	Wed Nov 05 09:37:34 2014 -0800
@@ -26,7 +26,6 @@
 set name=pkg.summary value="GCC $(GCC_VERSION) - GCC Runtime"
 set name=com.oracle.info.description \
     value="the GNU Compiler Collection - Compiler Runtime Libraries"
-set name=com.oracle.info.tpno value=15448
 set name=info.classification value=org.opensolaris.category.2008:Development/C \
     value=org.opensolaris.category.2008:Development/C++ \
     value=org.opensolaris.category.2008:Development/Fortran \
--- a/components/gcc48/system-library-gcc-gcc-runtime.p5m	Mon Dec 08 13:21:00 2014 -0800
+++ b/components/gcc48/system-library-gcc-gcc-runtime.p5m	Wed Nov 05 09:37:34 2014 -0800
@@ -26,7 +26,6 @@
 set name=pkg.summary value="GCC - GCC Runtime"
 set name=com.oracle.info.description \
     value="the GNU Compiler Collection - Compiler Runtime Libraries"
-set name=com.oracle.info.tpno value=15448
 set name=info.classification value=org.opensolaris.category.2008:Development/C \
     value=org.opensolaris.category.2008:Development/C++ \
     value=org.opensolaris.category.2008:Development/Fortran \
--- a/components/python/importlib/importlib.p5m	Mon Dec 08 13:21:00 2014 -0800
+++ b/components/python/importlib/importlib.p5m	Wed Nov 05 09:37:34 2014 -0800
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
 #
 
 set name=pkg.fmri \
@@ -27,7 +27,6 @@
 set name=pkg.description \
     value="The importlib module contains the code from importlib as found in Python 2.7. It is provided so that people who wish to use importlib.import_module() with a version of Python prior to 2.7 or in 3.0 have the function readily available."
 set name=com.oracle.info.description value="the Python importlib module"
-set name=com.oracle.info.tpno value=14503
 set name=info.classification \
     value=org.opensolaris.category.2008:Development/Python
 set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
--- a/components/python/jsonrpclib/jsonrpclib.p5m	Mon Dec 08 13:21:00 2014 -0800
+++ b/components/python/jsonrpclib/jsonrpclib.p5m	Wed Nov 05 09:37:34 2014 -0800
@@ -24,7 +24,6 @@
 set name=pkg.fmri value=pkg:/library/python-2/[email protected]$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
 set name=pkg.summary value="Python implementation of JSON-RPC v2.0"
 set name=com.oracle.info.description value="the Python implementation of JSON-RPC v2.0"
-set name=com.oracle.info.tpno value=8061
 set name=info.classification value="org.opensolaris.category.2008:Development/Python"
 set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
 set name=info.upstream value="Josh Marshall <[email protected]>"
--- a/components/python/ordereddict/ordereddict.p5m	Mon Dec 08 13:21:00 2014 -0800
+++ b/components/python/ordereddict/ordereddict.p5m	Wed Nov 05 09:37:34 2014 -0800
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
 #
 
 set name=pkg.fmri \
@@ -26,7 +26,6 @@
 set name=pkg.summary value="Python ordereddict library"
 set name=com.oracle.info.description \
     value="Drop-in substitute for Py2.7's new collections.OrderedDict. The recipe has big-oh performance that matches regular dictionaries (amortized O(1) insertion/deletion/lookup and O(n) iteration/repr/copy/equality_testing)."
-set name=com.oracle.info.tpno value=14503
 set name=info.classification \
     value=org.opensolaris.category.2008:Development/Python
 set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
--- a/components/python/pycups/pycups.p5m	Mon Dec 08 13:21:00 2014 -0800
+++ b/components/python/pycups/pycups.p5m	Wed Nov 05 09:37:34 2014 -0800
@@ -24,7 +24,6 @@
 set name=pkg.fmri value=pkg:/library/python-2/[email protected]$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
 set name=pkg.summary value="Python bindings for CUPS"
 set name=com.oracle.info.description value="the Python language bindings for CUPS"
-set name=com.oracle.info.tpno value=9025
 set name=info.classification value=org.opensolaris.category.2008:System/Printing
 set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
 set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
--- a/components/python/unittest2/unittest2.p5m	Mon Dec 08 13:21:00 2014 -0800
+++ b/components/python/unittest2/unittest2.p5m	Wed Nov 05 09:37:34 2014 -0800
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
 #
 
 set name=pkg.fmri \
@@ -28,7 +28,6 @@
     value="Many new features were added to unittest in Python 2.7, including test discovery. unittest2 allows you to use these features with earlier versions of Python."
 set name=com.oracle.info.description \
     value="the unittest2 Python unit testing framework"
-set name=com.oracle.info.tpno value=14503
 set name=info.classification \
     value=org.opensolaris.category.2008:Development/Python
 set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
--- a/tools/userland-mangler	Mon Dec 08 13:21:00 2014 -0800
+++ b/tools/userland-mangler	Wed Nov 05 09:37:34 2014 -0800
@@ -19,7 +19,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
 #
 #
 # userland-mangler - a file mangling utility
@@ -257,6 +257,23 @@
 					mangle_path(manifest, action, src, dest)
 					break
 
+def mangle_manifest(manifest):
+	# Check for file content and remove tpno data and license actions if
+	# there is no content in the package that can be licensed.
+	manifest_has_file_content = False
+
+	for action in manifest.gen_actions_by_type("file"):
+		manifest_has_file_content = True
+		break
+
+	if not manifest_has_file_content:
+		# search for and remove 'set name=com.oracle.info.tpno ...'
+		for action in manifest.gen_actions_by_type("set"):
+			if (action.attrs["name"] == "com.oracle.info.tpno"):
+				manifest.actions.remove(action)
+		for action in manifest.gen_actions_by_type("license"):
+			manifest.actions.remove(action)
+
 def load_manifest(manifest_file):
 	manifest = pkg.manifest.Manifest()
 	manifest.set_content(pathname=manifest_file)
@@ -305,6 +322,7 @@
 
 	for manifest in manifests:
 		mangle_paths(manifest, search_paths, destination)
+		mangle_manifest(manifest)
 		print manifest
 
 	sys.exit(0)