xref: /onnv-gate/usr/src/tools/scripts/rtichk.py (revision 11300)
1*11300Srichlowe@richlowe.net#! /usr/bin/python2.4
27078Smjnelson#
37078Smjnelson# CDDL HEADER START
47078Smjnelson#
57078Smjnelson# The contents of this file are subject to the terms of the
67078Smjnelson# Common Development and Distribution License (the "License").
77078Smjnelson# You may not use this file except in compliance with the License.
87078Smjnelson#
97078Smjnelson# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107078Smjnelson# or http://www.opensolaris.org/os/licensing.
117078Smjnelson# See the License for the specific language governing permissions
127078Smjnelson# and limitations under the License.
137078Smjnelson#
147078Smjnelson# When distributing Covered Code, include this CDDL HEADER in each
157078Smjnelson# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167078Smjnelson# If applicable, add the following below this CDDL HEADER, with the
177078Smjnelson# fields enclosed by brackets "[]" replaced with your own identifying
187078Smjnelson# information: Portions Copyright [yyyy] [name of copyright owner]
197078Smjnelson#
207078Smjnelson# CDDL HEADER END
217078Smjnelson#
227078Smjnelson
237078Smjnelson#
24*11300Srichlowe@richlowe.net# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
257078Smjnelson# Use is subject to license terms.
267078Smjnelson#
277078Smjnelson
287078Smjnelson#
297078Smjnelson# Check each bug referenced in a comments list (from stdin) has a valid RTI
307078Smjnelson#
317078Smjnelson
327078Smjnelsonimport sys, os, getopt
337078Smjnelson
347078Smjnelsonsys.path.append(os.path.join(os.path.dirname(__file__), '../lib/python'))
357078Smjnelsonsys.path.append(os.path.join(os.path.dirname(__file__), '..'))
367078Smjnelson
377078Smjnelsonfrom onbld.Checks.Rti import rti
387078Smjnelson
397078Smjnelson
407078Smjnelsondef usage():
417078Smjnelson    print 'usage: rtichk [-g gate] [-c consolidation] bugids...'
427078Smjnelson    sys.exit(2)
437078Smjnelson
447078Smjnelsontry:
457078Smjnelson	opts, bugs = getopt.getopt(sys.argv[1:], "c:g:r:t:")
467078Smjnelsonexcept getopt.GetoptError:
477078Smjnelson	usage()
487078Smjnelson	sys.exit(2)
497078Smjnelson
507078Smjnelsongate = None
517078Smjnelsonconsolidation = None
527078Smjnelson
537078Smjnelsonfor opt, arg in opts:
547078Smjnelson	if opt == '-c': consolidation = arg
557078Smjnelson	elif opt == '-g': gate = arg
567078Smjnelson
577078Smjnelsonret = not rti(bugs, consolidation=consolidation, gatePath=gate,
587078Smjnelson	      output=sys.stdout)
597078Smjnelsonsys.exit(ret)
60