#
# 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
#
#
#
#
# gen_components
# A simple script to generate (on stdout), the component.html web page
#
# Hashtable of RE's, RM's and Teams keyed by component path.
owners = {}
# Initial HTML for the generated web page.
preamble = """
<html>
<head>
@import '/css/demo_table.css';
@import '/css/ColVis.css';
@import '/css/ColReorder.css';
tr.even:hover, tr.even:hover td.sorting_1 ,
tr.odd:hover, tr.odd:hover td.sorting_1 {
background-color: gold;
}
</style>
<script type='text/javascript' src='js/jquery.js'></script>
<script type='text/javascript' src='js/jquery.dataTables.js'></script>
<script type='text/javascript' src='js/ColReorder.js'></script>
<script type='text/javascript' src='js/ColVis.js'></script>
<script>
$('#components').dataTable({
bPaginate: true,
bFilter: true,
bSort: true,
iDisplayLength: -1,
aLengthMenu: [ [ 10, 50, -1], [ 10, 50, 'All'] ]
});
});
</script>
</head>
<body>
<h1>Userland Components</h1>
<p>
<table align='center' id='components'>
<thead>
<tr>
<th>Component</th>
<th>Version</th>
<th>Gate Path</th>
<th>Package(s)</th>
<th>ARC Case(s)</th>
<th>License(s)</th>
<th>TPNO</th>
<th>BugDB</th>
<th>RE</th>
<th>RM</th>
<th>Team</th>
</tr>
</thead>
<tbody>
"""
# Final HTML for the generated web page.
postamble = """
</tr>
</tbody>
</table>
</body>
</html>
"""
# Get a complete list of package names for the repo associated with this
# Userland workspace.
names = []
if debug:
if debug:
if debug:
return names
# Return a hashtable of RE's, RM's and Teams keyed by component path.
if debug:
try:
if debug:
owners = {}
return owners
# Return a sorted list of the directories containing one or more .p5m files.
p5m_dirs = []
continue;
continue;
# Write out the initial HTML for the components.html web page.
print preamble
# Return the RE, RM and Team for this component.
component_path = ""
if started:
if token == "components":
if debug:
return result
# Generate an HTML table entry for all the information for the component
# in the given directory. This generates a file called 'component-report'
# under the components build directory.
if debug:
targets = "clean component-hook"
template = "cd %s; "
template += "RESPONSIBLE_ENGINEER='%s' "
template += "RESPONSIBLE_MANAGER='%s' "
template += "TEAM='%s' "
template += "gmake COMPONENT_HOOK='gmake %s component-report' %s"
if debug:
# The package name(s) in the component-report files will be incorrectly
# generated if there was a <whatever>VER.p5m file in the component
# directory. For those components we've got to use the package names
# from the repo associated with this Userland workspace.
continue
td_count = 0
if n != -1:
if debug:
broken_pkg_name = line[:n]
else:
continue
td_count += 1
# Collect all the .../build/component-report files and write them to stdout.
if debug:
try:
if debug:
# Write out the final HTML for the components.html web page.
print postamble
# Write out a usage message showing valid options to this script.
print >> sys.stderr, \
"""
Usage:
gen-components [OPTION...]
-b, --build-version
Build version script to look for (and strip off) from package FMRIs.
-d, --debug
Turn on debugging
-o, --owners
Location of a file containing a list of RE's /RM's per component
-r, --repo
Repo containing the packages associated with this Userland workspace
-w --workspace
Location of the Userland workspace
"""
sys.exit(1)
if __name__ == "__main__":
build_version = "-5.12.0.0.0"
try:
[ "build-version=", "debug", "owners=", "repo=", "workspace=" ])
usage()
else:
sys.exit(0)