1*7078Smjnelson#! /usr/bin/python
2*7078Smjnelson#
3*7078Smjnelson# CDDL HEADER START
4*7078Smjnelson#
5*7078Smjnelson# The contents of this file are subject to the terms of the
6*7078Smjnelson# Common Development and Distribution License (the "License").
7*7078Smjnelson# You may not use this file except in compliance with the License.
8*7078Smjnelson#
9*7078Smjnelson# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7078Smjnelson# or http://www.opensolaris.org/os/licensing.
11*7078Smjnelson# See the License for the specific language governing permissions
12*7078Smjnelson# and limitations under the License.
13*7078Smjnelson#
14*7078Smjnelson# When distributing Covered Code, include this CDDL HEADER in each
15*7078Smjnelson# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7078Smjnelson# If applicable, add the following below this CDDL HEADER, with the
17*7078Smjnelson# fields enclosed by brackets "[]" replaced with your own identifying
18*7078Smjnelson# information: Portions Copyright [yyyy] [name of copyright owner]
19*7078Smjnelson#
20*7078Smjnelson# CDDL HEADER END
21*7078Smjnelson#
22*7078Smjnelson
23*7078Smjnelson#
24*7078Smjnelson# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
25*7078Smjnelson# Use is subject to license terms.
26*7078Smjnelson#
27*7078Smjnelson# ident	"%Z%%M%	%I%	%E% SMI"
28*7078Smjnelson#
29*7078Smjnelson
30*7078Smjnelson#
31*7078Smjnelson# Check each bug referenced in a comments list (from stdin) has a valid RTI
32*7078Smjnelson#
33*7078Smjnelson
34*7078Smjnelsonimport sys, os, getopt
35*7078Smjnelson
36*7078Smjnelsonsys.path.append(os.path.join(os.path.dirname(__file__), '../lib/python'))
37*7078Smjnelsonsys.path.append(os.path.join(os.path.dirname(__file__), '..'))
38*7078Smjnelson
39*7078Smjnelsonfrom onbld.Checks.Rti import rti
40*7078Smjnelson
41*7078Smjnelson
42*7078Smjnelsondef usage():
43*7078Smjnelson    print 'usage: rtichk [-g gate] [-c consolidation] bugids...'
44*7078Smjnelson    sys.exit(2)
45*7078Smjnelson
46*7078Smjnelsontry:
47*7078Smjnelson	opts, bugs = getopt.getopt(sys.argv[1:], "c:g:r:t:")
48*7078Smjnelsonexcept getopt.GetoptError:
49*7078Smjnelson	usage()
50*7078Smjnelson	sys.exit(2)
51*7078Smjnelson
52*7078Smjnelsongate = None
53*7078Smjnelsonconsolidation = None
54*7078Smjnelson
55*7078Smjnelsonfor opt, arg in opts:
56*7078Smjnelson	if opt == '-c': consolidation = arg
57*7078Smjnelson	elif opt == '-g': gate = arg
58*7078Smjnelson
59*7078Smjnelsonret = not rti(bugs, consolidation=consolidation, gatePath=gate,
60*7078Smjnelson	      output=sys.stdout)
61*7078Smjnelsonsys.exit(ret)
62