111838SLiane.Praza@Sun.COM#!/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*12216Srichlowe@richlowe.net# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. 257078Smjnelson# 267078Smjnelson 277078Smjnelson# 287078Smjnelson# Check each bug referenced in a comments list (from stdin) has a valid RTI 297078Smjnelson# 307078Smjnelson 317078Smjnelsonimport sys, os, getopt 327078Smjnelson 33*12216Srichlowe@richlowe.netsys.path.insert(1, os.path.join(os.path.dirname(__file__), "..", "lib", 34*12216Srichlowe@richlowe.net "python%d.%d" % sys.version_info[:2])) 35*12216Srichlowe@richlowe.net 36*12216Srichlowe@richlowe.net# Allow running from the source tree, using the modules in the source tree 37*12216Srichlowe@richlowe.netsys.path.insert(2, os.path.join(os.path.dirname(__file__), '..')) 387078Smjnelson 397078Smjnelsonfrom onbld.Checks.Rti import rti 407078Smjnelson 417078Smjnelson 427078Smjnelsondef usage(): 437078Smjnelson print 'usage: rtichk [-g gate] [-c consolidation] bugids...' 447078Smjnelson sys.exit(2) 457078Smjnelson 467078Smjnelsontry: 477078Smjnelson opts, bugs = getopt.getopt(sys.argv[1:], "c:g:r:t:") 487078Smjnelsonexcept getopt.GetoptError: 497078Smjnelson usage() 507078Smjnelson sys.exit(2) 517078Smjnelson 527078Smjnelsongate = None 537078Smjnelsonconsolidation = None 547078Smjnelson 557078Smjnelsonfor opt, arg in opts: 567078Smjnelson if opt == '-c': consolidation = arg 577078Smjnelson elif opt == '-g': gate = arg 587078Smjnelson 597078Smjnelsonret = not rti(bugs, consolidation=consolidation, gatePath=gate, 607078Smjnelson output=sys.stdout) 617078Smjnelsonsys.exit(ret) 62