19799164 content free packages shouldn't have a TPNO.
authorNorm Jacobs <Norm.Jacobs@Oracle.COM>
Thu, 16 Oct 2014 08:56:45 -0700
changeset 2153 f64a9f4ada4d
parent 2152 1cea7a430dd7
child 2154 d5b710c8edde
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/ordereddict/ordereddict.p5m
components/python/unittest2/unittest2.p5m
tools/userland-mangler
--- a/components/apache2-modules/mod_wsgi/mod_wsgi.p5m	Wed Oct 15 15:19:07 2014 -0600
+++ b/components/apache2-modules/mod_wsgi/mod_wsgi.p5m	Thu Oct 16 08:56:45 2014 -0700
@@ -27,7 +27,6 @@
     value=pkg:/web/server/apache-22/module/apache-wsgi@$(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=$(TPNO)
 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	Wed Oct 15 15:19:07 2014 -0600
+++ b/components/gcc47/developer-gcc-47.p5m	Thu Oct 16 08:56:45 2014 -0700
@@ -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=$(TPNO)
 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	Wed Oct 15 15:19:07 2014 -0600
+++ b/components/gcc47/system-library-gcc-gcc-runtime-47.p5m	Thu Oct 16 08:56:45 2014 -0700
@@ -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=$(TPNO)
 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	Wed Oct 15 15:19:07 2014 -0600
+++ b/components/gcc48/developer-gcc-48.p5m	Thu Oct 16 08:56:45 2014 -0700
@@ -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=$(TPNO)
 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	Wed Oct 15 15:19:07 2014 -0600
+++ b/components/gcc48/developer-gcc-c++.p5m	Thu Oct 16 08:56:45 2014 -0700
@@ -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=$(TPNO)
 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	Wed Oct 15 15:19:07 2014 -0600
+++ b/components/gcc48/developer-gcc-c.p5m	Thu Oct 16 08:56:45 2014 -0700
@@ -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=$(TPNO)
 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	Wed Oct 15 15:19:07 2014 -0600
+++ b/components/gcc48/developer-gcc-gfortran.p5m	Thu Oct 16 08:56:45 2014 -0700
@@ -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=$(TPNO)
 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	Wed Oct 15 15:19:07 2014 -0600
+++ b/components/gcc48/developer-gcc-gobjc.p5m	Thu Oct 16 08:56:45 2014 -0700
@@ -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=$(TPNO)
 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	Wed Oct 15 15:19:07 2014 -0600
+++ b/components/gcc48/developer-gcc.p5m	Thu Oct 16 08:56:45 2014 -0700
@@ -25,7 +25,6 @@
     value=pkg:/developer/gcc@$(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=$(TPNO)
 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	Wed Oct 15 15:19:07 2014 -0600
+++ b/components/gcc48/system-library-gcc-gcc-runtime-48.p5m	Thu Oct 16 08:56:45 2014 -0700
@@ -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=$(TPNO)
 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	Wed Oct 15 15:19:07 2014 -0600
+++ b/components/gcc48/system-library-gcc-gcc-runtime.p5m	Thu Oct 16 08:56:45 2014 -0700
@@ -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=$(TPNO)
 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	Wed Oct 15 15:19:07 2014 -0600
+++ b/components/python/importlib/importlib.p5m	Thu Oct 16 08:56:45 2014 -0700
@@ -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=$(TPNO)
 set name=info.classification \
     value=org.opensolaris.category.2008:Development/Python
 set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
--- a/components/python/ordereddict/ordereddict.p5m	Wed Oct 15 15:19:07 2014 -0600
+++ b/components/python/ordereddict/ordereddict.p5m	Thu Oct 16 08:56:45 2014 -0700
@@ -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=$(TPNO)
 set name=info.classification \
     value=org.opensolaris.category.2008:Development/Python
 set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
--- a/components/python/unittest2/unittest2.p5m	Wed Oct 15 15:19:07 2014 -0600
+++ b/components/python/unittest2/unittest2.p5m	Thu Oct 16 08:56:45 2014 -0700
@@ -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=$(TPNO)
 set name=info.classification \
     value=org.opensolaris.category.2008:Development/Python
 set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
--- a/tools/userland-mangler	Wed Oct 15 15:19:07 2014 -0600
+++ b/tools/userland-mangler	Thu Oct 16 08:56:45 2014 -0700
@@ -1,4 +1,4 @@
-#!/usr/bin/python2.6
+#!/usr/bin/python2.7
 #
 # CDDL HEADER START
 #
@@ -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
@@ -273,6 +273,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)
@@ -321,6 +338,7 @@
 
 	for manifest in manifests:
 		mangle_paths(manifest, search_paths, destination)
+		mangle_manifest(manifest)
 		print manifest
 
 	sys.exit(0)