tools/gen-components
author Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
Mon, 24 Mar 2014 15:04:05 -0700
branchs11-update
changeset 3004 856505663cc3
parent 2551 0391c5c3b137
child 3662 d2e09f75ea27
permissions -rwxr-xr-x
15997718 Interface addition/deletion causing frequent error messages in snmpd.log 17208688 MIB II SNMP table data discrepancy for network interfaces 16356248 snmpd unresponsive for 30 seconds after start with monitors set in snmpd.conf 17651108 snmpd dumps core when there are duplicate "exec" entries in snmpd.conf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2434
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     1
#!/usr/bin/python
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     2
#
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     3
# CDDL HEADER START
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     4
#
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     5
# The contents of this file are subject to the terms of the
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     6
# Common Development and Distribution License (the "License").
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     7
# You may not use this file except in compliance with the License.
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     8
#
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     9
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    10
# or http://www.opensolaris.org/os/licensing.
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    11
# See the License for the specific language governing permissions
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    12
# and limitations under the License.
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    13
#
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    14
# When distributing Covered Code, include this CDDL HEADER in each
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    15
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    16
# If applicable, add the following below this CDDL HEADER, with the
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    17
# fields enclosed by brackets "[]" replaced with your own identifying
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    18
# information: Portions Copyright [yyyy] [name of copyright owner]
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    19
#
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    20
# CDDL HEADER END
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    21
#
2481
638b7db19366 16245054 Auto-generation of Userland gate list - Phase 6
Rich Burridge <rich.burridge@oracle.com>
parents: 2434
diff changeset
    22
# Copyright (c) 2012, 2013, Oracle and/or it's affiliates.  All rights reserved.
2434
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    23
#
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    24
#
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    25
# gen_components
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    26
# A simple script to generate (on stdout), the component.html web page 
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    27
# found at: http://userland.us.oracle.com/components.html
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    28
#
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    29
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    30
import getopt
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    31
import os
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    32
import sys
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    33
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    34
debug = False
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    35
2551
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
    36
# TPNO string to search for in each .p5m file.
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
    37
TPNO_str = "com.oracle.info.tpno"
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
    38
2434
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    39
# Hashtable of components with TPNOs keyed by component name.
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    40
comp_TPNOs = {}
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    41
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    42
# Hashtable of RE's, RM's and Teams keyed by component path.
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    43
owners = {}
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    44
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    45
# Initial HTML for the generated web page.
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    46
preamble = """
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    47
<html>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    48
<head>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    49
    <style type='text/css' media='screen'>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    50
        @import '/css/demo_table.css';
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    51
        @import '/css/ColVis.css';
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    52
        @import '/css/ColReorder.css';
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    53
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    54
            tr.even:hover,  tr.even:hover td.sorting_1 ,
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    55
            tr.odd:hover,  tr.odd:hover td.sorting_1 {
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    56
                            background-color: gold;
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    57
            }
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    58
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    59
    </style>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    60
    <script type='text/javascript' src='js/jquery.js'></script>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    61
    <script type='text/javascript' src='js/jquery.dataTables.js'></script>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    62
    <script type='text/javascript' src='js/ColReorder.js'></script>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    63
    <script type='text/javascript' src='js/ColVis.js'></script>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    64
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    65
    <script>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    66
        $(document).ready(function() {
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    67
            $('#components').dataTable({
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    68
                "sDom": 'C<"clear">Rlfrtip',
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    69
                bPaginate: true,
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    70
                bFilter: true,
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    71
                bSort: true,
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    72
                iDisplayLength: -1,
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    73
                aLengthMenu: [ [ 10, 50, -1], [ 10, 50, 'All'] ]
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    74
            });
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    75
        });
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    76
    </script>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    77
</head>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    78
<body>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    79
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    80
<h1>Userland Components</h1>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    81
<p>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    82
<table align='center' id='components'>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    83
<thead>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    84
<tr>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    85
    <th>Component</th>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    86
    <th>Version</th>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    87
    <th>Gate Path</th>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    88
    <th>Package(s)</th>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    89
    <th>ARC Case(s)</th>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    90
    <th>License(s)</th>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    91
    <th>TPNO</th>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    92
    <th>BugDB</th>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    93
    <th>RE</th>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    94
    <th>RM</th>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    95
    <th>Team</th>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    96
</tr>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    97
</thead>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    98
<tbody>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    99
"""
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   100
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   101
# Final HTML for the generated web page.
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   102
postamble = """
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   103
</tr>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   104
</tbody>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   105
</table>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   106
</body>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   107
</html>
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   108
"""
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   109
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   110
# Return a hashtable of RE's, RM's and Teams keyed by component path.
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   111
def read_owners(owners_file):
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   112
    if debug:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   113
        print >> sys.stderr, "Reading %s" % owners_file
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   114
    try:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   115
        fin = open(owners_file, 'r')
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   116
        lines = fin.readlines()
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   117
        fin.close()
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   118
    except:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   119
        if debug:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   120
            print >> sys.stderr, "Unable to read owners file: %s" % owners_file
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   121
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   122
    owners = {}
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   123
    for line in lines:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   124
        line = line[:-1]
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   125
        component, re, rm, team = line.split("|")
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   126
        owners[component] = [ re, rm, team ]
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   127
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   128
    return owners
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   129
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   130
# Return a hashtable of components with TPNOs keyed by component name.
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   131
def find_TPNOs(workspace):
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   132
    comp_TPNOs = {}
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   133
    for directory, _, files in os.walk(workspace + "/components"):
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   134
        for filename in files:
