rtichk.py revision e7aca7349385967a98ed221ad54db99998d477e8
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#! /usr/bin/python2.4
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# CDDL HEADER START
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# The contents of this file are subject to the terms of the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# Common Development and Distribution License (the "License").
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# You may not use this file except in compliance with the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# or http://www.opensolaris.org/os/licensing.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# See the License for the specific language governing permissions
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# and limitations under the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# When distributing Covered Code, include this CDDL HEADER in each
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# If applicable, add the following below this CDDL HEADER, with the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# fields enclosed by brackets "[]" replaced with your own identifying
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# information: Portions Copyright [yyyy] [name of copyright owner]
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# CDDL HEADER END
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright#
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
c586600796766c83eb9485c446886fd9ed2359a9Keyur Desai#
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# Use is subject to license terms.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# Check each bug referenced in a comments list (from stdin) has a valid RTI
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwimport sys, os, getopt
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwsys.path.append(os.path.join(os.path.dirname(__file__), '../lib/python'))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwsys.path.append(os.path.join(os.path.dirname(__file__), '..'))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwfrom onbld.Checks.Rti import rti
bbf6f00c25b6a2bed23c35eac6d62998ecdb338cJordan Brown
bbf6f00c25b6a2bed23c35eac6d62998ecdb338cJordan Brown
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwdef usage():
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross print 'usage: rtichk [-g gate] [-c consolidation] bugids...'
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross sys.exit(2)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
0f1702c5201310f0529cd5abb77652e5e9b241b6Yu Xiangningtry:
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw opts, bugs = getopt.getopt(sys.argv[1:], "c:g:r:t:")
bc7c423f80bd757204d3b17cfd74585ae5b30ed8Gordon Rossexcept getopt.GetoptError:
bbf6f00c25b6a2bed23c35eac6d62998ecdb338cJordan Brown usage()
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross sys.exit(2)
bbf6f00c25b6a2bed23c35eac6d62998ecdb338cJordan Brown
bbf6f00c25b6a2bed23c35eac6d62998ecdb338cJordan Browngate = None
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwconsolidation = None
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwfor opt, arg in opts:
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb if opt == '-c': consolidation = arg
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb elif opt == '-g': gate = arg
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Rossret = not rti(bugs, consolidation=consolidation, gatePath=gate,
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross output=sys.stdout)
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Rosssys.exit(ret)
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross