733ed7372ce52463509c62783a184105d3f1a618sommerfe#! /bin/ksh -p
733ed7372ce52463509c62783a184105d3f1a618sommerfe#
733ed7372ce52463509c62783a184105d3f1a618sommerfe# CDDL HEADER START
733ed7372ce52463509c62783a184105d3f1a618sommerfe#
733ed7372ce52463509c62783a184105d3f1a618sommerfe# The contents of this file are subject to the terms of the
733ed7372ce52463509c62783a184105d3f1a618sommerfe# Common Development and Distribution License (the "License").
733ed7372ce52463509c62783a184105d3f1a618sommerfe# You may not use this file except in compliance with the License.
733ed7372ce52463509c62783a184105d3f1a618sommerfe#
733ed7372ce52463509c62783a184105d3f1a618sommerfe# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
733ed7372ce52463509c62783a184105d3f1a618sommerfe# or http://www.opensolaris.org/os/licensing.
733ed7372ce52463509c62783a184105d3f1a618sommerfe# See the License for the specific language governing permissions
733ed7372ce52463509c62783a184105d3f1a618sommerfe# and limitations under the License.
733ed7372ce52463509c62783a184105d3f1a618sommerfe#
733ed7372ce52463509c62783a184105d3f1a618sommerfe# When distributing Covered Code, include this CDDL HEADER in each
733ed7372ce52463509c62783a184105d3f1a618sommerfe# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
733ed7372ce52463509c62783a184105d3f1a618sommerfe# If applicable, add the following below this CDDL HEADER, with the
733ed7372ce52463509c62783a184105d3f1a618sommerfe# fields enclosed by brackets "[]" replaced with your own identifying
733ed7372ce52463509c62783a184105d3f1a618sommerfe# information: Portions Copyright [yyyy] [name of copyright owner]
733ed7372ce52463509c62783a184105d3f1a618sommerfe#
733ed7372ce52463509c62783a184105d3f1a618sommerfe# CDDL HEADER END
733ed7372ce52463509c62783a184105d3f1a618sommerfe#
733ed7372ce52463509c62783a184105d3f1a618sommerfe
733ed7372ce52463509c62783a184105d3f1a618sommerfe#
733ed7372ce52463509c62783a184105d3f1a618sommerfe# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
733ed7372ce52463509c62783a184105d3f1a618sommerfe# Use is subject to license terms.
733ed7372ce52463509c62783a184105d3f1a618sommerfe#
733ed7372ce52463509c62783a184105d3f1a618sommerfe# ident "%Z%%M% %I% %E% SMI"
733ed7372ce52463509c62783a184105d3f1a618sommerfe#
733ed7372ce52463509c62783a184105d3f1a618sommerfe
733ed7372ce52463509c62783a184105d3f1a618sommerfe# Invoked when make thinks a source file is out of touch with SCCS.
733ed7372ce52463509c62783a184105d3f1a618sommerfe
733ed7372ce52463509c62783a184105d3f1a618sommerfe#
733ed7372ce52463509c62783a184105d3f1a618sommerfe# The CDPATH variable causes ksh's `cd' builtin to emit messages to stdout
733ed7372ce52463509c62783a184105d3f1a618sommerfe# under certain circumstances, which can really screw things up; unset it.
733ed7372ce52463509c62783a184105d3f1a618sommerfe#
733ed7372ce52463509c62783a184105d3f1a618sommerfeunset CDPATH
733ed7372ce52463509c62783a184105d3f1a618sommerfe
733ed7372ce52463509c62783a184105d3f1a618sommerfe
733ed7372ce52463509c62783a184105d3f1a618sommerfePATH=/usr/bin:/usr/ccs/bin
733ed7372ce52463509c62783a184105d3f1a618sommerfe
733ed7372ce52463509c62783a184105d3f1a618sommerfeif [ $# -ne 1 ]; then
733ed7372ce52463509c62783a184105d3f1a618sommerfe echo "Usage: $0 filename" 1>&2
733ed7372ce52463509c62783a184105d3f1a618sommerfe exit 1
733ed7372ce52463509c62783a184105d3f1a618sommerfefi
733ed7372ce52463509c62783a184105d3f1a618sommerfe
733ed7372ce52463509c62783a184105d3f1a618sommerfefile="$1"
733ed7372ce52463509c62783a184105d3f1a618sommerfeif [ ! -f "$file" ]; then
733ed7372ce52463509c62783a184105d3f1a618sommerfe (echo "\n$0: error: Source file $file has gone missing!"
733ed7372ce52463509c62783a184105d3f1a618sommerfe echo "$0: error: Check for over-enthusiastic clobber rules\n") 1>&2
733ed7372ce52463509c62783a184105d3f1a618sommerfe exit 1
733ed7372ce52463509c62783a184105d3f1a618sommerfefi
733ed7372ce52463509c62783a184105d3f1a618sommerfe
733ed7372ce52463509c62783a184105d3f1a618sommerfew=warning
733ed7372ce52463509c62783a184105d3f1a618sommerfestatus=0
733ed7372ce52463509c62783a184105d3f1a618sommerfe
733ed7372ce52463509c62783a184105d3f1a618sommerfeif [ ! -z "$SCCSCHECK_FAIL" ]; then
733ed7372ce52463509c62783a184105d3f1a618sommerfe w=error
733ed7372ce52463509c62783a184105d3f1a618sommerfe status=1
733ed7372ce52463509c62783a184105d3f1a618sommerfeelif [ -z "$SCCSCHECK_WARN" ]; then
733ed7372ce52463509c62783a184105d3f1a618sommerfe exit 0
733ed7372ce52463509c62783a184105d3f1a618sommerfefi
733ed7372ce52463509c62783a184105d3f1a618sommerfe
733ed7372ce52463509c62783a184105d3f1a618sommerfecase "$file" in
733ed7372ce52463509c62783a184105d3f1a618sommerfe/*)
733ed7372ce52463509c62783a184105d3f1a618sommerfe ;;
733ed7372ce52463509c62783a184105d3f1a618sommerfe*)
733ed7372ce52463509c62783a184105d3f1a618sommerfe file="./$file";;
733ed7372ce52463509c62783a184105d3f1a618sommerfeesac
733ed7372ce52463509c62783a184105d3f1a618sommerfe
733ed7372ce52463509c62783a184105d3f1a618sommerfesfile="${file%/*}/SCCS/s.${file##*/}"
733ed7372ce52463509c62783a184105d3f1a618sommerfe
733ed7372ce52463509c62783a184105d3f1a618sommerfeif [ "$sfile" -nt "$file" ]; then
733ed7372ce52463509c62783a184105d3f1a618sommerfe (echo "\n$0: $w: In $(pwd)"
733ed7372ce52463509c62783a184105d3f1a618sommerfe echo "$0: $w: $file is out of date:\n"
733ed7372ce52463509c62783a184105d3f1a618sommerfe echo "$0: $w: \c"
733ed7372ce52463509c62783a184105d3f1a618sommerfe ls -E $sfile
733ed7372ce52463509c62783a184105d3f1a618sommerfe echo "$0: $w: \c"
733ed7372ce52463509c62783a184105d3f1a618sommerfe ls -E $file
733ed7372ce52463509c62783a184105d3f1a618sommerfe echo "\n$0: $w: Run bringovercheck ${CODEMGR_WS} to fix this workspace.\n") 1>&2
733ed7372ce52463509c62783a184105d3f1a618sommerfe exit $status
733ed7372ce52463509c62783a184105d3f1a618sommerfefi
733ed7372ce52463509c62783a184105d3f1a618sommerfeexit 0