2551
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
   135
            if filename.endswith(".p5m"):
2434
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   136
                pathname = os.path.join(directory, filename)
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   137
                fin = open(pathname, 'r')
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   138
                lines = fin.readlines()
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   139
                fin.close()
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   140
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   141
                for line in lines:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   142
                    line = line.replace("\n", "")
2551
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
   143
                    n = line.find(TPNO_str)
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
   144
                    if n != -1:
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
   145
                        tpno_str = line[n:].split("=")[1]
2434
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   146
                        try:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   147
                            # Check that the TPNO is a valid number.
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   148
                            tpno = int(tpno_str)
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   149
                            if debug:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   150
                                print >> sys.stderr, "TPNO: %s: %s" % \
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   151
                                    (directory, tpno_str)
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   152
                            comp_TPNOs[directory] = tpno_str
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   153
                        except:
2551
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
   154
                            # Check to see if line end in a "\" character in
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
   155
                            # which case, it's an attribute rather than an
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
   156
                            # set name action, so extract it a different way.
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
   157
                            try:
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
   158
                                n += len(TPNO_str)+1
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
   159
                                tpno_str = line[n:].split()[0]
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
   160
                                # Check that the TPNO is a valid number.
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
   161
                                tpno = int(tpno_str)
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
   162
                                if debug:
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
   163
                                    print >> sys.stderr, "TPNO: %s: %s" % \
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
   164
                                        (directory, tpno_str)
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
   165
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
   166
                                # If it's an attribute, there might be more
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
   167
                                # than one TPNO for this component.
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
   168
                                if directory in comp_TPNOs:
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
   169
                                    entry = comp_TPNOs[directory]
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
   170
                                    tpno_str = "%s,%s" % (entry, tpno_str)
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
   171
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
   172
                                comp_TPNOs[directory] = tpno_str
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
   173
                            except:
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
   174
                                print >> sys.stderr, \
0391c5c3b137 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 2481
diff changeset
   175
                                    "Unable to read TPNO: %s" % pathname
