#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
#
#
# userland-mangler - a file mangling utility
#
# A simple program to mangle files to conform to Solaris WOS or Consoldation
# requirements.
#
.\\\" Oracle has added the ARC stability level to this manual page"""
attribute_table_header = """
.SH ATTRIBUTES
See
.BR attributes (7)
for descriptions of the following attributes:
.sp
.TS
box;
cbp-1 | cbp-1
l | l .
ATTRIBUTE TYPE ATTRIBUTE VALUE """
=
Availability %s"""
=
Stability %s"""
attribute_table_footer = """
.TE
.PP
"""
result = ''
# is there anything to do?
return result
notes_oracle_comment = """
.\\\" Oracle has added source availability information to this manual page"""
notes_header = """
.SH NOTES
"""
notes_community = """
Further information about this software can be found on the open source community website at %s.
"""
notes_source = """
This software was built from source available at https://java.net/projects/solaris-userland. The original community source was downloaded from %s
"""
result = ''
# is there anything to do?
if header_seen == False:
result += (notes_source % source)
result += (notes_community % community)
return result
#
# mangler.man.modified_date = (mangler.man.modified-date)
# mangler.man.source-url = (pkg.source-url)
# mangler.man.upstream-url = (pkg.upstream-url)
# mangler.man.rewrite-section = ('true'/'false') default 'true'
#
# manpages must have a taxonomy defined
sys.exit(1)
# manpages may have a 'modified date'
# Rewrite the section in the .TH line to match the section in which
# we're delivering it.
source = None
source = manifest.attributes['info.source-url']
source = manifest.attributes['info.repository-url']
# skip reference only pages
return text
# tell man that we want tables (and eqn)
result = "'\\\" te\n"
# write the orginal data
if attributes_written == False:
if section == 'NOTES':
# Use the section defined by the filename, rather than
# the directory in which it sits.
if attributes_written == False:
return result
#
# mangler.elf.strip = (true|false)
#
#
# mangler.script.file-magic =
#
return text
#
# mangler.strip_cddl = false
#
return text
mangle_elf(manifest, action, src, dest)
else:
# a 'text' document (script, man page, config file, ...
# remove the CDDL from files
#
# mangler.bypass = (true|false)
#
if bypass == 'true':
continue
continue
if directory != destination:
if os.path.isfile(src):
mangle_path(manifest, action, src, dest)
break
# Check for file content and remove tpno data and license actions if
# there is no content in the package that can be licensed.
break
# search for and remove 'set name=com.oracle.info.tpno ...'
# Check for pkg.obsolete and if found, remove any depend actions.
# Also remove any require dependency on the release/evalauation
# package for renamed packages.
return manifest
print "Usage: %s [-m|--manifest (file)] [-d|--search-directory (dir)] [-D|--destination (dir)] " % (sys.argv[0].split('/')[-1])
sys.exit(1)
# FLUSH STDOUT
search_paths = []
manifests = []
try:
["destination=", "search-directory=", "manifest="])
usage()
try:
usage()
else:
else:
usage()
if destination == None:
usage()
print manifest
sys.exit(0)
if __name__ == "__main__":
main()