usr/src/tools/onbld/Checks/__init__.py
author Ali Bahrami <Ali.Bahrami@Sun.COM>
Tue, 10 Feb 2009 09:38:02 -0700
changeset 8744 03d5725cda56
parent 7078 935563142864
child 13156 9b805b8d713b
permissions -rw-r--r--
6798660 Cadmium .NOT file processing problem with CWD relative file paths Contributed by Richard Lowe 6785284 Mapfile versioning rules need to be more visible to gatelings 6800164 Standard file exclusion mechanism needed for Cadmium tools
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
     1
#! /usr/bin/python
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
     2
#
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
     3
# CDDL HEADER START
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
     4
#
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
     5
# The contents of this file are subject to the terms of the
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
     6
# Common Development and Distribution License (the "License").
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
     7
# You may not use this file except in compliance with the License.
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
     8
#
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
     9
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    10
# or http://www.opensolaris.org/os/licensing.
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    11
# See the License for the specific language governing permissions
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    12
# and limitations under the License.
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    13
#
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    14
# When distributing Covered Code, include this CDDL HEADER in each
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    15
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    16
# If applicable, add the following below this CDDL HEADER, with the
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    17
# fields enclosed by brackets "[]" replaced with your own identifying
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    18
# information: Portions Copyright [yyyy] [name of copyright owner]
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    19
#
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    20
# CDDL HEADER END
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    21
#
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    22
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    23
#
8744
03d5725cda56 6798660 Cadmium .NOT file processing problem with CWD relative file paths
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 7078
diff changeset
    24
# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    25
# Use is subject to license terms.
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    26
#
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    27
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    28
#
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    29
# The 'checks' package contains various checks that may be run
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    30
#
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    31
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    32
__all__ = [
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    33
	'Cddl',
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    34
	'Comments',
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    35
	'Copyright',
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    36
	'CStyle',
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    37
	'HdrChk',
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    38
	'JStyle',
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    39
	'Keywords',
8744
03d5725cda56 6798660 Cadmium .NOT file processing problem with CWD relative file paths
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 7078
diff changeset
    40
	'Mapfile',
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    41
	'Rti',
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    42
	'onSWAN']
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    43
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    44
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    45
import socket
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    46
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    47
# 
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    48
# Generic check to test if a host is on SWAN
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    49
# 
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    50
def onSWAN():
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    51
	try:
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    52
		if socket.gethostbyname("sunweb.central.sun.com."):
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    53
			return True
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    54
		else:
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    55
			return False
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    56
	except:
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents:
diff changeset
    57
		return False