2434
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   176
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   177
    return(comp_TPNOs)
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   178
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   179
# Return a sorted list of the directories containing one or more .p5m files.
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   180
def find_p5m_dirs(workspace):
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   181
    p5m_dirs = []
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   182
    for dir, _, files in os.walk(workspace + "/components"):
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   183
        for file in files:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   184
            if file.endswith(".p5m"):
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   185
                p5m_dirs.append(dir)
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   186
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   187
    return sorted(list(set(p5m_dirs)))
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   188
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   189
# Write out the initial HTML for the components.html web page.
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   190
def write_preamble():
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   191
    print preamble
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   192
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   193
# Return the RE,  RM and Team for this component.
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   194
def get_owner(p5m_dir):
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   195
    result = [ "Unknown", "Unknown", "Unknown" ]
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   196
    component_path = ""
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   197
    started = False
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   198
    tokens = p5m_dir.split("/")
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   199
    for token in tokens:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   200
        if started:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   201
            component_path += token + "/"
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   202
        if token == "components":
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   203
            started = True
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   204
    component_path = component_path[:-1]
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   205
    if component_path in owners:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   206
        result = owners[component_path]
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   207
    if debug:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   208
        print >> sys.stderr, "Component path: ", component_path,
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   209
        print >> sys.stderr, "RE, RM, Team: ", result
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   210
    
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   211
    return result
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   212
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   213
# Generate an HTML table entry for all the information for the component
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   214
# in the given directory. This generates a file called 'component-report'
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   215
# under the components build directory.
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   216
def gen_reports(workspace, component_dir):
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   217
    if debug:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   218
        print >> sys.stderr, "Processing %s" % component_dir
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   219
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   220
    try:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   221
        tpno = comp_TPNOs[component_dir]
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   222
    except:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   223
        tpno = ""
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   224
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   225
    re, rm, team = get_owner(component_dir)
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   226
    makefiles = "-f Makefile -f %s/make-rules/component-report" % workspace
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   227
    targets = "clean component-hook"
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   228
    template = "cd %s; "
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   229
    template += "TPNO='%s' "
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   230
    template += "RESPONSIBLE_ENGINEER='%s' "
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   231
    template += "RESPONSIBLE_MANAGER='%s' "
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   232
    template += "TEAM='%s' "
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   233
    template += "gmake COMPONENT_HOOK='gmake %s component-report' %s"
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   234
    cmd = template % (component_dir, tpno, re, rm, team, makefiles, targets)
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   235
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   236
    if debug:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   237
        print >> sys.stderr, "gen_reports: command: `%s`" % cmd
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   238
    lines = os.popen(cmd).readlines()
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   239
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   240
# Collect all the .../build/component-report files and write them to stdout.
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   241
def write_reports(p5m_dirs, owners_file):
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   242
    for p5m_dir in p5m_dirs:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   243
        report = "%s/build/component-report" % p5m_dir
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   244
        if debug:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   245
            print >> sys.stderr, "Reading %s" % report
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   246
        try:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   247
            fin = open(report, 'r')
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   248
            lines = fin.readlines()
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   249
            fin.close()
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   250
            sys.stdout.writelines(lines)
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   251
        except:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   252
            if debug:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   253
                print >> sys.stderr, "Unable to read: %s" % report
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   254
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   255
# Write out the final HTML for the components.html web page.
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   256
def write_postamble():
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   257
    print postamble
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   258
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   259
# Write out a usage message showing valid options to this script.
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   260
def usage():
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   261
    print  >> sys.stderr, \
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   262
"""
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   263
Usage: 
2481
638b7db19366 16245054 Auto-generation of Userland gate list - Phase 6
Rich Burridge <rich.burridge@oracle.com>
parents: 2434
diff changeset
   264
      gen-components [OPTION...]
2434
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   265
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   266
-d, --debug
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   267
      Turn on debugging
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   268
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   269
-o, --owners
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   270
      Location of a file containing a list of RE's /RM's per component
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   271
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   272
-w --workspace
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   273
      Location of the Userland workspace
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   274
"""
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   275
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   276
    sys.exit(1)
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   277
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   278
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   279
if __name__ == "__main__":
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   280
    workspace = os.getenv('WS_TOP')
2481
638b7db19366 16245054 Auto-generation of Userland gate list - Phase 6
Rich Burridge <rich.burridge@oracle.com>
parents: 2434
diff changeset
   281
    owners_file = "/net/userland.us.oracle.com/gates/private/RE-RM-list.txt"
2434
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   282
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   283
    try:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   284
        opts, args = getopt.getopt(sys.argv[1:], "do:w:",
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   285
            [ "debug", "owners=", "workspace=" ])
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   286
    except getopt.GetoptError, err:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   287
        print str(err)
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   288
        usage()
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   289
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   290
    for opt, arg in opts:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   291
        if opt in [ "-d", "--debug" ]:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   292
            debug = True
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   293
        elif opt in [ "-o", "--owners" ]:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   294
            owners_file = arg
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   295
        elif opt in [ "-w", "--workspace" ]:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   296
            workspace = arg
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   297
        else:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   298
            assert False, "unknown option"
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   299
 
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   300
    owners = read_owners(owners_file)
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   301
    write_preamble()
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   302
    comp_TPNOs = find_TPNOs(workspace)
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   303
    p5m_dirs = find_p5m_dirs(workspace)
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   304
    for p5m_dir in p5m_dirs:
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   305
        gen_reports(workspace, p5m_dir)
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   306
    write_reports(p5m_dirs, owners_file)
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   307
    write_postamble()
6c9bb5cf5610 15930486 - Auto-generation of Userland gate list for the Solaris 11 Update Release
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
   308
    sys.exit(0)