usr/src/tools/scripts/nightly.sh
author Keith M Wesolowski <wesolows@foobazco.org>
Wed, 17 Jul 2013 17:05:07 -0700
changeset 14225 20c0ad5cefdf
parent 14218 62094c23dbe2
permissions -rw-r--r--
3915 Add adjuncts support to the build Reviewed by: Robert Mustacchi <[email protected]> Reviewed by: Richard Lowe <[email protected]> Approved by: Dan McDonald <[email protected]>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     1
#!/bin/ksh -p
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     2
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     3
# CDDL HEADER START
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     4
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     5
# The contents of this file are subject to the terms of the
900
7a6a7342ba44 6346595 tools changes for split tree
kupfer
parents: 851
diff changeset
     6
# Common Development and Distribution License (the "License").
7a6a7342ba44 6346595 tools changes for split tree
kupfer
parents: 851
diff changeset
     7
# You may not use this file except in compliance with the License.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     8
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     9
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    10
# or http://www.opensolaris.org/os/licensing.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    11
# See the License for the specific language governing permissions
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    12
# and limitations under the License.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    13
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    14
# When distributing Covered Code, include this CDDL HEADER in each
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    15
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    16
# If applicable, add the following below this CDDL HEADER, with the
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    17
# fields enclosed by brackets "[]" replaced with your own identifying
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    18
# information: Portions Copyright [yyyy] [name of copyright owner]
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    19
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    20
# CDDL HEADER END
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    21
#
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
    22
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    23
#
12210
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
    24
# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
13161
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
    25
# Copyright 2008, 2010, Richard Lowe
13272
f7d89c5253a8 450 RFE: Do a small illumos.sh cleanup
Roland Mainz <roland.mainz@nrubsig.org>
parents: 13215
diff changeset
    26
# Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
13655
96f1427cec2e 2059 nightly(1) should support custom From: in mail
Joshua M. Clulow <josh@sysmgr.org>
parents: 13361
diff changeset
    27
# Copyright 2012 Joshua M. Clulow <[email protected]>
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    28
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    29
# Based on the nightly script from the integration folks,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    30
# Mostly modified and owned by mike_s.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    31
# Changes also by kjc, dmk.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    32
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    33
# BRINGOVER_WS may be specified in the env file.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    34
# The default is the old behavior of CLONE_WS
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    35
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    36
# -i on the command line, means fast options, so when it's on the
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
    37
# command line (only), lint and check builds are skipped no matter what
2371
fece52ab5cdc 6417866 The TRACE and GPROF builds must die
sommerfe
parents: 2298
diff changeset
    38
# the setting of their individual flags are in NIGHTLY_OPTIONS.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    39
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    40
# LINTDIRS can be set in the env file, format is a list of:
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    41
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    42
#	/dirname-to-run-lint-on flag
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    43
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    44
#	Where flag is:	y - enable lint noise diff output
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    45
#			n - disable lint noise diff output
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    46
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    47
#	For example: LINTDIRS="$SRC/uts n $SRC/stand y $SRC/psm y"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    48
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    49
# OPTHOME and TEAMWARE may be set in the environment to override /opt
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    50
# and /opt/teamware defaults.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    51
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    52
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    53
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    54
# The CDPATH variable causes ksh's `cd' builtin to emit messages to stdout
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    55
# under certain circumstances, which can really screw things up; unset it.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    56
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    57
unset CDPATH
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    58
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
    59
# Get the absolute path of the nightly script that the user invoked.  This
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
    60
# may be a relative path, and we need to do this before changing directory.
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
    61
nightly_path=`whence $0`
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
    62
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
    63
#
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
    64
# Keep track of where we found nightly so we can invoke the matching
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
    65
# which_scm script.  If that doesn't work, don't go guessing, just rely
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
    66
# on the $PATH settings, which will generally give us either /opt/onbld
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
    67
# or the user's workspace.
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
    68
#
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
    69
WHICH_SCM=$(dirname $nightly_path)/which_scm
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
    70
if [[ ! -x $WHICH_SCM ]]; then
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
    71
	WHICH_SCM=which_scm
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
    72
fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
    73
13272
f7d89c5253a8 450 RFE: Do a small illumos.sh cleanup
Roland Mainz <roland.mainz@nrubsig.org>
parents: 13215
diff changeset
    74
function fatal_error
f7d89c5253a8 450 RFE: Do a small illumos.sh cleanup
Roland Mainz <roland.mainz@nrubsig.org>
parents: 13215
diff changeset
    75
{
f7d89c5253a8 450 RFE: Do a small illumos.sh cleanup
Roland Mainz <roland.mainz@nrubsig.org>
parents: 13215
diff changeset
    76
	print -u2 "nightly: $*"
f7d89c5253a8 450 RFE: Do a small illumos.sh cleanup
Roland Mainz <roland.mainz@nrubsig.org>
parents: 13215
diff changeset
    77
	exit 1
f7d89c5253a8 450 RFE: Do a small illumos.sh cleanup
Roland Mainz <roland.mainz@nrubsig.org>
parents: 13215
diff changeset
    78
}
f7d89c5253a8 450 RFE: Do a small illumos.sh cleanup
Roland Mainz <roland.mainz@nrubsig.org>
parents: 13215
diff changeset
    79
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
    80
#
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
    81
# Function to do a DEBUG and non-DEBUG build. Needed because we might
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    82
# need to do another for the source build, and since we only deliver DEBUG or
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    83
# non-DEBUG packages.
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
    84
#
12210
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
    85
# usage: normal_build
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
    86
#
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
    87
function normal_build {
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    88
4629
963cac9a5d07 6570962 nightly -O should include closed binaries in BFU archives
kupfer
parents: 4174
diff changeset
    89
	typeset orig_p_FLAG="$p_FLAG"
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
    90
	typeset crypto_signer="$CODESIGN_USER"
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
    91
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
    92
	suffix=""
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
    93
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    94
	# non-DEBUG build begins
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    95
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    96
	if [ "$F_FLAG" = "n" ]; then
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
    97
		set_non_debug_build_flags
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
    98
		CODESIGN_USER="$crypto_signer" \
13185
294b1fe4bc7f 6 Need open kcfd
Garrett D'Amore <garrett@nexenta.com>
parents: 13161
diff changeset
    99
		    build "non-DEBUG" "$suffix-nd" "-nd" "$MULTI_PROTO"
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   100
		if [ "$build_ok" = "y" -a "$X_FLAG" = "y" -a \
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   101
		    "$p_FLAG" = "y" ]; then
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   102
			copy_ihv_pkgs non-DEBUG -nd
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   103
		fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   104
	else
4629
963cac9a5d07 6570962 nightly -O should include closed binaries in BFU archives
kupfer
parents: 4174
diff changeset
   105
		echo "\n==== No non-DEBUG $open_only build ====\n" >> "$LOGFILE"
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   106
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   107
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   108
	# non-DEBUG build ends
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   109
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   110
	# DEBUG build begins
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   111
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   112
	if [ "$D_FLAG" = "y" ]; then
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   113
		set_debug_build_flags
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
   114
		CODESIGN_USER="$crypto_signer" \
13185
294b1fe4bc7f 6 Need open kcfd
Garrett D'Amore <garrett@nexenta.com>
parents: 13161
diff changeset
   115
		    build "DEBUG" "$suffix" "" "$MULTI_PROTO"
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   116
		if [ "$build_ok" = "y" -a "$X_FLAG" = "y" -a \
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   117
		    "$p_FLAG" = "y" ]; then
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   118
			copy_ihv_pkgs DEBUG ""
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   119
		fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   120
	else
4629
963cac9a5d07 6570962 nightly -O should include closed binaries in BFU archives
kupfer
parents: 4174
diff changeset
   121
		echo "\n==== No DEBUG $open_only build ====\n" >> "$LOGFILE"
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   122
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   123
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   124
	# DEBUG build ends
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   125
4629
963cac9a5d07 6570962 nightly -O should include closed binaries in BFU archives
kupfer
parents: 4174
diff changeset
   126
	p_FLAG="$orig_p_FLAG"
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   127
}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   128
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   129
#
4973
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   130
# usage: run_hook HOOKNAME ARGS...
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   131
#
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   132
# If variable "$HOOKNAME" is defined, insert a section header into 
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   133
# our logs and then run the command with ARGS
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   134
#
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
   135
function run_hook {
4973
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   136
	HOOKNAME=$1
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   137
    	eval HOOKCMD=\$$HOOKNAME
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   138
	shift
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   139
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   140
	if [ -n "$HOOKCMD" ]; then 
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   141
	    	(
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   142
			echo "\n==== Running $HOOKNAME command: $HOOKCMD ====\n"
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   143
		    	( $HOOKCMD "$@" 2>&1 )
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   144
			if [ "$?" -ne 0 ]; then
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   145
			    	# Let exit status propagate up
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   146
			    	touch $TMPDIR/abort
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   147
			fi
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   148
		) | tee -a $mail_msg_file >> $LOGFILE
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   149
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   150
		if [ -f $TMPDIR/abort ]; then
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   151
			build_ok=n
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   152
			echo "\nAborting at request of $HOOKNAME" |
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   153
				tee -a $mail_msg_file >> $LOGFILE
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   154
			exit 1
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   155
		fi
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   156
	fi
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   157
}
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   158
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
   159
#
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   160
# usage: filelist DESTDIR PATTERN
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   161
#
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
   162
function filelist {
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   163
	DEST=$1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   164
	PATTERN=$2
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   165
	cd ${DEST}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   166
}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   167
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   168
# function to save off binaries after a full build for later
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   169
# restoration
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
   170
function save_binaries {
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   171
	# save off list of binaries
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   172
	echo "\n==== Saving binaries from build at `date` ====\n" | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   173
	    tee -a $mail_msg_file >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   174
	rm -f ${BINARCHIVE}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   175
	cd ${CODEMGR_WS}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   176
	filelist ${CODEMGR_WS} '^preserve:' >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   177
	filelist ${CODEMGR_WS} '^preserve:' | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   178
	    cpio -ocB 2>/dev/null | compress \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   179
	    > ${BINARCHIVE}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   180
}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   181
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   182
# delete files
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   183
# usage: hybridize_files DESTDIR MAKE_TARGET
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
   184
function hybridize_files {
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   185
	DEST=$1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   186
	MAKETARG=$2
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   187
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   188
	echo "\n==== Hybridizing files at `date` ====\n" | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   189
	    tee -a $mail_msg_file >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   190
	for i in `filelist ${DEST} '^delete:'`
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   191
	do
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   192
		echo "removing ${i}." | tee -a $mail_msg_file >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   193
		rm -rf "${i}"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   194
	done
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   195
	for i in `filelist ${DEST} '^hybridize:' `
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   196
	do
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   197
		echo "hybridizing ${i}." | tee -a $mail_msg_file >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   198
		rm -f ${i}+
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   199
		sed -e "/^# HYBRID DELETE START/,/^# HYBRID DELETE END/d" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   200
		    < ${i} > ${i}+
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   201
		mv ${i}+ ${i}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   202
	done
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   203
}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   204
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   205
# restore binaries into the proper source tree.
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   206
# usage: restore_binaries DESTDIR MAKE_TARGET
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
   207
function restore_binaries {
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   208
	DEST=$1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   209
	MAKETARG=$2
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   210
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   211
	echo "\n==== Restoring binaries to ${MAKETARG} at `date` ====\n" | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   212
	    tee -a $mail_msg_file >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   213
	cd ${DEST}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   214
	zcat ${BINARCHIVE} | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   215
	    cpio -idmucvB 2>/dev/null | tee -a $mail_msg_file >> ${LOGFILE}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   216
}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   217
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   218
# rename files we save binaries of
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   219
# usage: rename_files DESTDIR MAKE_TARGET
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
   220
function rename_files {
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   221
	DEST=$1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   222
	MAKETARG=$2
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   223
	echo "\n==== Renaming source files in ${MAKETARG} at `date` ====\n" | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   224
	    tee -a $mail_msg_file >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   225
	for i in `filelist ${DEST} '^rename:'`
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   226
	do
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   227
		echo ${i} | tee -a $mail_msg_file >> ${LOGFILE}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   228
		rm -f ${i}.export
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   229
		mv ${i} ${i}.export
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   230
	done
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   231
}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   232
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   233
#
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   234
# Copy some or all of the source tree.
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   235
#
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   236
# Returns 0 for success, non-zero for failure.
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   237
#
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   238
# usage: copy_source CODEMGR_WS DESTDIR LABEL SRCROOT
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   239
#
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
   240
function copy_source {
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   241
	WS=$1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   242
	DEST=$2
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   243
	label=$3
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   244
	srcroot=$4
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   245
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   246
	printf "\n==== Creating %s source from %s (%s) ====\n\n" \
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   247
	    "$DEST" "$WS" "$label" | tee -a $mail_msg_file >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   248
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   249
	printf "cleaning out %s\n" "$DEST." >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   250
	rm -rf "$DEST" >> $LOGFILE 2>&1
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   251
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   252
	printf "creating %s\n" "$DEST." >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   253
	mkdir -p "$DEST" 2>> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   254
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   255
	if (( $? != 0 )) ; then
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   256
		printf "failed to create %s\n" "$DEST" |
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   257
		    tee -a $mail_msg_file >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   258
		build_ok=n
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   259
		return 1
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   260
	fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   261
	cd "$WS"
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   262
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   263
	printf "populating %s\n" "$DEST." >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   264
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   265
	case "$SCM_TYPE" in
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   266
	teamware)
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   267
		find $srcroot -name 's\.*' -a -type f -print | \
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   268
		    sed -e 's,SCCS\/s.,,' | \
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   269
		    grep -v '/\.del-*' | \
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   270
		    cpio -pd $DEST >>$LOGFILE 2>&1
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   271
		if (( $? != 0 )) ; then
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   272
		    printf "cpio failed for %s\n" "$DEST" |
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   273
			tee -a $mail_msg_file >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   274
		    build_ok=n
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   275
		    return 1
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   276
		fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   277
		;;
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   278
	mercurial)
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   279
		copy_source_mercurial $DEST $srcroot
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   280
		if (( $? != 0 )) ; then
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   281
		    build_ok=n
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   282
		    return 1
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   283
		fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   284
		;;
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   285
	*)
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   286
		build_ok=n
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   287
		echo "Tree copy is not supported for workspace type" \
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   288
		    "$SCM_TYPE" | tee -a $mail_msg_file >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   289
		return 1
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   290
		;;
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   291
	esac
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   292
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   293
	return 0
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   294
}
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   295
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   296
#
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   297
# Mercurial-specific copy code for copy_source().  Handles the
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   298
# combined open and closed trees.
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   299
#
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   300
# Returns 0 for success, non-zero for failure.
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   301
#
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   302
# usage: copy_source_mercurial destdir srcroot
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   303
#
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   304
function copy_source_mercurial {
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   305
	typeset dest=$1
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   306
	typeset srcroot=$2
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   307
	typeset open_top closed_top
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   308
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   309
	case $srcroot in
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   310
	usr)
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   311
		open_top=usr
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   312
		if [[ "$CLOSED_IS_PRESENT" = yes ]]; then
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   313
			closed_top=usr/closed
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   314
		fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   315
		;;
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   316
	usr/closed*)
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   317
		if [[ "$CLOSED_IS_PRESENT" = no ]]; then
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   318
			printf "can't copy %s: closed tree not present.\n" \
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   319
			    "$srcroot" | tee -a $mail_msg_file >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   320
			return 1
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   321
		fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   322
		closed_top="$srcroot"
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   323
		;;
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   324
	*)
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   325
		open_top="$srcroot"
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   326
		;;
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   327
	esac		
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   328
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   329
	if [[ -n "$open_top" ]]; then
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   330
		hg locate -I "$open_top" | cpio -pd "$dest" >>$LOGFILE 2>&1
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   331
		if (( $? != 0 )) ; then
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   332
		    printf "cpio failed for %s\n" "$dest" |
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   333
			tee -a $mail_msg_file >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   334
		    return 1
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   335
		fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   336
	fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   337
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   338
	if [[ -n "$closed_top" ]]; then
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   339
		mkdir -p "$dest/usr/closed" || return 1
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   340
		if [[ "$closed_top" = usr/closed ]]; then
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   341
			(cd usr/closed; hg locate |
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   342
			    cpio -pd "$dest/usr/closed") >>$LOGFILE 2>&1
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   343
			if (( $? != 0 )) ; then
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   344
			    printf "cpio failed for %s/usr/closed\n" \
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   345
				"$dest" | tee -a $mail_msg_file >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   346
			    return 1
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   347
			fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   348
		else
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   349
			# copy subtree of usr/closed
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   350
			closed_top=${closed_top#usr/closed/}
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   351
			(cd usr/closed; hg locate -I "$closed_top" |
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   352
			    cpio -pd "$dest/usr/closed") >>$LOGFILE 2>&1
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   353
			if (( $? != 0 )) ; then
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   354
			    printf "cpio failed for %s/usr/closed/%s\n" \
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   355
				"$dest" "$closed_top" |
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   356
				tee -a $mail_msg_file >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   357
			    return 1
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   358
			fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   359
		fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   360
	fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   361
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   362
	return 0
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   363
}
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   364
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   365
#
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   366
# function to create (but not build) the export/crypt source tree.
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   367
# usage: set_up_source_build CODEMGR_WS DESTDIR MAKE_TARGET
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   368
# Sets SRC to the modified source tree, for use by the caller when it
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   369
# builds the tree.
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   370
#
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
   371
function set_up_source_build {
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   372
	WS=$1
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   373
	DEST=$2
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   374
	MAKETARG=$3
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   375
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   376
	copy_source $WS $DEST $MAKETARG usr
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   377
	if (( $? != 0 )); then
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   378
	    echo "\nCould not copy source tree for source build." |
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   379
		tee -a $mail_msg_file >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   380
	    build_ok=n
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   381
	    return
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   382
	fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   383
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   384
	SRC=${DEST}/usr/src
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   385
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   386
	cd $SRC
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   387
	rm -f ${MAKETARG}.out
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   388
	echo "making ${MAKETARG} in ${SRC}." >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   389
	/bin/time $MAKE -e ${MAKETARG} 2>&1 | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   390
	    tee -a $SRC/${MAKETARG}.out >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   391
	echo "\n==== ${MAKETARG} build errors ====\n" >> $mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   392
	egrep ":" $SRC/${MAKETARG}.out | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   393
		egrep -e "(^${MAKE}:|[ 	]error[: 	\n])" | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   394
		egrep -v "Ignoring unknown host" | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   395
		egrep -v "warning" >> $mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   396
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   397
	echo "clearing state files." >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   398
	find . -name '.make*' -exec rm -f {} \;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   399
}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   400
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   401
# Return library search directive as function of given root.
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
   402
function myldlibs {
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   403
	echo "-L$1/lib -L$1/usr/lib"
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   404
}
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   405
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   406
# Return header search directive as function of given root.
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
   407
function myheaders {
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   408
	echo "-I$1/usr/include"
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   409
}
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   410
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   411
#
12776
0a254b4b5ca4 6932341 bfu should be removed
jmcp <James.McPherson@Sun.COM>
parents: 12658
diff changeset
   412
# Function to do the build, including package generation.
13185
294b1fe4bc7f 6 Need open kcfd
Garrett D'Amore <garrett@nexenta.com>
parents: 13161
diff changeset
   413
# usage: build LABEL SUFFIX ND MULTIPROTO
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   414
# - LABEL is used to tag build output.
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   415
# - SUFFIX is used to distinguish files (e.g., DEBUG vs non-DEBUG,
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
   416
#   open-only vs full tree).
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   417
# - ND is "-nd" (non-DEBUG builds) or "" (DEBUG builds).
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   418
# - If MULTIPROTO is "yes", it means to name the proto area according to
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   419
#   SUFFIX.  Otherwise ("no"), (re)use the standard proto area.
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   420
#
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
   421
function build {
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   422
	LABEL=$1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   423
	SUFFIX=$2
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
   424
	ND=$3
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
   425
	MULTIPROTO=$4
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   426
	INSTALLOG=install${SUFFIX}-${MACH}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   427
	NOISE=noise${SUFFIX}-${MACH}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   428
	PKGARCHIVE=${PKGARCHIVE_ORIG}${SUFFIX}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   429
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   430
	ORIGROOT=$ROOT
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   431
	[ $MULTIPROTO = no ] || export ROOT=$ROOT$SUFFIX
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   432
12210
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
   433
	if [[ "$O_FLAG" = y ]]; then
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
   434
		echo "\nSetting CLOSEDROOT= ${ROOT}-closed\n" >> $LOGFILE
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
   435
		export CLOSEDROOT=${ROOT}-closed
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
   436
	fi
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
   437
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   438
	export ENVLDLIBS1=`myldlibs $ROOT`
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   439
	export ENVCPPFLAGS1=`myheaders $ROOT`
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   440
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   441
	this_build_ok=y
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   442
	#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   443
	#	Build OS-Networking source
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   444
	#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   445
	echo "\n==== Building OS-Net source at `date` ($LABEL) ====\n" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   446
		>> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   447
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   448
	rm -f $SRC/${INSTALLOG}.out
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   449
	cd $SRC
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   450
	/bin/time $MAKE -e install 2>&1 | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   451
	    tee -a $SRC/${INSTALLOG}.out >> $LOGFILE
1810
da7eacf55e82 6407796 "sccs get" rule considered harmful
sommerfe
parents: 1729
diff changeset
   452
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   453
	if [[ "$SCM_TYPE" = teamware ]]; then
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   454
		echo "\n==== SCCS Noise ($LABEL) ====\n" >> $mail_msg_file
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   455
		egrep 'sccs(check:| *get)' $SRC/${INSTALLOG}.out >> \
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   456
			$mail_msg_file
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   457
	fi
1810
da7eacf55e82 6407796 "sccs get" rule considered harmful
sommerfe
parents: 1729
diff changeset
   458
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   459
	echo "\n==== Build errors ($LABEL) ====\n" >> $mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   460
	egrep ":" $SRC/${INSTALLOG}.out |
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   461
		egrep -e "(^${MAKE}:|[ 	]error[: 	\n])" | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   462
		egrep -v "Ignoring unknown host" | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   463
		egrep -v "cc .* -o error " | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   464
		egrep -v "warning" >> $mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   465
	if [ "$?" = "0" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   466
		build_ok=n
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   467
		this_build_ok=n
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   468
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   469
	grep "bootblock image is .* bytes too big" $SRC/${INSTALLOG}.out \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   470
		>> $mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   471
	if [ "$?" = "0" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   472
		build_ok=n
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   473
		this_build_ok=n
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   474
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   475
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   476
	if [ "$W_FLAG" = "n" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   477
		echo "\n==== Build warnings ($LABEL) ====\n" >>$mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   478
		egrep -i warning: $SRC/${INSTALLOG}.out \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   479
			| egrep -v '^tic:' \
11690
1c19a1778a4f 6914728 Add dl_iterate_phdr() function to ld.so.1
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 11575
diff changeset
   480
			| egrep -v "symbol (\`|')timezone' has differing types:" \
2298
8cac95e27f87 4416654 warning filter list in nightly should be cleaned up (fix whitespace)
meem
parents: 2294
diff changeset
   481
		        | egrep -v "parameter <PSTAMP> set to" \
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   482
			| egrep -v "Ignoring unknown host" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   483
			| egrep -v "redefining segment flags attribute for" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   484
			>> $mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   485
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   486
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   487
	echo "\n==== Ended OS-Net source build at `date` ($LABEL) ====\n" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   488
		>> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   489
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   490
	echo "\n==== Elapsed build time ($LABEL) ====\n" >>$mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   491
	tail -3  $SRC/${INSTALLOG}.out >>$mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   492
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   493
	if [ "$i_FLAG" = "n" -a "$W_FLAG" = "n" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   494
		rm -f $SRC/${NOISE}.ref
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   495
		if [ -f $SRC/${NOISE}.out ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   496
			mv $SRC/${NOISE}.out $SRC/${NOISE}.ref
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   497
		fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   498
		grep : $SRC/${INSTALLOG}.out \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   499
			| egrep -v '^/' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   500
			| egrep -v '^(Start|Finish|real|user|sys|./bld_awk)' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   501
			| egrep -v '^tic:' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   502
			| egrep -v '^mcs' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   503
			| egrep -v '^LD_LIBRARY_PATH=' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   504
			| egrep -v 'ar: creating' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   505
			| egrep -v 'ar: writing' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   506
			| egrep -v 'conflicts:' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   507
			| egrep -v ':saved created' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   508
			| egrep -v '^stty.*c:' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   509
			| egrep -v '^mfgname.c:' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   510
			| egrep -v '^uname-i.c:' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   511
			| egrep -v '^volumes.c:' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   512
			| egrep -v '^lint library construction:' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   513
			| egrep -v 'tsort: INFORM:' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   514
			| egrep -v 'stripalign:' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   515
			| egrep -v 'chars, width' \
11690
1c19a1778a4f 6914728 Add dl_iterate_phdr() function to ld.so.1
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 11575
diff changeset
   516
			| egrep -v "symbol (\`|')timezone' has differing types:" \
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   517
			| egrep -v 'PSTAMP' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   518
			| egrep -v '|%WHOANDWHERE%|' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   519
			| egrep -v '^Manifying' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   520
			| egrep -v 'Ignoring unknown host' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   521
			| egrep -v 'Processing method:' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   522
			| egrep -v '^Writing' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   523
			| egrep -v 'spellin1:' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   524
			| egrep -v '^adding:' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   525
			| egrep -v "^echo 'msgid" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   526
			| egrep -v '^echo ' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   527
			| egrep -v '\.c:$' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   528
			| egrep -v '^Adding file:' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   529
			| egrep -v 'CLASSPATH=' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   530
			| egrep -v '\/var\/mail\/:saved' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   531
			| egrep -v -- '-DUTS_VERSION=' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   532
			| egrep -v '^Running Mkbootstrap' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   533
			| egrep -v '^Applet length read:' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   534
			| egrep -v 'bytes written:' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   535
			| egrep -v '^File:SolarisAuthApplet.bin' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   536
			| egrep -v -i 'jibversion' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   537
			| egrep -v '^Output size:' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   538
			| egrep -v '^Solo size statistics:' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   539
			| egrep -v '^Using ROM API Version' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   540
			| egrep -v '^Zero Signature length:' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   541
			| egrep -v '^Note \(probably harmless\):' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   542
			| egrep -v '::' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   543
			| egrep -v -- '-xcache' \
411
ae71859f7fc8 6302154 fix for 6297567 introduces some undesirable output changes
wesolows
parents: 338
diff changeset
   544
			| egrep -v '^\+' \
1729
6adc0fdde479 6242262 ON should be buildable with gcc (fix build noise)
wesolows
parents: 1557
diff changeset
   545
			| egrep -v '^cc1: note: -fwritable-strings' \
2730
dc5dc85d6c88 6452279 svc-snmpdx shouldn't ignore return code from daemon startup
johnz
parents: 2639
diff changeset
   546
			| egrep -v 'svccfg-native -s svc:/' \
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   547
			| sort | uniq >$SRC/${NOISE}.out
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   548
		if [ ! -f $SRC/${NOISE}.ref ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   549
			cp $SRC/${NOISE}.out $SRC/${NOISE}.ref
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   550
		fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   551
		echo "\n==== Build noise differences ($LABEL) ====\n" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   552
			>>$mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   553
		diff $SRC/${NOISE}.ref $SRC/${NOISE}.out >>$mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   554
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   555
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   556
	#
3824
5e04e5a474b4 6501102 elfsigning of crypto modules needs to be done by ON gatekeeping staff
rotondo
parents: 3644
diff changeset
   557
	#	Re-sign selected binaries using signing server
5e04e5a474b4 6501102 elfsigning of crypto modules needs to be done by ON gatekeeping staff
rotondo
parents: 3644
diff changeset
   558
	#	(gatekeeper builds only)
5e04e5a474b4 6501102 elfsigning of crypto modules needs to be done by ON gatekeeping staff
rotondo
parents: 3644
diff changeset
   559
	#
4174
e72663e55221 6550077 signproto/signit don't produce ERROR if ssh fails
johnz
parents: 4162
diff changeset
   560
	if [ -n "$CODESIGN_USER" -a "$this_build_ok" = "y" ]; then
3824
5e04e5a474b4 6501102 elfsigning of crypto modules needs to be done by ON gatekeeping staff
rotondo
parents: 3644
diff changeset
   561
		echo "\n==== Signing proto area at `date` ====\n" >> $LOGFILE
5e04e5a474b4 6501102 elfsigning of crypto modules needs to be done by ON gatekeeping staff
rotondo
parents: 3644
diff changeset
   562
		signing_file="${TMPDIR}/signing"
5e04e5a474b4 6501102 elfsigning of crypto modules needs to be done by ON gatekeeping staff
rotondo
parents: 3644
diff changeset
   563
		rm -f ${signing_file}
5e04e5a474b4 6501102 elfsigning of crypto modules needs to be done by ON gatekeeping staff
rotondo
parents: 3644
diff changeset
   564
		export CODESIGN_USER
5e04e5a474b4 6501102 elfsigning of crypto modules needs to be done by ON gatekeeping staff
rotondo
parents: 3644
diff changeset
   565
		signproto $SRC/tools/codesign/creds 2>&1 | \
5e04e5a474b4 6501102 elfsigning of crypto modules needs to be done by ON gatekeeping staff
rotondo
parents: 3644
diff changeset
   566
			tee -a ${signing_file} >> $LOGFILE
5e04e5a474b4 6501102 elfsigning of crypto modules needs to be done by ON gatekeeping staff
rotondo
parents: 3644
diff changeset
   567
		echo "\n==== Finished signing proto area at `date` ====\n" \
5e04e5a474b4 6501102 elfsigning of crypto modules needs to be done by ON gatekeeping staff
rotondo
parents: 3644
diff changeset
   568
		    >> $LOGFILE
5e04e5a474b4 6501102 elfsigning of crypto modules needs to be done by ON gatekeeping staff
rotondo
parents: 3644
diff changeset
   569
		echo "\n==== Crypto module signing errors ($LABEL) ====\n" \
5e04e5a474b4 6501102 elfsigning of crypto modules needs to be done by ON gatekeeping staff
rotondo
parents: 3644
diff changeset
   570
		    >> $mail_msg_file
5e04e5a474b4 6501102 elfsigning of crypto modules needs to be done by ON gatekeeping staff
rotondo
parents: 3644
diff changeset
   571
		egrep 'WARNING|ERROR' ${signing_file} >> $mail_msg_file
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   572
		if (( $? == 0 )) ; then
4174
e72663e55221 6550077 signproto/signit don't produce ERROR if ssh fails
johnz
parents: 4162
diff changeset
   573
			build_ok=n
e72663e55221 6550077 signproto/signit don't produce ERROR if ssh fails
johnz
parents: 4162
diff changeset
   574
			this_build_ok=n
e72663e55221 6550077 signproto/signit don't produce ERROR if ssh fails
johnz
parents: 4162
diff changeset
   575
		fi
3824
5e04e5a474b4 6501102 elfsigning of crypto modules needs to be done by ON gatekeeping staff
rotondo
parents: 3644
diff changeset
   576
	fi
5e04e5a474b4 6501102 elfsigning of crypto modules needs to be done by ON gatekeeping staff
rotondo
parents: 3644
diff changeset
   577
5e04e5a474b4 6501102 elfsigning of crypto modules needs to be done by ON gatekeeping staff
rotondo
parents: 3644
diff changeset
   578
	#
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   579
	#	Building Packages
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   580
	#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   581
	if [ "$p_FLAG" = "y" -a "$this_build_ok" = "y" ]; then
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   582
		if [ -d $SRC/pkg -o -d $SRC/pkgdefs ]; then
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   583
			echo "\n==== Creating $LABEL packages at `date` ====\n" \
338
05079e64a96e 6308636 need method of rebuilding sparc SUNWrmodu
jg
parents: 0
diff changeset
   584
				>> $LOGFILE
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   585
			echo "Clearing out $PKGARCHIVE ..." >> $LOGFILE
11961
cf8b29303819 6935095 nightly.sh is once again borked for SFW
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 11855
diff changeset
   586
			rm -rf $PKGARCHIVE >> "$LOGFILE" 2>&1
cf8b29303819 6935095 nightly.sh is once again borked for SFW
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 11855
diff changeset
   587
			mkdir -p $PKGARCHIVE >> "$LOGFILE" 2>&1
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   588
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   589
			for d in pkg pkgdefs; do
11961
cf8b29303819 6935095 nightly.sh is once again borked for SFW
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 11855
diff changeset
   590
				if [ ! -f "$SRC/$d/Makefile" ]; then
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   591
					continue
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   592
				fi
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   593
				rm -f $SRC/$d/${INSTALLOG}.out
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   594
				cd $SRC/$d
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   595
				/bin/time $MAKE -e install 2>&1 | \
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   596
					tee -a $SRC/$d/${INSTALLOG}.out >> $LOGFILE
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   597
			done
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   598
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   599
			echo "\n==== package build errors ($LABEL) ====\n" \
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   600
				>> $mail_msg_file
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   601
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   602
			for d in pkg pkgdefs; do
11961
cf8b29303819 6935095 nightly.sh is once again borked for SFW
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 11855
diff changeset
   603
				if [ ! -f "$SRC/$d/Makefile" ]; then
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   604
					continue
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   605
				fi
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   606
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   607
				egrep "${MAKE}|ERROR|WARNING" $SRC/$d/${INSTALLOG}.out | \
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   608
					grep ':' | \
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   609
					grep -v PSTAMP | \
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   610
					egrep -v "Ignoring unknown host" \
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   611
					>> $mail_msg_file
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   612
			done
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   613
		else
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   614
			#
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   615
			# Handle it gracefully if -p was set but there are
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   616
			# neither pkg nor pkgdefs directories.
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   617
			#
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   618
			echo "\n==== No $LABEL packages to build ====\n" \
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   619
				>> $LOGFILE
338
05079e64a96e 6308636 need method of rebuilding sparc SUNWrmodu
jg
parents: 0
diff changeset
   620
		fi
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   621
	else
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   622
		echo "\n==== Not creating $LABEL packages ====\n" >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   623
	fi
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   624
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   625
	ROOT=$ORIGROOT
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   626
}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   627
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   628
# Usage: dolint /dir y|n
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   629
# Arg. 2 is a flag to turn on/off the lint diff output
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
   630
function dolint {
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   631
	if [ ! -d "$1" ]; then
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   632
		echo "dolint error: $1 is not a directory"
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   633
		exit 1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   634
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   635
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   636
	if [ "$2" != "y" -a "$2" != "n" ]; then
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   637
		echo "dolint internal error: $2 should be 'y' or 'n'"
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   638
		exit 1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   639
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   640
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   641
	lintdir=$1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   642
	dodiff=$2
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   643
	base=`basename $lintdir`
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   644
	LINTOUT=$lintdir/lint-${MACH}.out
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   645
	LINTNOISE=$lintdir/lint-noise-${MACH}
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   646
	export ENVLDLIBS1=`myldlibs $ROOT`
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   647
	export ENVCPPFLAGS1=`myheaders $ROOT`
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   648
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   649
	set_debug_build_flags
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   650
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   651
	#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   652
	#	'$MAKE lint' in $lintdir
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   653
	#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   654
	echo "\n==== Begin '$MAKE lint' of $base at `date` ====\n" >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   655
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   656
	# remove old lint.out
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   657
	rm -f $lintdir/lint.out $lintdir/lint-noise.out
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   658
	if [ -f $lintdir/lint-noise.ref ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   659
		mv $lintdir/lint-noise.ref ${LINTNOISE}.ref
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   660
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   661
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   662
	rm -f $LINTOUT
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   663
	cd $lintdir
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   664
	#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   665
	# Remove all .ln files to ensure a full reference file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   666
	#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   667
	rm -f Nothing_to_remove \
13660
189bdb3d9698 1960 developer tools should support git
Richard Lowe <richlowe@richlowe.net>
parents: 13655
diff changeset
   668
	    `find . \( -name SCCS -o -name .hg -o -name .svn -o -name .git \) \
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   669
	    	-prune -o -type f -name '*.ln' -print `
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   670
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   671
	/bin/time $MAKE -ek lint 2>&1 | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   672
	    tee -a $LINTOUT >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   673
	echo "\n==== '$MAKE lint' of $base ERRORS ====\n" >> $mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   674
	grep "$MAKE:" $LINTOUT |
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   675
		egrep -v "Ignoring unknown host" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   676
		>> $mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   677
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   678
	echo "\n==== Ended '$MAKE lint' of $base at `date` ====\n" >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   679
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   680
	echo "\n==== Elapsed time of '$MAKE lint' of $base ====\n" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   681
		>>$mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   682
	tail -3  $LINTOUT >>$mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   683
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   684
	rm -f ${LINTNOISE}.ref
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   685
	if [ -f ${LINTNOISE}.out ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   686
		mv ${LINTNOISE}.out ${LINTNOISE}.ref
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   687
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   688
        grep : $LINTOUT | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   689
		egrep -v '^(real|user|sys)' |
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   690
		egrep -v '(library construction)' | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   691
		egrep -v ': global crosschecks' | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   692
		egrep -v 'Ignoring unknown host' | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   693
		egrep -v '\.c:$' | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   694
		sort | uniq > ${LINTNOISE}.out
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   695
	if [ ! -f ${LINTNOISE}.ref ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   696
		cp ${LINTNOISE}.out ${LINTNOISE}.ref
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   697
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   698
	if [ "$dodiff" != "n" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   699
		echo "\n==== lint warnings $base ====\n" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   700
			>>$mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   701
		# should be none, though there are a few that were filtered out
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   702
		# above
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   703
		egrep -i '(warning|lint):' ${LINTNOISE}.out \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   704
			| sort | uniq >> $mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   705
		echo "\n==== lint noise differences $base ====\n" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   706
			>> $mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   707
		diff ${LINTNOISE}.ref ${LINTNOISE}.out \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   708
			>> $mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   709
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   710
}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   711
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   712
# Install proto area from IHV build
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   713
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
   714
function copy_ihv_proto {
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   715
2868
c6c11cf3e587 6460124 nightly -X doesn't properly copy the IHV proto area
dduvall
parents: 2730
diff changeset
   716
	echo "\n==== Installing IHV proto area ====\n" \
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   717
		>> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   718
	if [ -d "$IA32_IHV_ROOT" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   719
		if [ ! -d "$ROOT" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   720
			echo "mkdir -p $ROOT" >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   721
			mkdir -p $ROOT
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   722
		fi
2868
c6c11cf3e587 6460124 nightly -X doesn't properly copy the IHV proto area
dduvall
parents: 2730
diff changeset
   723
		echo "copying $IA32_IHV_ROOT to $ROOT\n" >> $LOGFILE
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   724
		cd $IA32_IHV_ROOT
12210
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
   725
		tar cf - . | (cd $ROOT; umask 0; tar xpf - ) 2>&1 >> $LOGFILE
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   726
	else
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   727
		echo "$IA32_IHV_ROOT: not found" >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   728
	fi
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   729
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   730
	if [ "$MULTI_PROTO" = yes ]; then
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   731
		if [ ! -d "$ROOT-nd" ]; then
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   732
			echo "mkdir -p $ROOT-nd" >> $LOGFILE
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   733
			mkdir -p $ROOT-nd
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   734
		fi
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   735
		# If there's a non-DEBUG version of the IHV proto area,
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   736
		# copy it, but copy something if there's not.
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   737
		if [ -d "$IA32_IHV_ROOT-nd" ]; then
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   738
			echo "copying $IA32_IHV_ROOT-nd to $ROOT-nd\n" >> $LOGFILE
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   739
			cd $IA32_IHV_ROOT-nd
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   740
		elif [ -d "$IA32_IHV_ROOT" ]; then
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   741
			echo "copying $IA32_IHV_ROOT to $ROOT-nd\n" >> $LOGFILE
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   742
			cd $IA32_IHV_ROOT
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   743
		else
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   744
			echo "$IA32_IHV_ROOT{-nd,}: not found" >> $LOGFILE
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   745
			return
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   746
		fi
12210
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
   747
		tar cf - . | (cd $ROOT-nd; umask 0; tar xpf - ) 2>&1 >> $LOGFILE
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   748
	fi
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   749
}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   750
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   751
# Install IHV packages in PKGARCHIVE
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   752
# usage: copy_ihv_pkgs LABEL SUFFIX
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
   753
function copy_ihv_pkgs {
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   754
	LABEL=$1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   755
	SUFFIX=$2
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   756
	# always use non-DEBUG IHV packages
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   757
	IA32_IHV_PKGS=${IA32_IHV_PKGS_ORIG}-nd
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   758
	PKGARCHIVE=${PKGARCHIVE_ORIG}${SUFFIX}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   759
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   760
	echo "\n==== Installing IHV packages from $IA32_IHV_PKGS ($LABEL) ====\n" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   761
		>> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   762
	if [ -d "$IA32_IHV_PKGS" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   763
		cd $IA32_IHV_PKGS
12210
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
   764
		tar cf - * | \
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   765
		   (cd $PKGARCHIVE; umask 0; tar xpf - ) 2>&1 >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   766
	else
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   767
		echo "$IA32_IHV_PKGS: not found" >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   768
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   769
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   770
	echo "\n==== Installing IHV packages from $IA32_IHV_BINARY_PKGS ($LABEL) ====\n" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   771
		>> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   772
	if [ -d "$IA32_IHV_BINARY_PKGS" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   773
		cd $IA32_IHV_BINARY_PKGS
12210
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
   774
		tar cf - * | \
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   775
		    (cd $PKGARCHIVE; umask 0; tar xpf - ) 2>&1 >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   776
	else
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   777
		echo "$IA32_IHV_BINARY_PKGS: not found" >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   778
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   779
}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   780
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   781
#
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   782
# Build and install the onbld tools.
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   783
#
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   784
# usage: build_tools DESTROOT
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   785
#
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   786
# returns non-zero status if the build was successful.
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   787
#
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
   788
function build_tools {
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   789
	DESTROOT=$1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   790
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   791
	INSTALLOG=install-${MACH}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   792
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   793
	echo "\n==== Building tools at `date` ====\n" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   794
		>> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   795
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   796
	rm -f ${TOOLS}/${INSTALLOG}.out
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   797
	cd ${TOOLS}
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   798
	/bin/time $MAKE TOOLS_PROTO=${DESTROOT} -e install 2>&1 | \
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   799
	    tee -a ${TOOLS}/${INSTALLOG}.out >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   800
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   801
	echo "\n==== Tools build errors ====\n" >> $mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   802
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   803
	egrep ":" ${TOOLS}/${INSTALLOG}.out |
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   804
		egrep -e "(${MAKE}:|[ 	]error[: 	\n])" | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   805
		egrep -v "Ignoring unknown host" | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   806
		egrep -v warning >> $mail_msg_file
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   807
	return $?
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   808
}
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   809
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   810
#
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   811
# Set up to use locally installed tools.
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   812
#
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   813
# usage: use_tools TOOLSROOT
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   814
#
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
   815
function use_tools {
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   816
	TOOLSROOT=$1
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   817
12374
108edb7148a6 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds (fix sfw)
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12277
diff changeset
   818
	#
108edb7148a6 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds (fix sfw)
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12277
diff changeset
   819
	# If we're not building ON workspace, then the TOOLSROOT
108edb7148a6 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds (fix sfw)
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12277
diff changeset
   820
	# settings here are clearly ignored by the workspace
108edb7148a6 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds (fix sfw)
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12277
diff changeset
   821
	# makefiles, prepending nonexistent directories to PATH is
108edb7148a6 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds (fix sfw)
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12277
diff changeset
   822
	# harmless, and we clearly do not wish to override
108edb7148a6 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds (fix sfw)
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12277
diff changeset
   823
	# ONBLD_TOOLS.
108edb7148a6 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds (fix sfw)
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12277
diff changeset
   824
	#
108edb7148a6 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds (fix sfw)
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12277
diff changeset
   825
	# If we're building an ON workspace, then the prepended PATH
108edb7148a6 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds (fix sfw)
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12277
diff changeset
   826
	# elements should supercede the preexisting ONBLD_TOOLS paths,
108edb7148a6 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds (fix sfw)
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12277
diff changeset
   827
	# and we want to override ONBLD_TOOLS to catch the tools that
108edb7148a6 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds (fix sfw)
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12277
diff changeset
   828
	# don't have specific path env vars here.
108edb7148a6 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds (fix sfw)
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12277
diff changeset
   829
	#
108edb7148a6 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds (fix sfw)
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12277
diff changeset
   830
	# So the only conditional behavior is overriding ONBLD_TOOLS,
108edb7148a6 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds (fix sfw)
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12277
diff changeset
   831
	# and we check for "an ON workspace" by looking for
108edb7148a6 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds (fix sfw)
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12277
diff changeset
   832
	# ${TOOLSROOT}/opt/onbld.
108edb7148a6 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds (fix sfw)
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12277
diff changeset
   833
	#
108edb7148a6 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds (fix sfw)
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12277
diff changeset
   834
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   835
	STABS=${TOOLSROOT}/opt/onbld/bin/${MACH}/stabs
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   836
	export STABS
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   837
	CTFSTABS=${TOOLSROOT}/opt/onbld/bin/${MACH}/ctfstabs
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   838
	export CTFSTABS
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   839
	GENOFFSETS=${TOOLSROOT}/opt/onbld/bin/genoffsets
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   840
	export GENOFFSETS
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   841
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   842
	CTFCONVERT=${TOOLSROOT}/opt/onbld/bin/${MACH}/ctfconvert
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   843
	export CTFCONVERT
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   844
	CTFMERGE=${TOOLSROOT}/opt/onbld/bin/${MACH}/ctfmerge
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   845
	export CTFMERGE
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   846
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   847
	CTFCVTPTBL=${TOOLSROOT}/opt/onbld/bin/ctfcvtptbl
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   848
	export CTFCVTPTBL
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   849
	CTFFINDMOD=${TOOLSROOT}/opt/onbld/bin/ctffindmod
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   850
	export CTFFINDMOD
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   851
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   852
	if [ "$VERIFY_ELFSIGN" = "y" ]; then
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   853
		ELFSIGN=${TOOLSROOT}/opt/onbld/bin/elfsigncmp
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   854
	else
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   855
		ELFSIGN=${TOOLSROOT}/opt/onbld/bin/${MACH}/elfsign
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   856
	fi
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   857
	export ELFSIGN
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   858
12374
108edb7148a6 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds (fix sfw)
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12277
diff changeset
   859
	PATH="${TOOLSROOT}/opt/onbld/bin/${MACH}:${PATH}"
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   860
	PATH="${TOOLSROOT}/opt/onbld/bin:${PATH}"
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   861
	export PATH
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   862
12374
108edb7148a6 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds (fix sfw)
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12277
diff changeset
   863
	if [ -d "${TOOLSROOT}/opt/onbld" ]; then
108edb7148a6 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds (fix sfw)
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12277
diff changeset
   864
		ONBLD_TOOLS=${TOOLSROOT}/opt/onbld
108edb7148a6 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds (fix sfw)
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12277
diff changeset
   865
		export ONBLD_TOOLS
108edb7148a6 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds (fix sfw)
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12277
diff changeset
   866
	fi
10222
bc1378aafa34 6867214 nightly issues message about all new env vars from -t except ONBLD_TOOLS
Dan Mick <Dan.Mick@Sun.COM>
parents: 10194
diff changeset
   867
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   868
	echo "\n==== New environment settings. ====\n" >> $LOGFILE
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   869
	echo "STABS=${STABS}" >> $LOGFILE
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   870
	echo "CTFSTABS=${CTFSTABS}" >> $LOGFILE
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   871
	echo "CTFCONVERT=${CTFCONVERT}" >> $LOGFILE
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   872
	echo "CTFMERGE=${CTFMERGE}" >> $LOGFILE
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   873
	echo "CTFCVTPTBL=${CTFCVTPTBL}" >> $LOGFILE
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   874
	echo "CTFFINDMOD=${CTFFINDMOD}" >> $LOGFILE
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   875
	echo "ELFSIGN=${ELFSIGN}" >> $LOGFILE
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   876
	echo "PATH=${PATH}" >> $LOGFILE
10222
bc1378aafa34 6867214 nightly issues message about all new env vars from -t except ONBLD_TOOLS
Dan Mick <Dan.Mick@Sun.COM>
parents: 10194
diff changeset
   877
	echo "ONBLD_TOOLS=${ONBLD_TOOLS}" >> $LOGFILE
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   878
}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   879
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
   880
function staffer {
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   881
	if [ $ISUSER -ne 0 ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   882
		"$@"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   883
	else
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   884
		arg="\"$1\""
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   885
		shift
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   886
		for i
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   887
		do
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   888
			arg="$arg \"$i\""
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   889
		done
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   890
		eval su $STAFFER -c \'$arg\'
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   891
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   892
}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   893
1202
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
   894
#
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
   895
# Verify that the closed tree is present if it needs to be.
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
   896
# Sets CLOSED_IS_PRESENT for future use.
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
   897
#
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
   898
function check_closed_tree {
1202
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
   899
	if [ -z "$CLOSED_IS_PRESENT" ]; then
7264
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
   900
		if [ -d $CODEMGR_WS/usr/closed ]; then
1202
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
   901
			CLOSED_IS_PRESENT="yes"
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
   902
		else
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
   903
			CLOSED_IS_PRESENT="no"
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
   904
		fi
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
   905
		export CLOSED_IS_PRESENT
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
   906
	fi
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
   907
	if [[ "$CLOSED_IS_PRESENT" = no && ! -d "$ON_CLOSED_BINS" ]]; then
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
   908
		#
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
   909
		# If it's an old (pre-split) tree or an empty
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
   910
		# workspace, don't complain.
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
   911
		#
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
   912
		if grep -s CLOSED_BUILD $SRC/Makefile.master > /dev/null; then
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
   913
			echo "If the closed sources are not present," \
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
   914
			    "ON_CLOSED_BINS"
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
   915
			echo "must point to the closed binaries tree."
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
   916
			build_ok=n
1202
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
   917
			exit 1
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
   918
		fi
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
   919
	fi
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
   920
}
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   921
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
   922
function obsolete_build {
2371
fece52ab5cdc 6417866 The TRACE and GPROF builds must die
sommerfe
parents: 2298
diff changeset
   923
    	echo "WARNING: Obsolete $1 build requested; request will be ignored"
fece52ab5cdc 6417866 The TRACE and GPROF builds must die
sommerfe
parents: 2298
diff changeset
   924
}
fece52ab5cdc 6417866 The TRACE and GPROF builds must die
sommerfe
parents: 2298
diff changeset
   925
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   926
#
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   927
# wrapper over wsdiff.
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   928
# usage: do_wsdiff LABEL OLDPROTO NEWPROTO
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   929
#
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
   930
function do_wsdiff {
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   931
	label=$1
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   932
	oldproto=$2
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   933
	newproto=$3
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   934
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   935
	wsdiff="wsdiff"
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   936
	[ "$t_FLAG" = y ] && wsdiff="wsdiff -t"
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   937
12899
5abbd90da85a 6593083 wsdiff should exclude PASS fields from lintdump output before comparison
Vladimir Kotal <Vladimir.Kotal@Sun.COM>
parents: 12776
diff changeset
   938
	echo "\n==== Getting object changes since last build at `date`" \
5abbd90da85a 6593083 wsdiff should exclude PASS fields from lintdump output before comparison
Vladimir Kotal <Vladimir.Kotal@Sun.COM>
parents: 12776
diff changeset
   939
	    "($label) ====\n" | tee -a $LOGFILE >> $mail_msg_file
5abbd90da85a 6593083 wsdiff should exclude PASS fields from lintdump output before comparison
Vladimir Kotal <Vladimir.Kotal@Sun.COM>
parents: 12776
diff changeset
   940
	$wsdiff -s -r ${TMPDIR}/wsdiff.results $oldproto $newproto 2>&1 | \
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   941
		    tee -a $LOGFILE >> $mail_msg_file
12899
5abbd90da85a 6593083 wsdiff should exclude PASS fields from lintdump output before comparison
Vladimir Kotal <Vladimir.Kotal@Sun.COM>
parents: 12776
diff changeset
   942
	echo "\n==== Object changes determined at `date` ($label) ====\n" | \
5abbd90da85a 6593083 wsdiff should exclude PASS fields from lintdump output before comparison
Vladimir Kotal <Vladimir.Kotal@Sun.COM>
parents: 12776
diff changeset
   943
	    tee -a $LOGFILE >> $mail_msg_file
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   944
}
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   945
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   946
#
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
   947
# Functions for setting build flags (DEBUG/non-DEBUG).  Keep them
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   948
# together.
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   949
#
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   950
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
   951
function set_non_debug_build_flags {
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   952
	export INTERNAL_RELEASE_BUILD ; INTERNAL_RELEASE_BUILD=
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   953
	export RELEASE_BUILD ; RELEASE_BUILD=
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   954
	unset EXTRA_OPTIONS
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   955
	unset EXTRA_CFLAGS
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   956
}
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   957
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
   958
function set_debug_build_flags {
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   959
	export INTERNAL_RELEASE_BUILD ; INTERNAL_RELEASE_BUILD=
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   960
	unset RELEASE_BUILD
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   961
	unset EXTRA_OPTIONS
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   962
	unset EXTRA_CFLAGS
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   963
}
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
   964
2371
fece52ab5cdc 6417866 The TRACE and GPROF builds must die
sommerfe
parents: 2298
diff changeset
   965
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   966
MACH=`uname -p`
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   967
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   968
if [ "$OPTHOME" = "" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   969
	OPTHOME=/opt
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   970
	export OPTHOME
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   971
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   972
if [ "$TEAMWARE" = "" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   973
	TEAMWARE=$OPTHOME/teamware
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   974
	export TEAMWARE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   975
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   976
12658
abe3f7fcaa24 6957957 nightly +t flag does not work
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 12649
diff changeset
   977
USAGE='Usage: nightly [-in] [+t] [-V VERS ] [ -S E|D|H|O ] <env_file>
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   978
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   979
Where:
2371
fece52ab5cdc 6417866 The TRACE and GPROF builds must die
sommerfe
parents: 2298
diff changeset
   980
	-i	Fast incremental options (no clobber, lint, check)
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   981
	-n      Do not do a bringover
12658
abe3f7fcaa24 6957957 nightly +t flag does not work
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 12649
diff changeset
   982
	+t	Use the build tools in $ONBLD_TOOLS/bin
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   983
	-V VERS set the build version string to VERS
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   984
	-S	Build a variant of the source product
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   985
		E - build exportable source
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   986
		D - build domestic source (exportable + crypt)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   987
		H - build hybrid source (binaries + deleted source)
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
   988
		O - build (only) open source
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   989
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   990
	<env_file>  file in Bourne shell syntax that sets and exports
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   991
	variables that configure the operation of this script and many of
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   992
	the scripts this one calls. If <env_file> does not exist,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   993
	it will be looked for in $OPTHOME/onbld/env.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   994
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   995
non-DEBUG is the default build type. Build options can be set in the
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   996
NIGHTLY_OPTIONS variable in the <env_file> as follows:
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   997
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   998
	-A	check for ABI differences in .so files
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   999
	-C	check for cstyle/hdrchk errors
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1000
	-D	do a build with DEBUG on
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1001
	-F	do _not_ do a non-DEBUG build
11846
c4f025711cda 6931974 removal of nightly -0 flag missed a couple spots
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 11845
diff changeset
  1002
	-G	gate keeper default group of options (-au)
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1003
	-I	integration engineer default group of options (-ampu)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1004
	-M	do not run pmodes (safe file permission checker)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1005
	-N	do not run protocmp
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1006
	-O	generate OpenSolaris deliverables
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1007
	-R	default group of options for building a release (-mp)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1008
	-U	update proto area in the parent
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1009
	-V VERS set the build version string to VERS
851
bbbf4a61e3b8 6345010 nightly.sh no longer copies the ihv proto files
szhou
parents: 524
diff changeset
  1010
	-X	copy x86 IHV proto area
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1011
	-f	find unreferenced files
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1012
	-i	do an incremental build (no "make clobber")
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1013
	-l	do "make lint" in $LINTDIRS (default: $SRC y)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1014
	-m	send mail to $MAILTO at end of build
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1015
	-n      do not do a bringover
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1016
	-o	build using root privileges to set OWNER/GROUP (old style)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1017
	-p	create packages
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1018
	-r	check ELF runtime attributes in the proto area
12658
abe3f7fcaa24 6957957 nightly +t flag does not work
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 12649
diff changeset
  1019
	-t	build and use the tools in $SRC/tools (default setting)
abe3f7fcaa24 6957957 nightly +t flag does not work
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 12649
diff changeset
  1020
	+t	Use the build tools in $ONBLD_TOOLS/bin
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1021
	-u	update proto_list_$MACH and friends in the parent workspace;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1022
		when used with -f, also build an unrefmaster.out in the parent
2538
b5894d78c55a 5016095 nightly should help determine what really changes from build to build
esaxe
parents: 2456
diff changeset
  1023
	-w	report on differences between previous and current proto areas
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1024
	-z	compress cpio archives with gzip
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1025
	-W	Do not report warnings (freeware gate ONLY)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1026
	-S	Build a variant of the source product
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1027
		E - build exportable source
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1028
		D - build domestic source (exportable + crypt)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1029
		H - build hybrid source (binaries + deleted source)
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1030
		O - build (only) open source
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1031
'
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1032
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1033
#	A log file will be generated under the name $LOGFILE
1557
0aead1696931 6371803 nightly should use ISO standard dates - it sorts better
darrenm
parents: 1202
diff changeset
  1034
#	for partially completed build and log.`date '+%F'`
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1035
#	in the same directory for fully completed builds.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1036
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1037
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1038
# default values for low-level FLAGS; G I R are group FLAGS
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1039
A_FLAG=n
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1040
C_FLAG=n
3644
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1041
D_FLAG=n
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1042
F_FLAG=n
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1043
f_FLAG=n
3644
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1044
i_FLAG=n; i_CMD_LINE_FLAG=n
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1045
l_FLAG=n
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1046
M_FLAG=n
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1047
m_FLAG=n
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1048
N_FLAG=n
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1049
n_FLAG=n
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1050
O_FLAG=n
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1051
o_FLAG=n
3644
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1052
P_FLAG=n
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1053
p_FLAG=n
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1054
r_FLAG=n
3644
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1055
T_FLAG=n
5797
38a210addbf0 6630045 nightly -t should be the default
suha
parents: 5357
diff changeset
  1056
t_FLAG=y
3644
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1057
U_FLAG=n
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1058
u_FLAG=n
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1059
V_FLAG=n
3644
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1060
W_FLAG=n
2538
b5894d78c55a 5016095 nightly should help determine what really changes from build to build
esaxe
parents: 2456
diff changeset
  1061
w_FLAG=n
3644
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1062
X_FLAG=n
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1063
SD_FLAG=n
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1064
SE_FLAG=n
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1065
SH_FLAG=n
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1066
SO_FLAG=n
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1067
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1068
XMOD_OPT=
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1069
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1070
build_ok=y
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1071
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
  1072
function is_source_build {
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1073
	[ "$SE_FLAG" = "y" -o "$SD_FLAG" = "y" -o \
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1074
	    "$SH_FLAG" = "y" -o "$SO_FLAG" = "y" ]
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1075
	return $?
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1076
}
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1077
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1078
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1079
# examine arguments
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1080
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1081
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1082
#
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1083
# single function for setting -S flag and doing error checking.
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1084
# usage: set_S_flag <type>
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1085
# where <type> is the source build type ("E", "D", ...).
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1086
#
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
  1087
function set_S_flag {
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1088
	if is_source_build; then
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1089
		echo "Can only build one source variant at a time."
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1090
		exit 1
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1091
	fi
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1092
	if [ "$1" = "E" ]; then
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1093
		SE_FLAG=y
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1094
	elif [ "$1" = "D" ]; then
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1095
		SD_FLAG=y
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1096
	elif [ "$1" = "H" ]; then
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1097
		SH_FLAG=y
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1098
	elif [ "$1" = "O" ]; then
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1099
		SO_FLAG=y
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1100
	else
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1101
		echo "$USAGE"
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1102
		exit 1
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1103
	fi
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1104
}
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1105
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1106
OPTIND=1
12658
abe3f7fcaa24 6957957 nightly +t flag does not work
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 12649
diff changeset
  1107
while getopts +inS:tV: FLAG
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1108
do
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1109
	case $FLAG in
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1110
	  i )	i_FLAG=y; i_CMD_LINE_FLAG=y
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1111
		;;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1112
	  n )	n_FLAG=y
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1113
		;;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1114
	  S )
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1115
		set_S_flag $OPTARG
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1116
		;;
5797
38a210addbf0 6630045 nightly -t should be the default
suha
parents: 5357
diff changeset
  1117
	 +t )	t_FLAG=n
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1118
		;;
3644
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1119
	  V )	V_FLAG=y
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1120
		V_ARG="$OPTARG"
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1121
		;;
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1122
	 \? )	echo "$USAGE"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1123
		exit 1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1124
		;;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1125
	esac
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1126
done
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1127
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1128
# correct argument count after options
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1129
shift `expr $OPTIND - 1`
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1130
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1131
# test that the path to the environment-setting file was given
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1132
if [ $# -ne 1 ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1133
	echo "$USAGE"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1134
	exit 1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1135
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1136
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1137
# check if user is running nightly as root
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1138
# ISUSER is set non-zero if an ordinary user runs nightly, or is zero
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1139
# when root invokes nightly.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1140
/usr/bin/id | grep '^uid=0(' >/dev/null 2>&1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1141
ISUSER=$?;	export ISUSER
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1142
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1143
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1144
# force locale to C
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1145
LC_COLLATE=C;	export LC_COLLATE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1146
LC_CTYPE=C;	export LC_CTYPE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1147
LC_MESSAGES=C;	export LC_MESSAGES
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1148
LC_MONETARY=C;	export LC_MONETARY
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1149
LC_NUMERIC=C;	export LC_NUMERIC
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1150
LC_TIME=C;	export LC_TIME
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1151
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1152
# clear environment variables we know to be bad for the build
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1153
unset LD_OPTIONS
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1154
unset LD_AUDIT		LD_AUDIT_32		LD_AUDIT_64
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1155
unset LD_BIND_NOW	LD_BIND_NOW_32		LD_BIND_NOW_64
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1156
unset LD_BREADTH	LD_BREADTH_32		LD_BREADTH_64
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1157
unset LD_CONFIG		LD_CONFIG_32		LD_CONFIG_64
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1158
unset LD_DEBUG		LD_DEBUG_32		LD_DEBUG_64
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1159
unset LD_DEMANGLE	LD_DEMANGLE_32		LD_DEMANGLE_64
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1160
unset LD_FLAGS		LD_FLAGS_32		LD_FLAGS_64
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1161
unset LD_LIBRARY_PATH	LD_LIBRARY_PATH_32	LD_LIBRARY_PATH_64
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1162
unset LD_LOADFLTR	LD_LOADFLTR_32		LD_LOADFLTR_64
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1163
unset LD_NOAUDIT	LD_NOAUDIT_32		LD_NOAUDIT_64
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1164
unset LD_NOAUXFLTR	LD_NOAUXFLTR_32		LD_NOAUXFLTR_64
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1165
unset LD_NOCONFIG	LD_NOCONFIG_32		LD_NOCONFIG_64
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1166
unset LD_NODIRCONFIG	LD_NODIRCONFIG_32	LD_NODIRCONFIG_64
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1167
unset LD_NODIRECT	LD_NODIRECT_32		LD_NODIRECT_64
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1168
unset LD_NOLAZYLOAD	LD_NOLAZYLOAD_32	LD_NOLAZYLOAD_64
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1169
unset LD_NOOBJALTER	LD_NOOBJALTER_32	LD_NOOBJALTER_64
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1170
unset LD_NOVERSION	LD_NOVERSION_32		LD_NOVERSION_64
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1171
unset LD_ORIGIN		LD_ORIGIN_32		LD_ORIGIN_64
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1172
unset LD_PRELOAD	LD_PRELOAD_32		LD_PRELOAD_64
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1173
unset LD_PROFILE	LD_PROFILE_32		LD_PROFILE_64
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1174
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1175
unset CONFIG
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1176
unset GROUP
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1177
unset OWNER
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1178
unset REMOTE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1179
unset ENV
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1180
unset ARCH
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1181
unset CLASSPATH
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1182
unset NAME
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1183
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1184
#
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  1185
# To get ONBLD_TOOLS from the environment, it must come from the env file.
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  1186
# If it comes interactively, it is generally TOOLS_PROTO, which will be
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  1187
# clobbered before the compiler version checks, which will therefore fail.
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  1188
#
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  1189
unset ONBLD_TOOLS
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  1190
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  1191
#
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1192
#	Setup environmental variables
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1193
#
4973
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
  1194
if [ -f /etc/nightly.conf ]; then
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
  1195
	. /etc/nightly.conf
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
  1196
fi    
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
  1197
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1198
if [ -f $1 ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1199
	if [[ $1 = */* ]]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1200
		. $1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1201
	else
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1202
		. ./$1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1203
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1204
else
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1205
	if [ -f $OPTHOME/onbld/env/$1 ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1206
		. $OPTHOME/onbld/env/$1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1207
	else
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1208
		echo "Cannot find env file as either $1 or $OPTHOME/onbld/env/$1"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1209
		exit 1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1210
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1211
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1212
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1213
# contents of stdenv.sh inserted after next line:
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1214
# STDENV_START
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1215
# STDENV_END
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1216
13272
f7d89c5253a8 450 RFE: Do a small illumos.sh cleanup
Roland Mainz <roland.mainz@nrubsig.org>
parents: 13215
diff changeset
  1217
# Check if we have sufficient data to continue...
f7d89c5253a8 450 RFE: Do a small illumos.sh cleanup
Roland Mainz <roland.mainz@nrubsig.org>
parents: 13215
diff changeset
  1218
[[ -v CODEMGR_WS ]] || fatal_error "Error: Variable CODEMGR_WS not set."
13290
6489e7702a16 689 nightly.sh doesn't do fresh bringovers
Roland Mainz <roland.mainz@nexenta.com>
parents: 13272
diff changeset
  1219
if  [[ "${NIGHTLY_OPTIONS}" == ~(F)n ]] ; then
6489e7702a16 689 nightly.sh doesn't do fresh bringovers
Roland Mainz <roland.mainz@nexenta.com>
parents: 13272
diff changeset
  1220
	# Check if the gate data are valid if we don't do a "bringover" below
6489e7702a16 689 nightly.sh doesn't do fresh bringovers
Roland Mainz <roland.mainz@nexenta.com>
parents: 13272
diff changeset
  1221
	[[ -d "${CODEMGR_WS}" ]] || \
6489e7702a16 689 nightly.sh doesn't do fresh bringovers
Roland Mainz <roland.mainz@nexenta.com>
parents: 13272
diff changeset
  1222
		fatal_error "Error: ${CODEMGR_WS} is not a directory."
6489e7702a16 689 nightly.sh doesn't do fresh bringovers
Roland Mainz <roland.mainz@nexenta.com>
parents: 13272
diff changeset
  1223
	[[ -f "${CODEMGR_WS}/usr/src/Makefile" ]] || \
6489e7702a16 689 nightly.sh doesn't do fresh bringovers
Roland Mainz <roland.mainz@nexenta.com>
parents: 13272
diff changeset
  1224
		fatal_error "Error: ${CODEMGR_WS}/usr/src/Makefile not found."
6489e7702a16 689 nightly.sh doesn't do fresh bringovers
Roland Mainz <roland.mainz@nexenta.com>
parents: 13272
diff changeset
  1225
fi
13272
f7d89c5253a8 450 RFE: Do a small illumos.sh cleanup
Roland Mainz <roland.mainz@nrubsig.org>
parents: 13215
diff changeset
  1226
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1227
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1228
# place ourselves in a new task, respecting BUILD_PROJECT if set.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1229
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1230
if [ -z "$BUILD_PROJECT" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1231
	/usr/bin/newtask -c $$
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1232
else
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1233
	/usr/bin/newtask -c $$ -p $BUILD_PROJECT
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1234
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1235
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1236
ps -o taskid= -p $$ | read build_taskid
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1237
ps -o project= -p $$ | read build_project
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1238
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1239
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1240
# See if NIGHTLY_OPTIONS is set
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1241
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1242
if [ "$NIGHTLY_OPTIONS" = "" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1243
	NIGHTLY_OPTIONS="-aBm"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1244
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1245
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1246
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1247
# If BRINGOVER_WS was not specified, let it default to CLONE_WS
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1248
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1249
if [ "$BRINGOVER_WS" = "" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1250
	BRINGOVER_WS=$CLONE_WS
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1251
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1252
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1253
#
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  1254
# If CLOSED_BRINGOVER_WS was not specified, let it default to CLOSED_CLONE_WS
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  1255
#
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  1256
if [ "$CLOSED_BRINGOVER_WS" = "" ]; then
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  1257
	CLOSED_BRINGOVER_WS=$CLOSED_CLONE_WS
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  1258
fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  1259
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  1260
#
900
7a6a7342ba44 6346595 tools changes for split tree
kupfer
parents: 851
diff changeset
  1261
# If BRINGOVER_FILES was not specified, default to usr
458
92c1210ccd92 4933161 nightly should allow the env file to choose what files to bringover
mike_s
parents: 411
diff changeset
  1262
#
92c1210ccd92 4933161 nightly should allow the env file to choose what files to bringover
mike_s
parents: 411
diff changeset
  1263
if [ "$BRINGOVER_FILES" = "" ]; then
900
7a6a7342ba44 6346595 tools changes for split tree
kupfer
parents: 851
diff changeset
  1264
	BRINGOVER_FILES="usr"
458
92c1210ccd92 4933161 nightly should allow the env file to choose what files to bringover
mike_s
parents: 411
diff changeset
  1265
fi
92c1210ccd92 4933161 nightly should allow the env file to choose what files to bringover
mike_s
parents: 411
diff changeset
  1266
1167
9608ad751c4d 6289535 build_cscope complains a bit on x86
kupfer
parents: 900
diff changeset
  1267
#
9608ad751c4d 6289535 build_cscope complains a bit on x86
kupfer
parents: 900
diff changeset
  1268
# If the closed sources are not present, the closed binaries must be
9608ad751c4d 6289535 build_cscope complains a bit on x86
kupfer
parents: 900
diff changeset
  1269
# present for the build to succeed.  If there's no pointer to the
9608ad751c4d 6289535 build_cscope complains a bit on x86
kupfer
parents: 900
diff changeset
  1270
# closed binaries, flag that now, rather than forcing the user to wait
9608ad751c4d 6289535 build_cscope complains a bit on x86
kupfer
parents: 900
diff changeset
  1271
# a couple hours (or more) to find out.
9608ad751c4d 6289535 build_cscope complains a bit on x86
kupfer
parents: 900
diff changeset
  1272
#
1202
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
  1273
orig_closed_is_present="$CLOSED_IS_PRESENT"
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
  1274
check_closed_tree
1167
9608ad751c4d 6289535 build_cscope complains a bit on x86
kupfer
parents: 900
diff changeset
  1275
458
92c1210ccd92 4933161 nightly should allow the env file to choose what files to bringover
mike_s
parents: 411
diff changeset
  1276
#
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1277
# Note: changes to the option letters here should also be applied to the
2294
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1278
#	bldenv script.  `d' is listed for backward compatibility.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1279
#
2371
fece52ab5cdc 6417866 The TRACE and GPROF builds must die
sommerfe
parents: 2298
diff changeset
  1280
NIGHTLY_OPTIONS=-${NIGHTLY_OPTIONS#-}
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1281
OPTIND=1
12776
0a254b4b5ca4 6932341 bfu should be removed
jmcp <James.McPherson@Sun.COM>
parents: 12658
diff changeset
  1282
while getopts +ABCDdFfGIilMmNnOoPpRrS:TtUuWwXxz FLAG $NIGHTLY_OPTIONS
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1283
do
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1284
	case $FLAG in
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1285
	  A )	A_FLAG=y
12478
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  1286
		#
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  1287
		# If ELF_DATA_BASELINE_DIR is not defined, and we are on SWAN
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  1288
		# (based on CLOSED_IS_PRESENT), then refuse to run. The value
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  1289
		# of ELF version checking is greatly enhanced by including
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  1290
		# the baseline gate comparison.
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  1291
		if [ "$CLOSED_IS_PRESENT" = 'yes' -a \
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  1292
		     "$ELF_DATA_BASELINE_DIR" = '' ]; then
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  1293
			echo "ELF_DATA_BASELINE_DIR must be set if the A" \
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  1294
			    "flag is present in\nNIGHTLY_OPTIONS and closed" \
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  1295
			    "sources are present. Update environment file."
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  1296
			exit 1;
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  1297
		fi
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1298
		;;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1299
	  B )	D_FLAG=y
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1300
		;; # old version of D
3644
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1301
	  C )	C_FLAG=y
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1302
		;;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1303
	  D )	D_FLAG=y
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1304
		;;
3644
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1305
	  F )	F_FLAG=y
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1306
		;;
3644
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1307
	  f )	f_FLAG=y
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1308
		;;
12776
0a254b4b5ca4 6932341 bfu should be removed
jmcp <James.McPherson@Sun.COM>
parents: 12658
diff changeset
  1309
	  G )   u_FLAG=y
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1310
		;;
12776
0a254b4b5ca4 6932341 bfu should be removed
jmcp <James.McPherson@Sun.COM>
parents: 12658
diff changeset
  1311
	  I )	m_FLAG=y
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1312
		p_FLAG=y
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1313
		u_FLAG=y
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1314
		;;
3644
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1315
	  i )	i_FLAG=y
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1316
		;;
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1317
	  l )	l_FLAG=y
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1318
		;;
3644
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1319
	  M )	M_FLAG=y
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1320
		;;
3644
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1321
	  m )	m_FLAG=y
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1322
		;;
3644
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1323
	  N )	N_FLAG=y
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1324
		;;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1325
	  n )	n_FLAG=y
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1326
		;;
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1327
	  O )	O_FLAG=y
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1328
		;;
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1329
	  o )	o_FLAG=y
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1330
		;;
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  1331
	  P )	P_FLAG=y
3644
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1332
		;; # obsolete
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1333
	  p )	p_FLAG=y
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1334
		;;
3644
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1335
	  R )	m_FLAG=y
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1336
		p_FLAG=y
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1337
		;;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1338
	  r )	r_FLAG=y
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1339
		;;
3644
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1340
	  S )
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1341
		set_S_flag $OPTARG
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1342
		;;
3644
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1343
	  T )	T_FLAG=y
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1344
		;; # obsolete
5797
38a210addbf0 6630045 nightly -t should be the default
suha
parents: 5357
diff changeset
  1345
	 +t )	t_FLAG=n
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1346
		;;
11961
cf8b29303819 6935095 nightly.sh is once again borked for SFW
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 11855
diff changeset
  1347
	  U )   if [ -z "${PARENT_ROOT}" ]; then
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1348
			echo "PARENT_ROOT must be set if the U flag is" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1349
			    "present in NIGHTLY_OPTIONS."
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1350
			exit 1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1351
		fi
11961
cf8b29303819 6935095 nightly.sh is once again borked for SFW
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 11855
diff changeset
  1352
		NIGHTLY_PARENT_ROOT=$PARENT_ROOT
cf8b29303819 6935095 nightly.sh is once again borked for SFW
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 11855
diff changeset
  1353
		if [ -n "${PARENT_TOOLS_ROOT}" ]; then
cf8b29303819 6935095 nightly.sh is once again borked for SFW
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 11855
diff changeset
  1354
			NIGHTLY_PARENT_TOOLS_ROOT=$PARENT_TOOLS_ROOT
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  1355
		fi
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1356
		U_FLAG=y
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1357
		;;
3644
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1358
	  u )	u_FLAG=y
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1359
		;;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1360
	  W )	W_FLAG=y
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1361
		;;
3644
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1362
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1363
	  w )	w_FLAG=y
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1364
		;;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1365
	  X )	# now that we no longer need realmode builds, just
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1366
		# copy IHV packages.  only meaningful on x86.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1367
		if [ "$MACH" = "i386" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1368
			X_FLAG=y
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1369
		fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1370
		;;
3644
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1371
	  x )	XMOD_OPT="-x"
59b78b906844 6489619 *nightly* options list should be sorted
stevel
parents: 2947
diff changeset
  1372
		;;
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1373
	 \? )	echo "$USAGE"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1374
		exit 1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1375
		;;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1376
	esac
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1377
done
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1378
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1379
if [ $ISUSER -ne 0 ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1380
	if [ "$o_FLAG" = "y" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1381
		echo "Old-style build requires root permission."
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1382
		exit 1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1383
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1384
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1385
	# Set default value for STAFFER, if needed.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1386
	if [ -z "$STAFFER" -o "$STAFFER" = "nobody" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1387
		STAFFER=`/usr/xpg4/bin/id -un`
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1388
		export STAFFER
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1389
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1390
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1391
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1392
if [ -z "$MAILTO" -o "$MAILTO" = "nobody" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1393
	MAILTO=$STAFFER
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1394
	export MAILTO
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1395
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1396
12374
108edb7148a6 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds (fix sfw)
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12277
diff changeset
  1397
PATH="$OPTHOME/onbld/bin:$OPTHOME/onbld/bin/${MACH}:/usr/ccs/bin"
108edb7148a6 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds (fix sfw)
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12277
diff changeset
  1398
PATH="$PATH:$OPTHOME/SUNWspro/bin:$TEAMWARE/bin:/usr/bin:/usr/sbin:/usr/ucb"
108edb7148a6 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds (fix sfw)
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12277
diff changeset
  1399
PATH="$PATH:/usr/openwin/bin:/usr/sfw/bin:/opt/sfw/bin:."
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1400
export PATH
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1401
900
7a6a7342ba44 6346595 tools changes for split tree
kupfer
parents: 851
diff changeset
  1402
# roots of source trees, both relative to $SRC and absolute.
7a6a7342ba44 6346595 tools changes for split tree
kupfer
parents: 851
diff changeset
  1403
relsrcdirs="."
7264
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  1404
if [[ -d $CODEMGR_WS/usr/closed && "$CLOSED_IS_PRESENT" != no ]]; then
1167
9608ad751c4d 6289535 build_cscope complains a bit on x86
kupfer
parents: 900
diff changeset
  1405
	relsrcdirs="$relsrcdirs ../closed"
9608ad751c4d 6289535 build_cscope complains a bit on x86
kupfer
parents: 900
diff changeset
  1406
fi
900
7a6a7342ba44 6346595 tools changes for split tree
kupfer
parents: 851
diff changeset
  1407
abssrcdirs=""
7a6a7342ba44 6346595 tools changes for split tree
kupfer
parents: 851
diff changeset
  1408
for d in $relsrcdirs; do
7a6a7342ba44 6346595 tools changes for split tree
kupfer
parents: 851
diff changeset
  1409
	abssrcdirs="$abssrcdirs $SRC/$d"
7a6a7342ba44 6346595 tools changes for split tree
kupfer
parents: 851
diff changeset
  1410
done
7a6a7342ba44 6346595 tools changes for split tree
kupfer
parents: 851
diff changeset
  1411
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1412
unset CH
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1413
if [ "$o_FLAG" = "y" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1414
# root invoked old-style build -- make sure it works as it always has
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1415
# by exporting 'CH'.  The current Makefile.master doesn't use this, but
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1416
# the old ones still do.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1417
	PROTOCMPTERSE="protocmp.terse"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1418
	CH=
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1419
	export CH
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1420
else
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1421
	PROTOCMPTERSE="protocmp.terse -gu"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1422
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1423
POUND_SIGN="#"
10738
6cd5e5169fec 6880460 some root-build bits were missed by 6864230
jmcp <James.McPherson@Sun.COM>
parents: 10517
diff changeset
  1424
# have we set RELEASE_DATE in our env file?
6cd5e5169fec 6880460 some root-build bits were missed by 6864230
jmcp <James.McPherson@Sun.COM>
parents: 10517
diff changeset
  1425
if [ -z "$RELEASE_DATE" ]; then
6cd5e5169fec 6880460 some root-build bits were missed by 6864230
jmcp <James.McPherson@Sun.COM>
parents: 10517
diff changeset
  1426
	RELEASE_DATE=$(LC_ALL=C date +"%B %Y")
6cd5e5169fec 6880460 some root-build bits were missed by 6864230
jmcp <James.McPherson@Sun.COM>
parents: 10517
diff changeset
  1427
fi
6cd5e5169fec 6880460 some root-build bits were missed by 6864230
jmcp <James.McPherson@Sun.COM>
parents: 10517
diff changeset
  1428
BUILD_DATE=$(LC_ALL=C date +%Y-%b-%d)
6cd5e5169fec 6880460 some root-build bits were missed by 6864230
jmcp <James.McPherson@Sun.COM>
parents: 10517
diff changeset
  1429
BASEWSDIR=$(basename $CODEMGR_WS)
6cd5e5169fec 6880460 some root-build bits were missed by 6864230
jmcp <James.McPherson@Sun.COM>
parents: 10517
diff changeset
  1430
DEV_CM="\"@(#)SunOS Internal Development: $LOGNAME $BUILD_DATE [$BASEWSDIR]\""
6cd5e5169fec 6880460 some root-build bits were missed by 6864230
jmcp <James.McPherson@Sun.COM>
parents: 10517
diff changeset
  1431
6cd5e5169fec 6880460 some root-build bits were missed by 6864230
jmcp <James.McPherson@Sun.COM>
parents: 10517
diff changeset
  1432
# we export POUND_SIGN, RELEASE_DATE and DEV_CM to speed up the build process
6cd5e5169fec 6880460 some root-build bits were missed by 6864230
jmcp <James.McPherson@Sun.COM>
parents: 10517
diff changeset
  1433
# by avoiding repeated shell invocations to evaluate Makefile.master definitions.
11846
c4f025711cda 6931974 removal of nightly -0 flag missed a couple spots
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 11845
diff changeset
  1434
# we export o_FLAG and X_FLAG for use by makebfu, and by usr/src/pkg/Makefile
10738
6cd5e5169fec 6880460 some root-build bits were missed by 6864230
jmcp <James.McPherson@Sun.COM>
parents: 10517
diff changeset
  1435
export o_FLAG X_FLAG POUND_SIGN RELEASE_DATE DEV_CM
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1436
2294
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1437
maketype="distributed"
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1438
MAKE=dmake
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1439
# get the dmake version string alone
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1440
DMAKE_VERSION=$( $MAKE -v )
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1441
DMAKE_VERSION=${DMAKE_VERSION#*: }
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1442
# focus in on just the dotted version number alone
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1443
DMAKE_MAJOR=$( echo $DMAKE_VERSION | \
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1444
	sed -e 's/.*\<\([^.]*\.[^   ]*\).*$/\1/' )
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1445
# extract the second (or final) integer
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1446
DMAKE_MINOR=${DMAKE_MAJOR#*.}
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1447
DMAKE_MINOR=${DMAKE_MINOR%%.*}
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1448
# extract the first integer
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1449
DMAKE_MAJOR=${DMAKE_MAJOR%%.*}
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1450
CHECK_DMAKE=${CHECK_DMAKE:-y}
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1451
# x86 was built on the 12th, sparc on the 13th.
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1452
if [ "$CHECK_DMAKE" = "y" -a \
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1453
     "$DMAKE_VERSION" != "Sun Distributed Make 7.3 2003/03/12" -a \
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1454
     "$DMAKE_VERSION" != "Sun Distributed Make 7.3 2003/03/13" -a \( \
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1455
     "$DMAKE_MAJOR" -lt 7 -o \
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1456
     "$DMAKE_MAJOR" -eq 7 -a "$DMAKE_MINOR" -lt 4 \) ]; then
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1457
	if [ -z "$DMAKE_VERSION" ]; then
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1458
		echo "$MAKE is missing."
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1459
		exit 1
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1460
	fi
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1461
	echo `whence $MAKE`" version is:"
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1462
	echo "  ${DMAKE_VERSION}"
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1463
	cat <<EOF
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1464
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1465
This version may not be safe for use.  Either set TEAMWARE to a better
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1466
path or (if you really want to use this version of dmake anyway), add
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1467
the following to your environment to disable this check:
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1468
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1469
  CHECK_DMAKE=n
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1470
EOF
2294
658bd7c13512 4416654 warning filter list in nightly should be cleaned up
meem
parents: 2230
diff changeset
  1471
	exit 1
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1472
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1473
export PATH
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1474
export MAKE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1475
12210
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
  1476
if [[ "$O_FLAG" = y ]]; then
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
  1477
	export TONICBUILD=""
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
  1478
else
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
  1479
	export TONICBUILD="#"
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
  1480
fi
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
  1481
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1482
if [ "${SUNWSPRO}" != "" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1483
	PATH="${SUNWSPRO}/bin:$PATH"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1484
	export PATH
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1485
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1486
11763
093f70f0db00 6929447 nightly sets DMAKE_MAX_JOBS incorrectly
Will Fiveash <Will.Fiveash@Sun.COM>
parents: 11690
diff changeset
  1487
hostname=$(uname -n)
093f70f0db00 6929447 nightly sets DMAKE_MAX_JOBS incorrectly
Will Fiveash <Will.Fiveash@Sun.COM>
parents: 11690
diff changeset
  1488
if [[ $DMAKE_MAX_JOBS != +([0-9]) || $DMAKE_MAX_JOBS -eq 0 ]]
093f70f0db00 6929447 nightly sets DMAKE_MAX_JOBS incorrectly
Will Fiveash <Will.Fiveash@Sun.COM>
parents: 11690
diff changeset
  1489
then
093f70f0db00 6929447 nightly sets DMAKE_MAX_JOBS incorrectly
Will Fiveash <Will.Fiveash@Sun.COM>
parents: 11690
diff changeset
  1490
	maxjobs=
093f70f0db00 6929447 nightly sets DMAKE_MAX_JOBS incorrectly
Will Fiveash <Will.Fiveash@Sun.COM>
parents: 11690
diff changeset
  1491
	if [[ -f $HOME/.make.machines ]]
093f70f0db00 6929447 nightly sets DMAKE_MAX_JOBS incorrectly
Will Fiveash <Will.Fiveash@Sun.COM>
parents: 11690
diff changeset
  1492
	then
093f70f0db00 6929447 nightly sets DMAKE_MAX_JOBS incorrectly
Will Fiveash <Will.Fiveash@Sun.COM>
parents: 11690
diff changeset
  1493
		# Note: there is a hard tab and space character in the []s
093f70f0db00 6929447 nightly sets DMAKE_MAX_JOBS incorrectly
Will Fiveash <Will.Fiveash@Sun.COM>
parents: 11690
diff changeset
  1494
		# below.
093f70f0db00 6929447 nightly sets DMAKE_MAX_JOBS incorrectly
Will Fiveash <Will.Fiveash@Sun.COM>
parents: 11690
diff changeset
  1495
		egrep -i "^[ 	]*$hostname[ 	\.]" \
093f70f0db00 6929447 nightly sets DMAKE_MAX_JOBS incorrectly
Will Fiveash <Will.Fiveash@Sun.COM>
parents: 11690
diff changeset
  1496
			$HOME/.make.machines | read host jobs
093f70f0db00 6929447 nightly sets DMAKE_MAX_JOBS incorrectly
Will Fiveash <Will.Fiveash@Sun.COM>
parents: 11690
diff changeset
  1497
		maxjobs=${jobs##*=}
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1498
	fi
11763
093f70f0db00 6929447 nightly sets DMAKE_MAX_JOBS incorrectly
Will Fiveash <Will.Fiveash@Sun.COM>
parents: 11690
diff changeset
  1499
093f70f0db00 6929447 nightly sets DMAKE_MAX_JOBS incorrectly
Will Fiveash <Will.Fiveash@Sun.COM>
parents: 11690
diff changeset
  1500
	if [[ $maxjobs != +([0-9]) || $maxjobs -eq 0 ]]
093f70f0db00 6929447 nightly sets DMAKE_MAX_JOBS incorrectly
Will Fiveash <Will.Fiveash@Sun.COM>
parents: 11690
diff changeset
  1501
	then
093f70f0db00 6929447 nightly sets DMAKE_MAX_JOBS incorrectly
Will Fiveash <Will.Fiveash@Sun.COM>
parents: 11690
diff changeset
  1502
		# default
093f70f0db00 6929447 nightly sets DMAKE_MAX_JOBS incorrectly
Will Fiveash <Will.Fiveash@Sun.COM>
parents: 11690
diff changeset
  1503
		maxjobs=4
093f70f0db00 6929447 nightly sets DMAKE_MAX_JOBS incorrectly
Will Fiveash <Will.Fiveash@Sun.COM>
parents: 11690
diff changeset
  1504
	fi
093f70f0db00 6929447 nightly sets DMAKE_MAX_JOBS incorrectly
Will Fiveash <Will.Fiveash@Sun.COM>
parents: 11690
diff changeset
  1505
093f70f0db00 6929447 nightly sets DMAKE_MAX_JOBS incorrectly
Will Fiveash <Will.Fiveash@Sun.COM>
parents: 11690
diff changeset
  1506
	export DMAKE_MAX_JOBS=$maxjobs
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1507
fi
11763
093f70f0db00 6929447 nightly sets DMAKE_MAX_JOBS incorrectly
Will Fiveash <Will.Fiveash@Sun.COM>
parents: 11690
diff changeset
  1508
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1509
DMAKE_MODE=parallel;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1510
export DMAKE_MODE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1511
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1512
if [ -z "${ROOT}" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1513
	echo "ROOT must be set."
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1514
	exit 1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1515
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1516
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1517
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1518
# if -V flag was given, reset VERSION to V_ARG
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1519
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1520
if [ "$V_FLAG" = "y" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1521
	VERSION=$V_ARG
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1522
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1523
851
bbbf4a61e3b8 6345010 nightly.sh no longer copies the ihv proto files
szhou
parents: 524
diff changeset
  1524
#
bbbf4a61e3b8 6345010 nightly.sh no longer copies the ihv proto files
szhou
parents: 524
diff changeset
  1525
# Check for IHV root for copying ihv proto area
bbbf4a61e3b8 6345010 nightly.sh no longer copies the ihv proto files
szhou
parents: 524
diff changeset
  1526
#
bbbf4a61e3b8 6345010 nightly.sh no longer copies the ihv proto files
szhou
parents: 524
diff changeset
  1527
if [ "$X_FLAG" = "y" ]; then
bbbf4a61e3b8 6345010 nightly.sh no longer copies the ihv proto files
szhou
parents: 524
diff changeset
  1528
        if [ "$IA32_IHV_ROOT" = "" ]; then
bbbf4a61e3b8 6345010 nightly.sh no longer copies the ihv proto files
szhou
parents: 524
diff changeset
  1529
		echo "IA32_IHV_ROOT: must be set for copying ihv proto"
bbbf4a61e3b8 6345010 nightly.sh no longer copies the ihv proto files
szhou
parents: 524
diff changeset
  1530
		args_ok=n
bbbf4a61e3b8 6345010 nightly.sh no longer copies the ihv proto files
szhou
parents: 524
diff changeset
  1531
        fi
bbbf4a61e3b8 6345010 nightly.sh no longer copies the ihv proto files
szhou
parents: 524
diff changeset
  1532
        if [ ! -d "$IA32_IHV_ROOT" ]; then
bbbf4a61e3b8 6345010 nightly.sh no longer copies the ihv proto files
szhou
parents: 524
diff changeset
  1533
                echo "$IA32_IHV_ROOT: not found"
bbbf4a61e3b8 6345010 nightly.sh no longer copies the ihv proto files
szhou
parents: 524
diff changeset
  1534
                args_ok=n
bbbf4a61e3b8 6345010 nightly.sh no longer copies the ihv proto files
szhou
parents: 524
diff changeset
  1535
        fi
2868
c6c11cf3e587 6460124 nightly -X doesn't properly copy the IHV proto area
dduvall
parents: 2730
diff changeset
  1536
        if [ "$IA32_IHV_WS" = "" ]; then
c6c11cf3e587 6460124 nightly -X doesn't properly copy the IHV proto area
dduvall
parents: 2730
diff changeset
  1537
		echo "IA32_IHV_WS: must be set for copying ihv proto"
c6c11cf3e587 6460124 nightly -X doesn't properly copy the IHV proto area
dduvall
parents: 2730
diff changeset
  1538
		args_ok=n
c6c11cf3e587 6460124 nightly -X doesn't properly copy the IHV proto area
dduvall
parents: 2730
diff changeset
  1539
        fi
c6c11cf3e587 6460124 nightly -X doesn't properly copy the IHV proto area
dduvall
parents: 2730
diff changeset
  1540
        if [ ! -d "$IA32_IHV_WS" ]; then
c6c11cf3e587 6460124 nightly -X doesn't properly copy the IHV proto area
dduvall
parents: 2730
diff changeset
  1541
                echo "$IA32_IHV_WS: not found"
c6c11cf3e587 6460124 nightly -X doesn't properly copy the IHV proto area
dduvall
parents: 2730
diff changeset
  1542
                args_ok=n
c6c11cf3e587 6460124 nightly -X doesn't properly copy the IHV proto area
dduvall
parents: 2730
diff changeset
  1543
        fi
851
bbbf4a61e3b8 6345010 nightly.sh no longer copies the ihv proto files
szhou
parents: 524
diff changeset
  1544
fi
bbbf4a61e3b8 6345010 nightly.sh no longer copies the ihv proto files
szhou
parents: 524
diff changeset
  1545
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1546
# Append source version
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1547
if [ "$SE_FLAG" = "y" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1548
	VERSION="${VERSION}:EXPORT"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1549
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1550
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1551
if [ "$SD_FLAG" = "y" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1552
	VERSION="${VERSION}:DOMESTIC"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1553
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1554
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1555
if [ "$SH_FLAG" = "y" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1556
	VERSION="${VERSION}:MODIFIED_SOURCE_PRODUCT"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1557
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1558
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1559
if [ "$SO_FLAG" = "y" ]; then
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1560
	VERSION="${VERSION}:OPEN_ONLY"
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1561
fi
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1562
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1563
TMPDIR="/tmp/nightly.tmpdir.$$"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1564
export TMPDIR
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1565
rm -rf ${TMPDIR}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1566
mkdir -p $TMPDIR || exit 1
8794
1119bce31099 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please? (fix root build)
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8789
diff changeset
  1567
chmod 777 $TMPDIR
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1568
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1569
#
2371
fece52ab5cdc 6417866 The TRACE and GPROF builds must die
sommerfe
parents: 2298
diff changeset
  1570
# Keep elfsign's use of pkcs11_softtoken from looking in the user home
fece52ab5cdc 6417866 The TRACE and GPROF builds must die
sommerfe
parents: 2298
diff changeset
  1571
# directory, which doesn't always work.   Needed until all build machines
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1572
# have the fix for 6271754
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1573
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1574
SOFTTOKEN_DIR=$TMPDIR
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1575
export SOFTTOKEN_DIR
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1576
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  1577
#
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  1578
# Tools should only be built non-DEBUG.  Keep track of the tools proto
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  1579
# area path relative to $TOOLS, because the latter changes in an
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  1580
# export build.
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  1581
#
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  1582
# TOOLS_PROTO is included below for builds other than usr/src/tools
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  1583
# that look for this location.  For usr/src/tools, this will be
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  1584
# overridden on the $MAKE command line in build_tools().
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  1585
#
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1586
TOOLS=${SRC}/tools
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  1587
TOOLS_PROTO_REL=proto/root_${MACH}-nd
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  1588
TOOLS_PROTO=${TOOLS}/${TOOLS_PROTO_REL};	export TOOLS_PROTO
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  1589
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1590
unset   CFLAGS LD_LIBRARY_PATH LDFLAGS
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1591
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1592
# create directories that are automatically removed if the nightly script
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1593
# fails to start correctly
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
  1594
function newdir {
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1595
	dir=$1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1596
	toadd=
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1597
	while [ ! -d $dir ]; do
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1598
		toadd="$dir $toadd"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1599
		dir=`dirname $dir`
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1600
	done
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1601
	torm=
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1602
	newlist=
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1603
	for dir in $toadd; do
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1604
		if staffer mkdir $dir; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1605
			newlist="$ISUSER $dir $newlist"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1606
			torm="$dir $torm"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1607
		else
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1608
			[ -z "$torm" ] || staffer rmdir $torm
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1609
			return 1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1610
		fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1611
	done
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1612
	newdirlist="$newlist $newdirlist"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1613
	return 0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1614
}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1615
newdirlist=
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1616
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1617
[ -d $CODEMGR_WS ] || newdir $CODEMGR_WS || exit 1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1618
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1619
# since this script assumes the build is from full source, it nullifies
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1620
# variables likely to have been set by a "ws" script; nullification
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1621
# confines the search space for headers and libraries to the proto area
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1622
# built from this immediate source.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1623
ENVLDLIBS1=
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1624
ENVLDLIBS2=
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1625
ENVLDLIBS3=
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1626
ENVCPPFLAGS1=
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1627
ENVCPPFLAGS2=
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1628
ENVCPPFLAGS3=
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1629
ENVCPPFLAGS4=
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1630
PARENT_ROOT=
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1631
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1632
export ENVLDLIBS3 ENVCPPFLAGS1 ENVCPPFLAGS2 ENVCPPFLAGS3 ENVCPPFLAGS4 \
14225
20c0ad5cefdf 3915 Add adjuncts support to the build
Keith M Wesolowski <wesolows@foobazco.org>
parents: 14218
diff changeset
  1633
	ENVLDLIBS1 ENVLDLIBS2 PARENT_ROOT
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1634
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1635
PKGARCHIVE_ORIG=$PKGARCHIVE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1636
IA32_IHV_PKGS_ORIG=$IA32_IHV_PKGS
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1637
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1638
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1639
# Juggle the logs and optionally send mail on completion.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1640
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1641
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
  1642
function logshuffle {
5797
38a210addbf0 6630045 nightly -t should be the default
suha
parents: 5357
diff changeset
  1643
    	LLOG="$ATLOG/log.`date '+%F.%H:%M'`"
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1644
	if [ -f $LLOG -o -d $LLOG ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1645
	    	LLOG=$LLOG.$$
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1646
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1647
	mkdir $LLOG
2405
cf343ae5c543 6451117 at its conclusion, nightly should be able to run commands specified in environment
rscott
parents: 2371
diff changeset
  1648
	export LLOG
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1649
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1650
	if [ "$build_ok" = "y" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1651
		mv $ATLOG/proto_list_${MACH} $LLOG
2538
b5894d78c55a 5016095 nightly should help determine what really changes from build to build
esaxe
parents: 2456
diff changeset
  1652
8785
fd9a603be997 6414844 SUNWonbld should use protocmp
Rainer Orth <ro@techfak.uni-bielefeld.de>
parents: 8744
diff changeset
  1653
		if [ -f $ATLOG/proto_list_tools_${MACH} ]; then
fd9a603be997 6414844 SUNWonbld should use protocmp
Rainer Orth <ro@techfak.uni-bielefeld.de>
parents: 8744
diff changeset
  1654
			mv $ATLOG/proto_list_tools_${MACH} $LLOG
fd9a603be997 6414844 SUNWonbld should use protocmp
Rainer Orth <ro@techfak.uni-bielefeld.de>
parents: 8744
diff changeset
  1655
	        fi
fd9a603be997 6414844 SUNWonbld should use protocmp
Rainer Orth <ro@techfak.uni-bielefeld.de>
parents: 8744
diff changeset
  1656
2538
b5894d78c55a 5016095 nightly should help determine what really changes from build to build
esaxe
parents: 2456
diff changeset
  1657
		if [ -f $TMPDIR/wsdiff.results ]; then
8785
fd9a603be997 6414844 SUNWonbld should use protocmp
Rainer Orth <ro@techfak.uni-bielefeld.de>
parents: 8744
diff changeset
  1658
		    	mv $TMPDIR/wsdiff.results $LLOG
2538
b5894d78c55a 5016095 nightly should help determine what really changes from build to build
esaxe
parents: 2456
diff changeset
  1659
		fi
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1660
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1661
		if [ -f $TMPDIR/wsdiff-nd.results ]; then
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1662
			mv $TMPDIR/wsdiff-nd.results $LLOG
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1663
		fi
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1664
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1665
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1666
	#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1667
	# Now that we're about to send mail, it's time to check the noise
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1668
	# file.  In the event that an error occurs beyond this point, it will
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1669
	# be recorded in the nightly.log file, but nowhere else.  This would
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1670
	# include only errors that cause the copying of the noise log to fail
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1671
	# or the mail itself not to be sent.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1672
	#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1673
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1674
	exec >>$LOGFILE 2>&1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1675
	if [ -s $build_noise_file ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1676
	    	echo "\n==== Nightly build noise ====\n" |
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1677
		    tee -a $LOGFILE >>$mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1678
		cat $build_noise_file >>$LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1679
		cat $build_noise_file >>$mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1680
		echo | tee -a $LOGFILE >>$mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1681
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1682
	rm -f $build_noise_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1683
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1684
	case "$build_ok" in
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1685
		y)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1686
			state=Completed
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1687
			;;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1688
		i)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1689
			state=Interrupted
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1690
			;;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1691
		*)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1692
	    		state=Failed
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1693
			;;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1694
	esac
2456
0bd2410bad66 6451253 6451117 should have spent a bit more time in code review
rscott
parents: 2405
diff changeset
  1695
	NIGHTLY_STATUS=$state
0bd2410bad66 6451253 6451117 should have spent a bit more time in code review
rscott
parents: 2405
diff changeset
  1696
	export NIGHTLY_STATUS
2371
fece52ab5cdc 6417866 The TRACE and GPROF builds must die
sommerfe
parents: 2298
diff changeset
  1697
4973
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
  1698
	run_hook POST_NIGHTLY $state
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
  1699
	run_hook SYS_POST_NIGHTLY $state
2405
cf343ae5c543 6451117 at its conclusion, nightly should be able to run commands specified in environment
rscott
parents: 2371
diff changeset
  1700
13655
96f1427cec2e 2059 nightly(1) should support custom From: in mail
Joshua M. Clulow <josh@sysmgr.org>
parents: 13361
diff changeset
  1701
	#
96f1427cec2e 2059 nightly(1) should support custom From: in mail
Joshua M. Clulow <josh@sysmgr.org>
parents: 13361
diff changeset
  1702
	# mailx(1) sets From: based on the -r flag
96f1427cec2e 2059 nightly(1) should support custom From: in mail
Joshua M. Clulow <josh@sysmgr.org>
parents: 13361
diff changeset
  1703
	# if it is given.
96f1427cec2e 2059 nightly(1) should support custom From: in mail
Joshua M. Clulow <josh@sysmgr.org>
parents: 13361
diff changeset
  1704
	#
96f1427cec2e 2059 nightly(1) should support custom From: in mail
Joshua M. Clulow <josh@sysmgr.org>
parents: 13361
diff changeset
  1705
	mailx_r=
96f1427cec2e 2059 nightly(1) should support custom From: in mail
Joshua M. Clulow <josh@sysmgr.org>
parents: 13361
diff changeset
  1706
	if [[ -n "${MAILFROM}" ]]; then
96f1427cec2e 2059 nightly(1) should support custom From: in mail
Joshua M. Clulow <josh@sysmgr.org>
parents: 13361
diff changeset
  1707
		mailx_r="-r ${MAILFROM}"
96f1427cec2e 2059 nightly(1) should support custom From: in mail
Joshua M. Clulow <josh@sysmgr.org>
parents: 13361
diff changeset
  1708
	fi
96f1427cec2e 2059 nightly(1) should support custom From: in mail
Joshua M. Clulow <josh@sysmgr.org>
parents: 13361
diff changeset
  1709
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  1710
	cat $build_time_file $build_environ_file $mail_msg_file \
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  1711
	    > ${LLOG}/mail_msg
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1712
	if [ "$m_FLAG" = "y" ]; then
13655
96f1427cec2e 2059 nightly(1) should support custom From: in mail
Joshua M. Clulow <josh@sysmgr.org>
parents: 13361
diff changeset
  1713
	    	cat ${LLOG}/mail_msg | /usr/bin/mailx ${mailx_r} -s \
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1714
	"Nightly ${MACH} Build of `basename ${CODEMGR_WS}` ${state}." \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1715
			${MAILTO}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1716
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1717
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1718
	if [ "$u_FLAG" = "y" -a "$build_ok" = "y" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1719
	    	staffer cp ${LLOG}/mail_msg $PARENT_WS/usr/src/mail_msg-${MACH}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1720
		staffer cp $LOGFILE $PARENT_WS/usr/src/nightly-${MACH}.log
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1721
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1722
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1723
	mv $LOGFILE $LLOG
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1724
}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1725
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1726
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1727
#	Remove the locks and temporary files on any exit
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1728
#
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
  1729
function cleanup {
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1730
    	logshuffle
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1731
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1732
	[ -z "$lockfile" ] || staffer rm -f $lockfile
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1733
	[ -z "$atloglockfile" ] || rm -f $atloglockfile
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1734
	[ -z "$ulockfile" ] || staffer rm -f $ulockfile
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1735
	[ -z "$Ulockfile" ] || rm -f $Ulockfile
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1736
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1737
	set -- $newdirlist
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1738
	while [ $# -gt 0 ]; do
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1739
		ISUSER=$1 staffer rmdir $2
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1740
		shift; shift
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1741
	done
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1742
	rm -rf $TMPDIR
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1743
}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1744
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
  1745
function cleanup_signal {
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1746
    	build_ok=i
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1747
	# this will trigger cleanup(), above.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1748
	exit 1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1749
}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1750
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1751
trap cleanup 0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1752
trap cleanup_signal 1 2 3 15
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1753
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1754
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1755
# Generic lock file processing -- make sure that the lock file doesn't
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1756
# exist.  If it does, it should name the build host and PID.  If it
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1757
# doesn't, then make sure we can create it.  Clean up locks that are
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1758
# known to be stale (assumes host name is unique among build systems
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1759
# for the workspace).
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  1760
#
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
  1761
function create_lock {
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1762
	lockf=$1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1763
	lockvar=$2
4680
f88db40ed325 6581614 create_lock() in nightly is racy
dduvall
parents: 4660
diff changeset
  1764
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1765
	ldir=`dirname $lockf`
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1766
	[ -d $ldir ] || newdir $ldir || exit 1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1767
	eval $lockvar=$lockf
4680
f88db40ed325 6581614 create_lock() in nightly is racy
dduvall
parents: 4660
diff changeset
  1768
f88db40ed325 6581614 create_lock() in nightly is racy
dduvall
parents: 4660
diff changeset
  1769
	while ! staffer ln -s $hostname.$STAFFER.$$ $lockf 2> /dev/null; do
f88db40ed325 6581614 create_lock() in nightly is racy
dduvall
parents: 4660
diff changeset
  1770
		basews=`basename $CODEMGR_WS`
f88db40ed325 6581614 create_lock() in nightly is racy
dduvall
parents: 4660
diff changeset
  1771
		ls -l $lockf | nawk '{print $NF}' | IFS=. read host user pid
f88db40ed325 6581614 create_lock() in nightly is racy
dduvall
parents: 4660
diff changeset
  1772
		if [ "$host" != "$hostname" ]; then
f88db40ed325 6581614 create_lock() in nightly is racy
dduvall
parents: 4660
diff changeset
  1773
			echo "$MACH build of $basews apparently" \
f88db40ed325 6581614 create_lock() in nightly is racy
dduvall
parents: 4660
diff changeset
  1774
			    "already started by $user on $host as $pid."
f88db40ed325 6581614 create_lock() in nightly is racy
dduvall
parents: 4660
diff changeset
  1775
			exit 1
f88db40ed325 6581614 create_lock() in nightly is racy
dduvall
parents: 4660
diff changeset
  1776
		elif kill -s 0 $pid 2>/dev/null; then
f88db40ed325 6581614 create_lock() in nightly is racy
dduvall
parents: 4660
diff changeset
  1777
			echo "$MACH build of $basews already started" \
f88db40ed325 6581614 create_lock() in nightly is racy
dduvall
parents: 4660
diff changeset
  1778
			    "by $user as $pid."
f88db40ed325 6581614 create_lock() in nightly is racy
dduvall
parents: 4660
diff changeset
  1779
			exit 1
f88db40ed325 6581614 create_lock() in nightly is racy
dduvall
parents: 4660
diff changeset
  1780
		else
f88db40ed325 6581614 create_lock() in nightly is racy
dduvall
parents: 4660
diff changeset
  1781
			# stale lock; clear it out and try again
f88db40ed325 6581614 create_lock() in nightly is racy
dduvall
parents: 4660
diff changeset
  1782
			rm -f $lockf
f88db40ed325 6581614 create_lock() in nightly is racy
dduvall
parents: 4660
diff changeset
  1783
		fi
f88db40ed325 6581614 create_lock() in nightly is racy
dduvall
parents: 4660
diff changeset
  1784
	done
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1785
}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1786
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1787
#
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1788
# Return the list of interesting proto areas, depending on the current
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1789
# options.
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1790
#
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
  1791
function allprotos {
12649
87a8e25df5cf 6919429 new crypto tarball doesn't play well with ON Tonic builds
Mike Kupfer <Mike.Kupfer@Oracle.COM>
parents: 12486
diff changeset
  1792
	typeset roots="$ROOT"
87a8e25df5cf 6919429 new crypto tarball doesn't play well with ON Tonic builds
Mike Kupfer <Mike.Kupfer@Oracle.COM>
parents: 12486
diff changeset
  1793
87a8e25df5cf 6919429 new crypto tarball doesn't play well with ON Tonic builds
Mike Kupfer <Mike.Kupfer@Oracle.COM>
parents: 12486
diff changeset
  1794
	if [[ "$F_FLAG" = n && "$MULTI_PROTO" = yes ]]; then
87a8e25df5cf 6919429 new crypto tarball doesn't play well with ON Tonic builds
Mike Kupfer <Mike.Kupfer@Oracle.COM>
parents: 12486
diff changeset
  1795
		roots="$roots $ROOT-nd"
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1796
	fi
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1797
12210
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
  1798
	if [[ $O_FLAG = y ]]; then
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
  1799
		roots="$roots $ROOT-closed"
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
  1800
		[ $MULTI_PROTO = yes ] && roots="$roots $ROOT-nd-closed"
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
  1801
	fi
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
  1802
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1803
	echo $roots
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1804
}
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1805
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1806
# Ensure no other instance of this script is running on this host.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1807
# LOCKNAME can be set in <env_file>, and is by default, but is not
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1808
# required due to the use of $ATLOG below.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1809
if [ -n "$LOCKNAME" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1810
	create_lock /tmp/$LOCKNAME "lockfile"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1811
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1812
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1813
# Create from one, two, or three other locks:
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1814
#	$ATLOG/nightly.lock
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1815
#		- protects against multiple builds in same workspace
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1816
#	$PARENT_WS/usr/src/nightly.$MACH.lock
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1817
#		- protects against multiple 'u' copy-backs
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1818
#	$NIGHTLY_PARENT_ROOT/nightly.lock
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1819
#		- protects against multiple 'U' copy-backs
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1820
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1821
# Overriding ISUSER to 1 causes the lock to be created as root if the
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1822
# script is run as root.  The default is to create it as $STAFFER.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1823
ISUSER=1 create_lock $ATLOG/nightly.lock "atloglockfile"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1824
if [ "$u_FLAG" = "y" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1825
	create_lock $PARENT_WS/usr/src/nightly.$MACH.lock "ulockfile"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1826
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1827
if [ "$U_FLAG" = "y" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1828
	# NIGHTLY_PARENT_ROOT is written as root if script invoked as root.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1829
	ISUSER=1 create_lock $NIGHTLY_PARENT_ROOT/nightly.lock "Ulockfile"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1830
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1831
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1832
# Locks have been taken, so we're doing a build and we're committed to
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1833
# the directories we may have created so far.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1834
newdirlist=
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1835
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1836
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1837
# Create mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1838
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1839
mail_msg_file="${TMPDIR}/mail_msg"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1840
touch $mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1841
build_time_file="${TMPDIR}/build_time"
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  1842
build_environ_file="${TMPDIR}/build_environ"
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  1843
touch $build_environ_file
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1844
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1845
#	Move old LOGFILE aside
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1846
#	ATLOG directory already made by 'create_lock' above
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1847
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1848
if [ -f $LOGFILE ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1849
	mv -f $LOGFILE ${LOGFILE}-
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1850
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1851
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1852
#	Build OsNet source
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1853
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1854
START_DATE=`date`
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1855
SECONDS=0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1856
echo "\n==== Nightly $maketype build started:   $START_DATE ====" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1857
    | tee -a $LOGFILE > $build_time_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1858
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  1859
echo "\nBuild project:  $build_project\nBuild taskid:   $build_taskid" | \
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  1860
    tee -a $mail_msg_file >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  1861
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1862
# make sure we log only to the nightly build file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1863
build_noise_file="${TMPDIR}/build_noise"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1864
exec </dev/null >$build_noise_file 2>&1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1865
4973
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
  1866
run_hook SYS_PRE_NIGHTLY
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
  1867
run_hook PRE_NIGHTLY
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
  1868
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1869
echo "\n==== list of environment variables ====\n" >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1870
env >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1871
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1872
echo "\n==== Nightly argument issues ====\n" | tee -a $mail_msg_file >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1873
2371
fece52ab5cdc 6417866 The TRACE and GPROF builds must die
sommerfe
parents: 2298
diff changeset
  1874
if [ "$P_FLAG" = "y" ]; then
fece52ab5cdc 6417866 The TRACE and GPROF builds must die
sommerfe
parents: 2298
diff changeset
  1875
	obsolete_build GPROF | tee -a $mail_msg_file >> $LOGFILE
fece52ab5cdc 6417866 The TRACE and GPROF builds must die
sommerfe
parents: 2298
diff changeset
  1876
fi
fece52ab5cdc 6417866 The TRACE and GPROF builds must die
sommerfe
parents: 2298
diff changeset
  1877
fece52ab5cdc 6417866 The TRACE and GPROF builds must die
sommerfe
parents: 2298
diff changeset
  1878
if [ "$T_FLAG" = "y" ]; then
fece52ab5cdc 6417866 The TRACE and GPROF builds must die
sommerfe
parents: 2298
diff changeset
  1879
	obsolete_build TRACE | tee -a $mail_msg_file >> $LOGFILE
fece52ab5cdc 6417866 The TRACE and GPROF builds must die
sommerfe
parents: 2298
diff changeset
  1880
fi
fece52ab5cdc 6417866 The TRACE and GPROF builds must die
sommerfe
parents: 2298
diff changeset
  1881
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  1882
if is_source_build; then
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1883
	if [ "$i_FLAG" = "y" -o "$i_CMD_LINE_FLAG" = "y" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1884
		echo "WARNING: the -S flags do not support incremental" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1885
		    "builds; forcing clobber\n" | tee -a $mail_msg_file >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1886
		i_FLAG=n
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1887
		i_CMD_LINE_FLAG=n
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1888
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1889
	if [ "$N_FLAG" = "n" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1890
		echo "WARNING: the -S flags do not support protocmp;" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1891
		    "protocmp disabled\n" | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1892
		    tee -a $mail_msg_file >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1893
		N_FLAG=y
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1894
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1895
	if [ "$l_FLAG" = "y" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1896
		echo "WARNING: the -S flags do not support lint;" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1897
		    "lint disabled\n" | tee -a $mail_msg_file >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1898
		l_FLAG=n
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1899
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1900
	if [ "$C_FLAG" = "y" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1901
		echo "WARNING: the -S flags do not support cstyle;" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1902
		    "cstyle check disabled\n" | tee -a $mail_msg_file >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1903
		C_FLAG=n
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1904
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1905
else
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1906
	if [ "$N_FLAG" = "y" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1907
		if [ "$p_FLAG" = "y" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1908
			cat <<EOF | tee -a $mail_msg_file >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1909
WARNING: the p option (create packages) is set, but so is the N option (do
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1910
         not run protocmp); this is dangerous; you should unset the N option
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1911
EOF
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1912
		else
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1913
			cat <<EOF | tee -a $mail_msg_file >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1914
Warning: the N option (do not run protocmp) is set; it probably shouldn't be
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1915
EOF
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1916
		fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1917
		echo "" | tee -a $mail_msg_file >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1918
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1919
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1920
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1921
if [ "$D_FLAG" = "n" -a "$l_FLAG" = "y" ]; then
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1922
	#
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1923
	# In the past we just complained but went ahead with the lint
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  1924
	# pass, even though the proto area was built non-DEBUG.  It's
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  1925
	# unlikely that non-DEBUG headers will make a difference, but
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1926
	# rather than assuming it's a safe combination, force the user
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  1927
	# to specify a DEBUG build.
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1928
	#
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1929
	echo "WARNING: DEBUG build not requested; disabling lint.\n" \
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1930
	    | tee -a $mail_msg_file >> $LOGFILE
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1931
	l_FLAG=n
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1932
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1933
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1934
if [ "$f_FLAG" = "y" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1935
	if [ "$i_FLAG" = "y" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1936
		echo "WARNING: the -f flag cannot be used during incremental" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1937
		    "builds; ignoring -f\n" | tee -a $mail_msg_file >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1938
		f_FLAG=n
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1939
	fi
10517
43ea36a8f8b6 6878057 clean up false unref for usr/src/pkgdefs/SUNW0on/Makefile
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 10445
diff changeset
  1940
	if [ "${l_FLAG}${p_FLAG}" != "yy" ]; then
43ea36a8f8b6 6878057 clean up false unref for usr/src/pkgdefs/SUNW0on/Makefile
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 10445
diff changeset
  1941
		echo "WARNING: the -f flag requires -l, and -p;" \
43ea36a8f8b6 6878057 clean up false unref for usr/src/pkgdefs/SUNW0on/Makefile
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 10445
diff changeset
  1942
		    "ignoring -f\n" | tee -a $mail_msg_file >> $LOGFILE
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1943
		f_FLAG=n
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1944
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1945
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1946
2538
b5894d78c55a 5016095 nightly should help determine what really changes from build to build
esaxe
parents: 2456
diff changeset
  1947
if [ "$w_FLAG" = "y" -a ! -d $ROOT ]; then
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1948
	echo "WARNING: -w specified, but $ROOT does not exist;" \
2538
b5894d78c55a 5016095 nightly should help determine what really changes from build to build
esaxe
parents: 2456
diff changeset
  1949
	    "ignoring -w\n" | tee -a $mail_msg_file >> $LOGFILE
b5894d78c55a 5016095 nightly should help determine what really changes from build to build
esaxe
parents: 2456
diff changeset
  1950
	w_FLAG=n
b5894d78c55a 5016095 nightly should help determine what really changes from build to build
esaxe
parents: 2456
diff changeset
  1951
fi
b5894d78c55a 5016095 nightly should help determine what really changes from build to build
esaxe
parents: 2456
diff changeset
  1952
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1953
if [ "$t_FLAG" = "n" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1954
	#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1955
	# We're not doing a tools build, so make sure elfsign(1) is
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1956
	# new enough to safely sign non-crypto binaries.  We test
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1957
	# debugging output from elfsign to detect the old version.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1958
	#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1959
	newelfsigntest=`SUNW_CRYPTO_DEBUG=stderr /usr/bin/elfsign verify \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1960
	    -e /usr/lib/security/pkcs11_softtoken.so.1 2>&1 \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1961
	    | egrep algorithmOID`
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1962
	if [ -z "$newelfsigntest" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1963
		echo "WARNING: /usr/bin/elfsign out of date;" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1964
		    "will only sign crypto modules\n" | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1965
		    tee -a $mail_msg_file >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1966
		export ELFSIGN_OBJECT=true
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1967
	elif [ "$VERIFY_ELFSIGN" = "y" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1968
		echo "WARNING: VERIFY_ELFSIGN=y requires" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1969
		    "the -t flag; ignoring VERIFY_ELFSIGN\n" | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1970
		    tee -a $mail_msg_file >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1971
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1972
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1973
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1974
[ "$O_FLAG" = y ] && MULTI_PROTO=yes
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1975
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1976
case $MULTI_PROTO in
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1977
yes|no)	;;
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1978
*)
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1979
	echo "WARNING: MULTI_PROTO is \"$MULTI_PROTO\"; " \
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1980
	    "should be \"yes\" or \"no\"." | tee -a $mail_msg_file >> $LOGFILE
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1981
	echo "Setting MULTI_PROTO to \"no\".\n" | \
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1982
	    tee -a $mail_msg_file >> $LOGFILE
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1983
	export MULTI_PROTO=no
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1984
	;;
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1985
esac
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1986
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1987
echo "\n==== Build version ====\n" | tee -a $mail_msg_file >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1988
echo $VERSION | tee -a $mail_msg_file >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  1989
2538
b5894d78c55a 5016095 nightly should help determine what really changes from build to build
esaxe
parents: 2456
diff changeset
  1990
# Save the current proto area if we're comparing against the last build
b5894d78c55a 5016095 nightly should help determine what really changes from build to build
esaxe
parents: 2456
diff changeset
  1991
if [ "$w_FLAG" = "y" -a -d "$ROOT" ]; then
b5894d78c55a 5016095 nightly should help determine what really changes from build to build
esaxe
parents: 2456
diff changeset
  1992
    if [ -d "$ROOT.prev" ]; then
b5894d78c55a 5016095 nightly should help determine what really changes from build to build
esaxe
parents: 2456
diff changeset
  1993
	rm -rf $ROOT.prev
b5894d78c55a 5016095 nightly should help determine what really changes from build to build
esaxe
parents: 2456
diff changeset
  1994
    fi
b5894d78c55a 5016095 nightly should help determine what really changes from build to build
esaxe
parents: 2456
diff changeset
  1995
    mv $ROOT $ROOT.prev
b5894d78c55a 5016095 nightly should help determine what really changes from build to build
esaxe
parents: 2456
diff changeset
  1996
fi
b5894d78c55a 5016095 nightly should help determine what really changes from build to build
esaxe
parents: 2456
diff changeset
  1997
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1998
# Same for non-DEBUG proto area
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  1999
if [ "$w_FLAG" = "y" -a "$MULTI_PROTO" = yes -a -d "$ROOT-nd" ]; then
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2000
	if [ -d "$ROOT-nd.prev" ]; then
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2001
		rm -rf $ROOT-nd.prev
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2002
	fi
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2003
	mv $ROOT-nd $ROOT-nd.prev
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2004
fi
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2005
13161
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2006
#
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2007
# Echo the SCM type of the parent workspace, this can't just be which_scm
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2008
# as that does not know how to identify various network repositories.
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2009
#
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2010
function parent_wstype {
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2011
	typeset scm_type junk
7544
7ecb3a3bcf8f 6738408 can't build using nightly script from gate
John.Zolnowsky@Sun.COM
parents: 7264
diff changeset
  2012
7ecb3a3bcf8f 6738408 can't build using nightly script from gate
John.Zolnowsky@Sun.COM
parents: 7264
diff changeset
  2013
	CODEMGR_WS="$BRINGOVER_WS" "$WHICH_SCM" 2>/dev/null \
13161
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2014
	    | read scm_type junk
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2015
	if [[ -z "$scm_type" || "$scm_type" == unknown ]]; then
7544
7ecb3a3bcf8f 6738408 can't build using nightly script from gate
John.Zolnowsky@Sun.COM
parents: 7264
diff changeset
  2016
		# Probe BRINGOVER_WS to determine its type
7ecb3a3bcf8f 6738408 can't build using nightly script from gate
John.Zolnowsky@Sun.COM
parents: 7264
diff changeset
  2017
		if [[ $BRINGOVER_WS == svn*://* ]]; then
13161
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2018
			scm_type="subversion"
7544
7ecb3a3bcf8f 6738408 can't build using nightly script from gate
John.Zolnowsky@Sun.COM
parents: 7264
diff changeset
  2019
		elif [[ $BRINGOVER_WS == file://* ]] &&
7ecb3a3bcf8f 6738408 can't build using nightly script from gate
John.Zolnowsky@Sun.COM
parents: 7264
diff changeset
  2020
		    egrep -s "This is a Subversion repository" \
7ecb3a3bcf8f 6738408 can't build using nightly script from gate
John.Zolnowsky@Sun.COM
parents: 7264
diff changeset
  2021
		    ${BRINGOVER_WS#file://}/README.txt 2> /dev/null; then
13161
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2022
			scm_type="subversion"
7544
7ecb3a3bcf8f 6738408 can't build using nightly script from gate
John.Zolnowsky@Sun.COM
parents: 7264
diff changeset
  2023
		elif [[ $BRINGOVER_WS == ssh://* ]]; then
13161
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2024
			scm_type="mercurial"
7544
7ecb3a3bcf8f 6738408 can't build using nightly script from gate
John.Zolnowsky@Sun.COM
parents: 7264
diff changeset
  2025
		elif [[ $BRINGOVER_WS == http://* ]] && \
13161
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2026
		    wget -q -O- --save-headers "$BRINGOVER_WS/?cmd=heads" | \
7544
7ecb3a3bcf8f 6738408 can't build using nightly script from gate
John.Zolnowsky@Sun.COM
parents: 7264
diff changeset
  2027
		    egrep -s "application/mercurial" 2> /dev/null; then
13161
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2028
			scm_type="mercurial"
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2029
		elif svn info $BRINGOVER_WS > /dev/null 2>&1; then
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2030
			scm_type="subversion"
7544
7ecb3a3bcf8f 6738408 can't build using nightly script from gate
John.Zolnowsky@Sun.COM
parents: 7264
diff changeset
  2031
		else
13161
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2032
			scm_type="none"
7544
7ecb3a3bcf8f 6738408 can't build using nightly script from gate
John.Zolnowsky@Sun.COM
parents: 7264
diff changeset
  2033
		fi
13161
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2034
	fi    
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2035
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2036
	# fold both unsupported and unrecognized results into "none"
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2037
	case "$scm_type" in
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2038
	none|subversion|teamware|mercurial)
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2039
		;;
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2040
	*)	scm_type=none
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2041
		;;
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2042
	esac
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2043
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2044
	echo $scm_type
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2045
}
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2046
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2047
# Echo the SCM types of $CODEMGR_WS and $BRINGOVER_WS
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2048
function child_wstype {
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2049
	typeset scm_type junk
7544
7ecb3a3bcf8f 6738408 can't build using nightly script from gate
John.Zolnowsky@Sun.COM
parents: 7264
diff changeset
  2050
7ecb3a3bcf8f 6738408 can't build using nightly script from gate
John.Zolnowsky@Sun.COM
parents: 7264
diff changeset
  2051
	# Probe CODEMGR_WS to determine its type
7ecb3a3bcf8f 6738408 can't build using nightly script from gate
John.Zolnowsky@Sun.COM
parents: 7264
diff changeset
  2052
	if [[ -d $CODEMGR_WS ]]; then
13161
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2053
		$WHICH_SCM | read scm_type junk || exit 1
7544
7ecb3a3bcf8f 6738408 can't build using nightly script from gate
John.Zolnowsky@Sun.COM
parents: 7264
diff changeset
  2054
	fi
7ecb3a3bcf8f 6738408 can't build using nightly script from gate
John.Zolnowsky@Sun.COM
parents: 7264
diff changeset
  2055
13161
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2056
	case "$scm_type" in
13949
31eec1000095 3272 findunref should support git
Richard Lowe <richlowe@richlowe.net>
parents: 13938
diff changeset
  2057
	none|subversion|git|teamware|mercurial)
7544
7ecb3a3bcf8f 6738408 can't build using nightly script from gate
John.Zolnowsky@Sun.COM
parents: 7264
diff changeset
  2058
		;;
13161
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2059
	*)	scm_type=none
7544
7ecb3a3bcf8f 6738408 can't build using nightly script from gate
John.Zolnowsky@Sun.COM
parents: 7264
diff changeset
  2060
		;;
7ecb3a3bcf8f 6738408 can't build using nightly script from gate
John.Zolnowsky@Sun.COM
parents: 7264
diff changeset
  2061
	esac
13161
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2062
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2063
	echo $scm_type
7544
7ecb3a3bcf8f 6738408 can't build using nightly script from gate
John.Zolnowsky@Sun.COM
parents: 7264
diff changeset
  2064
}
7ecb3a3bcf8f 6738408 can't build using nightly script from gate
John.Zolnowsky@Sun.COM
parents: 7264
diff changeset
  2065
13361
2502776ad797 224 findunref build shouldn't fail if SCM can't be determined
Richard Lowe <richlowe@richlowe.net>
parents: 13325
diff changeset
  2066
SCM_TYPE=$(child_wstype)
7544
7ecb3a3bcf8f 6738408 can't build using nightly script from gate
John.Zolnowsky@Sun.COM
parents: 7264
diff changeset
  2067
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2068
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2069
#	Decide whether to clobber
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2070
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2071
if [ "$i_FLAG" = "n" -a -d "$SRC" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2072
	echo "\n==== Make clobber at `date` ====\n" >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2073
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2074
	cd $SRC
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2075
	# remove old clobber file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2076
	rm -f $SRC/clobber.out
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2077
	rm -f $SRC/clobber-${MACH}.out
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2078
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2079
	# Remove all .make.state* files, just in case we are restarting
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2080
	# the build after having interrupted a previous 'make clobber'.
13660
189bdb3d9698 1960 developer tools should support git
Richard Lowe <richlowe@richlowe.net>
parents: 13655
diff changeset
  2081
	find . \( -name SCCS -o -name .hg -o -name .svn -o -name .git \
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2082
		-o -name 'interfaces.*' \) -prune \
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2083
		-o -name '.make.*' -print | xargs rm -f
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2084
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2085
	$MAKE -ek clobber 2>&1 | tee -a $SRC/clobber-${MACH}.out >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2086
	echo "\n==== Make clobber ERRORS ====\n" >> $mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2087
	grep "$MAKE:" $SRC/clobber-${MACH}.out |
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2088
		egrep -v "Ignoring unknown host" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2089
		>> $mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2090
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2091
	if [[ "$t_FLAG" = "y" || "$O_FLAG" = "y" ]]; then
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2092
		echo "\n==== Make tools clobber at `date` ====\n" >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2093
		cd ${TOOLS}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2094
		rm -f ${TOOLS}/clobber-${MACH}.out
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2095
		$MAKE TOOLS_PROTO=$TOOLS_PROTO -ek clobber 2>&1 | \
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2096
			tee -a ${TOOLS}/clobber-${MACH}.out >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2097
		echo "\n==== Make tools clobber ERRORS ====\n" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2098
			>> $mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2099
		grep "$MAKE:" ${TOOLS}/clobber-${MACH}.out \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2100
			>> $mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2101
		rm -rf ${TOOLS_PROTO}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2102
		mkdir -p ${TOOLS_PROTO}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2103
	fi
2538
b5894d78c55a 5016095 nightly should help determine what really changes from build to build
esaxe
parents: 2456
diff changeset
  2104
12649
87a8e25df5cf 6919429 new crypto tarball doesn't play well with ON Tonic builds
Mike Kupfer <Mike.Kupfer@Oracle.COM>
parents: 12486
diff changeset
  2105
	typeset roots=$(allprotos)
87a8e25df5cf 6919429 new crypto tarball doesn't play well with ON Tonic builds
Mike Kupfer <Mike.Kupfer@Oracle.COM>
parents: 12486
diff changeset
  2106
	echo "\n\nClearing $roots" >> "$LOGFILE"
87a8e25df5cf 6919429 new crypto tarball doesn't play well with ON Tonic builds
Mike Kupfer <Mike.Kupfer@Oracle.COM>
parents: 12486
diff changeset
  2107
	rm -rf $roots
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2108
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2109
	# Get back to a clean workspace as much as possible to catch
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2110
	# problems that only occur on fresh workspaces.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2111
	# Remove all .make.state* files, libraries, and .o's that may
900
7a6a7342ba44 6346595 tools changes for split tree
kupfer
parents: 851
diff changeset
  2112
	# have been omitted from clobber.  A couple of libraries are
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2113
	# under source code control, so leave them alone.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2114
	# We should probably blow away temporary directories too.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2115
	cd $SRC
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2116
	find $relsrcdirs \( -name SCCS -o -name .hg -o -name .svn \
13660
189bdb3d9698 1960 developer tools should support git
Richard Lowe <richlowe@richlowe.net>
parents: 13655
diff changeset
  2117
	    -o -name .git -o -name 'interfaces.*' \) -prune -o \
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2118
	    \( -name '.make.*' -o -name 'lib*.a' -o -name 'lib*.so*' -o \
900
7a6a7342ba44 6346595 tools changes for split tree
kupfer
parents: 851
diff changeset
  2119
	       -name '*.o' \) -print | \
7a6a7342ba44 6346595 tools changes for split tree
kupfer
parents: 851
diff changeset
  2120
	    grep -v 'tools/ctf/dwarf/.*/libdwarf' | xargs rm -f
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2121
else
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2122
	echo "\n==== No clobber at `date` ====\n" >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2123
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2124
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
  2125
type bringover_teamware > /dev/null 2>&1 || function bringover_teamware {
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2126
	# sleep on the parent workspace's lock
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2127
	while egrep -s write $BRINGOVER_WS/Codemgr_wsdata/locks
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2128
	do
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2129
		sleep 120
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2130
	done
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2131
5797
38a210addbf0 6630045 nightly -t should be the default
suha
parents: 5357
diff changeset
  2132
	if [[ -z $BRINGOVER ]]; then
38a210addbf0 6630045 nightly -t should be the default
suha
parents: 5357
diff changeset
  2133
		BRINGOVER=$TEAMWARE/bin/bringover
38a210addbf0 6630045 nightly -t should be the default
suha
parents: 5357
diff changeset
  2134
	fi
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2135
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2136
	staffer $BRINGOVER -c "nightly update" -p $BRINGOVER_WS \
1810
da7eacf55e82 6407796 "sccs get" rule considered harmful
sommerfe
parents: 1729
diff changeset
  2137
	    -w $CODEMGR_WS $BRINGOVER_FILES < /dev/null 2>&1 ||
da7eacf55e82 6407796 "sccs get" rule considered harmful
sommerfe
parents: 1729
diff changeset
  2138
		touch $TMPDIR/bringover_failed
da7eacf55e82 6407796 "sccs get" rule considered harmful
sommerfe
parents: 1729
diff changeset
  2139
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2140
        staffer bringovercheck $CODEMGR_WS >$TMPDIR/bringovercheck.out 2>&1
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2141
	if [ -s $TMPDIR/bringovercheck.out ]; then
2371
fece52ab5cdc 6417866 The TRACE and GPROF builds must die
sommerfe
parents: 2298
diff changeset
  2142
		echo "\n==== POST-BRINGOVER CLEANUP NOISE ====\n"
fece52ab5cdc 6417866 The TRACE and GPROF builds must die
sommerfe
parents: 2298
diff changeset
  2143
		cat $TMPDIR/bringovercheck.out
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2144
	fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2145
}
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2146
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
  2147
type bringover_mercurial > /dev/null 2>&1 || function bringover_mercurial {
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2148
	typeset -x PATH=$PATH
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2149
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2150
	# If the repository doesn't exist yet, then we want to populate it.
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2151
	if [[ ! -d $CODEMGR_WS/.hg ]]; then
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2152
		staffer hg init $CODEMGR_WS
8787
cf95a2b24554 6759002 using nightly to create an hg workspace does not set default path
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8785
diff changeset
  2153
		staffer echo "[paths]" > $CODEMGR_WS/.hg/hgrc
cf95a2b24554 6759002 using nightly to create an hg workspace does not set default path
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8785
diff changeset
  2154
		staffer echo "default=$BRINGOVER_WS" >> $CODEMGR_WS/.hg/hgrc
8789
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2155
		touch $TMPDIR/new_repository
7264
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2156
	fi
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2157
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2158
	#
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2159
	# If the user set CLOSED_BRINGOVER_WS and didn't set CLOSED_IS_PRESENT
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2160
	# to "no," then we'll want to initialise the closed repository
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2161
	#
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2162
	# We use $orig_closed_is_present instead of $CLOSED_IS_PRESENT,
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2163
	# because for newly-created source trees, the latter will be "no"
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2164
	# until after the bringover completes.
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2165
	#
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2166
	if [[ "$orig_closed_is_present" != "no" && \
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2167
	    -n "$CLOSED_BRINGOVER_WS" && \
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2168
	    ! -d $CODEMGR_WS/usr/closed/.hg ]]; then
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2169
		staffer mkdir -p $CODEMGR_WS/usr/closed
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2170
		staffer hg init $CODEMGR_WS/usr/closed
8787
cf95a2b24554 6759002 using nightly to create an hg workspace does not set default path
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8785
diff changeset
  2171
		staffer echo "[paths]" > $CODEMGR_WS/usr/closed/.hg/hgrc
cf95a2b24554 6759002 using nightly to create an hg workspace does not set default path
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8785
diff changeset
  2172
		staffer echo "default=$CLOSED_BRINGOVER_WS" >> $CODEMGR_WS/usr/closed/.hg/hgrc
8789
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2173
		touch $TMPDIR/new_closed
7264
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2174
		export CLOSED_IS_PRESENT=yes
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2175
	fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2176
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2177
	typeset -x HGMERGE="/bin/false"
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2178
7264
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2179
	#
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2180
	# If the user has changes, regardless of whether those changes are
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2181
	# committed, and regardless of whether those changes conflict, then
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2182
	# we'll attempt to merge them either implicitly (uncommitted) or
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2183
	# explicitly (committed).
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2184
	#
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2185
	# These are the messages we'll use to help clarify mercurial output
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2186
	# in those cases.
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2187
	#
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2188
	typeset mergefailmsg="\
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2189
***\n\
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2190
*** nightly was unable to automatically merge your changes.  You should\n\
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2191
*** redo the full merge manually, following the steps outlined by mercurial\n\
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2192
*** above, then restart nightly.\n\
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2193
***\n"
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2194
	typeset mergepassmsg="\
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2195
***\n\
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2196
*** nightly successfully merged your changes.  This means that your working\n\
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2197
*** directory has been updated, but those changes are not yet committed.\n\
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2198
*** After nightly completes, you should validate the results of the merge,\n\
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2199
*** then use hg commit manually.\n\
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2200
***\n"
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2201
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2202
	#
7264
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2203
	# For each repository in turn:
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2204
	#
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2205
	# 1. Do the pull.  If this fails, dump the output and bail out.
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2206
	#
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2207
	# 2. If the pull resulted in an extra head, do an explicit merge.
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2208
	#    If this fails, dump the output and bail out.
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2209
	#
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2210
	# Because we can't rely on Mercurial to exit with a failure code
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2211
	# when a merge fails (Mercurial issue #186), we must grep the
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2212
	# output of pull/merge to check for attempted and/or failed merges.
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2213
	#
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2214
	# 3. If a merge failed, set the message and fail the bringover.
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2215
	#
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2216
	# 4. Otherwise, if a merge succeeded, set the message
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2217
	#
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2218
	# 5. Dump the output, and any message from step 3 or 4.
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2219
	#
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2220
8789
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2221
	typeset HG_SOURCE=$BRINGOVER_WS
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2222
	if [ ! -f $TMPDIR/new_repository ]; then
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2223
		HG_SOURCE=$TMPDIR/open_bundle.hg
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2224
		staffer hg --cwd $CODEMGR_WS incoming --bundle $HG_SOURCE \
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2225
		    -v $BRINGOVER_WS > $TMPDIR/incoming_open.out
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2226
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2227
		#
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2228
		# If there are no incoming changesets, then incoming will
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2229
		# fail, and there will be no bundle file.  Reset the source,
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2230
		# to allow the remaining logic to complete with no false
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2231
		# negatives.  (Unlike incoming, pull will return success
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2232
		# for the no-change case.)
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2233
		#
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2234
		if (( $? != 0 )); then
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2235
			HG_SOURCE=$BRINGOVER_WS
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2236
		fi
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2237
	fi
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2238
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2239
	staffer hg --cwd $CODEMGR_WS pull -u $HG_SOURCE \
7264
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2240
	    > $TMPDIR/pull_open.out 2>&1
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2241
	if (( $? != 0 )); then
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2242
		printf "%s: pull failed as follows:\n\n" "$CODEMGR_WS"
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2243
		cat $TMPDIR/pull_open.out
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2244
		if grep "^merging.*failed" $TMPDIR/pull_open.out > /dev/null 2>&1; then
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2245
			printf "$mergefailmsg"
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2246
		fi
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2247
		touch $TMPDIR/bringover_failed
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2248
		return
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2249
	fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2250
7264
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2251
	if grep "not updating" $TMPDIR/pull_open.out > /dev/null 2>&1; then
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2252
		staffer hg --cwd $CODEMGR_WS merge \
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2253
		    >> $TMPDIR/pull_open.out 2>&1
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2254
		if (( $? != 0 )); then
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2255
			printf "%s: merge failed as follows:\n\n" \
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2256
			    "$CODEMGR_WS"
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2257
			cat $TMPDIR/pull_open.out
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2258
			if grep "^merging.*failed" $TMPDIR/pull_open.out \
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2259
			    > /dev/null 2>&1; then
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2260
				printf "$mergefailmsg"
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2261
			fi
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2262
			touch $TMPDIR/bringover_failed
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2263
			return
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2264
		fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2265
	fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2266
7264
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2267
	printf "updated %s with the following results:\n" "$CODEMGR_WS"
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2268
	cat $TMPDIR/pull_open.out
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2269
	if grep "^merging" $TMPDIR/pull_open.out >/dev/null 2>&1; then
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2270
		printf "$mergepassmsg"
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2271
	fi
7264
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2272
	printf "\n"
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2273
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2274
	#
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2275
	# We only want to update usr/closed if it exists, and we haven't been
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2276
	# told not to via $CLOSED_IS_PRESENT, and we actually know where to
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2277
	# pull from ($CLOSED_BRINGOVER_WS).
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2278
	#
7264
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2279
	if [[ $CLOSED_IS_PRESENT = yes && \
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2280
	    -d $CODEMGR_WS/usr/closed/.hg && \
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2281
	    -n $CLOSED_BRINGOVER_WS ]]; then
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2282
8789
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2283
		HG_SOURCE=$CLOSED_BRINGOVER_WS
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2284
		if [ ! -f $TMPDIR/new_closed ]; then
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2285
			HG_SOURCE=$TMPDIR/closed_bundle.hg
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2286
			staffer hg --cwd $CODEMGR_WS/usr/closed incoming \
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2287
			    --bundle $HG_SOURCE -v $CLOSED_BRINGOVER_WS \
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2288
			    > $TMPDIR/incoming_closed.out
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2289
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2290
			#
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2291
			# If there are no incoming changesets, then incoming will
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2292
			# fail, and there will be no bundle file.  Reset the source,
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2293
			# to allow the remaining logic to complete with no false
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2294
			# negatives.  (Unlike incoming, pull will return success
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2295
			# for the no-change case.)
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2296
			#
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2297
			if (( $? != 0 )); then
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2298
				HG_SOURCE=$CLOSED_BRINGOVER_WS
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2299
			fi
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2300
		fi
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2301
7264
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2302
		staffer hg --cwd $CODEMGR_WS/usr/closed pull -u \
8789
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2303
			$HG_SOURCE > $TMPDIR/pull_closed.out 2>&1
7264
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2304
		if (( $? != 0 )); then
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2305
			printf "closed pull failed as follows:\n\n"
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2306
			cat $TMPDIR/pull_closed.out
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2307
			if grep "^merging.*failed" $TMPDIR/pull_closed.out \
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2308
			    > /dev/null 2>&1; then
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2309
				printf "$mergefailmsg"
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2310
			fi
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2311
			touch $TMPDIR/bringover_failed
7264
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2312
			return
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2313
		fi
7264
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2314
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2315
		if grep "not updating" $TMPDIR/pull_closed.out > /dev/null 2>&1; then
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2316
			staffer hg --cwd $CODEMGR_WS/usr/closed merge \
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2317
			    >> $TMPDIR/pull_closed.out 2>&1
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2318
			if (( $? != 0 )); then
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2319
				printf "closed merge failed as follows:\n\n"
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2320
				cat $TMPDIR/pull_closed.out
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2321
				if grep "^merging.*failed" $TMPDIR/pull_closed.out > /dev/null 2>&1; then
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2322
					printf "$mergefailmsg"
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2323
				fi
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2324
				touch $TMPDIR/bringover_failed
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2325
				return
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2326
			fi
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2327
		fi
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2328
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2329
		printf "updated %s with the following results:\n" \
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2330
		    "$CODEMGR_WS/usr/closed"
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2331
		cat $TMPDIR/pull_closed.out
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2332
		if grep "^merging" $TMPDIR/pull_closed.out > /dev/null 2>&1; then
89c9135b80e3 6730623 nightly should create usr/closed if explicitly asked
mjnelson
parents: 7123
diff changeset
  2333
			printf "$mergepassmsg"
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2334
		fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2335
	fi
8789
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2336
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2337
	#
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2338
	# Per-changeset output is neither useful nor manageable for a
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2339
	# newly-created repository.
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2340
	#
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2341
	if [ -f $TMPDIR/new_repository ]; then
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2342
		return
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2343
	fi
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2344
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2345
	printf "\nadded the following changesets to open repository:\n"
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2346
	cat $TMPDIR/incoming_open.out
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2347
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2348
	#
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2349
	# The closed repository could have been newly created, even though
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2350
	# the open one previously existed...
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2351
	#
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2352
	if [ -f $TMPDIR/new_closed ]; then
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2353
		return
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2354
	fi
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2355
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2356
	if [ -f $TMPDIR/incoming_closed.out ]; then
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2357
		printf "\nadded the following changesets to closed repository:\n"
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2358
		cat $TMPDIR/incoming_closed.out
1b073e3e4539 6736013 nightly 'bringover' ("hg pull -u") should list files changed again. pretty please?
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 8787
diff changeset
  2359
	fi
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2360
}
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2361
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
  2362
type bringover_subversion > /dev/null 2>&1 || function bringover_subversion {
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2363
	typeset -x PATH=$PATH
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2364
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2365
	if [[ ! -d $CODEMGR_WS/.svn ]]; then
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2366
		staffer svn checkout $BRINGOVER_WS $CODEMGR_WS ||
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2367
			touch $TMPDIR/bringover_failed
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2368
	else
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2369
		typeset root
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2370
		root=$(staffer svn info $CODEMGR_WS |
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2371
			nawk '/^Repository Root:/ {print $NF}')
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2372
		if [[ $root != $BRINGOVER_WS ]]; then
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2373
			# We fail here because there's no way to update
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2374
			# from a named repo.
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2375
			cat <<-EOF
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2376
			\$BRINGOVER_WS doesn't match repository root:
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2377
			  \$BRINGOVER_WS:  $BRINGOVER_WS
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2378
			  Repository root: $root
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2379
			EOF
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2380
			touch $TMPDIR/bringover_failed
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2381
		else
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2382
			# If a conflict happens, svn still exits 0.
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2383
			staffer svn update $CODEMGR_WS | tee $TMPDIR/pull.out ||
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2384
				touch $TMPDIR/bringover_failed
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2385
			if grep "^C" $TMPDIR/pull.out > /dev/null 2>&1; then
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2386
				touch $TMPDIR/bringover_failed
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2387
			fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2388
		fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2389
	fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2390
}
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2391
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
  2392
type bringover_none > /dev/null 2>&1 || function bringover_none {
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2393
	echo "Couldn't figure out what kind of SCM to use for $BRINGOVER_WS."
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2394
	touch $TMPDIR/bringover_failed
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2395
}
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2396
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2397
#
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2398
#	Decide whether to bringover to the codemgr workspace
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2399
#
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2400
if [ "$n_FLAG" = "n" ]; then
13161
35133fa0d604 115 /opt/onbld/bin/nightly[2377]: wstypes: line 2346: http_get: not found
Richard Lowe <richlowe@richlowe.net>
parents: 13015
diff changeset
  2401
	PARENT_SCM_TYPE=$(parent_wstype)
7123
6e84ae5cc433 6725705 findunref build fails under nightly if $CLONE_WS is set but non-existent
mjnelson
parents: 7078
diff changeset
  2402
6e84ae5cc433 6725705 findunref build fails under nightly if $CLONE_WS is set but non-existent
mjnelson
parents: 7078
diff changeset
  2403
	if [[ $SCM_TYPE != none && $SCM_TYPE != $PARENT_SCM_TYPE ]]; then
6e84ae5cc433 6725705 findunref build fails under nightly if $CLONE_WS is set but non-existent
mjnelson
parents: 7078
diff changeset
  2404
		echo "cannot bringover from $PARENT_SCM_TYPE to $SCM_TYPE, " \
6e84ae5cc433 6725705 findunref build fails under nightly if $CLONE_WS is set but non-existent
mjnelson
parents: 7078
diff changeset
  2405
		    "quitting at `date`." | tee -a $mail_msg_file >> $LOGFILE
6e84ae5cc433 6725705 findunref build fails under nightly if $CLONE_WS is set but non-existent
mjnelson
parents: 7078
diff changeset
  2406
		exit 1
6e84ae5cc433 6725705 findunref build fails under nightly if $CLONE_WS is set but non-existent
mjnelson
parents: 7078
diff changeset
  2407
	fi
6e84ae5cc433 6725705 findunref build fails under nightly if $CLONE_WS is set but non-existent
mjnelson
parents: 7078
diff changeset
  2408
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2409
	run_hook PRE_BRINGOVER
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2410
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2411
	echo "\n==== bringover to $CODEMGR_WS at `date` ====\n" >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2412
	echo "\n==== BRINGOVER LOG ====\n" >> $mail_msg_file
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2413
7123
6e84ae5cc433 6725705 findunref build fails under nightly if $CLONE_WS is set but non-existent
mjnelson
parents: 7078
diff changeset
  2414
	eval "bringover_${PARENT_SCM_TYPE}" 2>&1 |
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2415
		tee -a $mail_msg_file >> $LOGFILE
1810
da7eacf55e82 6407796 "sccs get" rule considered harmful
sommerfe
parents: 1729
diff changeset
  2416
2371
fece52ab5cdc 6417866 The TRACE and GPROF builds must die
sommerfe
parents: 2298
diff changeset
  2417
	if [ -f $TMPDIR/bringover_failed ]; then
1810
da7eacf55e82 6407796 "sccs get" rule considered harmful
sommerfe
parents: 1729
diff changeset
  2418
		rm -f $TMPDIR/bringover_failed
da7eacf55e82 6407796 "sccs get" rule considered harmful
sommerfe
parents: 1729
diff changeset
  2419
		build_ok=n
2371
fece52ab5cdc 6417866 The TRACE and GPROF builds must die
sommerfe
parents: 2298
diff changeset
  2420
		echo "trouble with bringover, quitting at `date`." |
1810
da7eacf55e82 6407796 "sccs get" rule considered harmful
sommerfe
parents: 1729
diff changeset
  2421
			tee -a $mail_msg_file >> $LOGFILE
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2422
		exit 1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2423
	fi
1202
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
  2424
7123
6e84ae5cc433 6725705 findunref build fails under nightly if $CLONE_WS is set but non-existent
mjnelson
parents: 7078
diff changeset
  2425
	#
6e84ae5cc433 6725705 findunref build fails under nightly if $CLONE_WS is set but non-existent
mjnelson
parents: 7078
diff changeset
  2426
	# It's possible that we used the bringover above to create
6e84ae5cc433 6725705 findunref build fails under nightly if $CLONE_WS is set but non-existent
mjnelson
parents: 7078
diff changeset
  2427
	# $CODEMGR_WS.  If so, then SCM_TYPE was previously "none,"
6e84ae5cc433 6725705 findunref build fails under nightly if $CLONE_WS is set but non-existent
mjnelson
parents: 7078
diff changeset
  2428
	# but should now be the same as $BRINGOVER_WS.
6e84ae5cc433 6725705 findunref build fails under nightly if $CLONE_WS is set but non-existent
mjnelson
parents: 7078
diff changeset
  2429
	#
6e84ae5cc433 6725705 findunref build fails under nightly if $CLONE_WS is set but non-existent
mjnelson
parents: 7078
diff changeset
  2430
	[[ $SCM_TYPE = none ]] && SCM_TYPE=$PARENT_SCM_TYPE
6e84ae5cc433 6725705 findunref build fails under nightly if $CLONE_WS is set but non-existent
mjnelson
parents: 7078
diff changeset
  2431
4973
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
  2432
	run_hook POST_BRINGOVER
e9e56fdeb64d 6584986 *nightly* needs a hook for shared build machines
sommerfe
parents: 4680
diff changeset
  2433
1202
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
  2434
	#
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
  2435
	# Possible transition from pre-split workspace to split
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
  2436
	# workspace.  See if the bringover changed anything.
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
  2437
	#
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
  2438
	CLOSED_IS_PRESENT="$orig_closed_is_present"
02db040f16e8 6366785 nightly doesn't handle transition from pre-split to split workspace
kupfer
parents: 1168
diff changeset
  2439
	check_closed_tree
12210
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
  2440
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2441
else
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2442
	echo "\n==== No bringover to $CODEMGR_WS ====\n" >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2443
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2444
12210
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
  2445
if [[ "$O_FLAG" = y && "$CLOSED_IS_PRESENT" != "yes" ]]; then
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
  2446
	build_ok=n
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
  2447
	echo "OpenSolaris binary deliverables need usr/closed." \
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
  2448
	    | tee -a "$mail_msg_file" >> $LOGFILE
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
  2449
	exit 1
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
  2450
fi
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
  2451
13290
6489e7702a16 689 nightly.sh doesn't do fresh bringovers
Roland Mainz <roland.mainz@nexenta.com>
parents: 13272
diff changeset
  2452
# Safeguards
6489e7702a16 689 nightly.sh doesn't do fresh bringovers
Roland Mainz <roland.mainz@nexenta.com>
parents: 13272
diff changeset
  2453
[[ -v CODEMGR_WS ]] || fatal_error "Error: Variable CODEMGR_WS not set."
6489e7702a16 689 nightly.sh doesn't do fresh bringovers
Roland Mainz <roland.mainz@nexenta.com>
parents: 13272
diff changeset
  2454
[[ -d "${CODEMGR_WS}" ]] || fatal_error "Error: ${CODEMGR_WS} is not a directory."
6489e7702a16 689 nightly.sh doesn't do fresh bringovers
Roland Mainz <roland.mainz@nexenta.com>
parents: 13272
diff changeset
  2455
[[ -f "${CODEMGR_WS}/usr/src/Makefile" ]] || fatal_error "Error: ${CODEMGR_WS}/usr/src/Makefile not found."
6489e7702a16 689 nightly.sh doesn't do fresh bringovers
Roland Mainz <roland.mainz@nexenta.com>
parents: 13272
diff changeset
  2456
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2457
echo "\n==== Build environment ====\n" | tee -a $build_environ_file >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2458
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2459
# System
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2460
whence uname | tee -a $build_environ_file >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2461
uname -a 2>&1 | tee -a $build_environ_file >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2462
echo | tee -a $build_environ_file >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2463
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2464
# make
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2465
whence $MAKE | tee -a $build_environ_file >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2466
$MAKE -v | tee -a $build_environ_file >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2467
echo "number of concurrent jobs = $DMAKE_MAX_JOBS" |
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2468
    tee -a $build_environ_file >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2469
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2470
#
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2471
# Report the compiler versions.
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2472
#
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2473
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2474
if [[ ! -f $SRC/Makefile ]]; then
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2475
	build_ok=n
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2476
	echo "\nUnable to find \"Makefile\" in $SRC." | \
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2477
	    tee -a $build_environ_file >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2478
	exit 1
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2479
fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2480
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2481
( cd $SRC
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2482
  for target in cc-version cc64-version java-version; do
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2483
	echo
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2484
	#
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2485
	# Put statefile somewhere we know we can write to rather than trip
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2486
	# over a read-only $srcroot.
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2487
	#
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2488
	rm -f $TMPDIR/make-state
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2489
	export SRC
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2490
	if $MAKE -K $TMPDIR/make-state -e $target 2>/dev/null; then
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2491
		continue
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2492
	fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2493
	touch $TMPDIR/nocompiler
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2494
  done
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2495
  echo
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2496
) | tee -a $build_environ_file >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2497
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2498
if [ -f $TMPDIR/nocompiler ]; then
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2499
	rm -f $TMPDIR/nocompiler
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2500
	build_ok=n
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2501
	echo "Aborting due to missing compiler." |
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2502
		tee -a $build_environ_file >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2503
	exit 1
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2504
fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2505
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2506
# as
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2507
whence as | tee -a $build_environ_file >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2508
as -V 2>&1 | head -1 | tee -a $build_environ_file >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2509
echo | tee -a $build_environ_file >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2510
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2511
# Check that we're running a capable link-editor
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2512
whence ld | tee -a $build_environ_file >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2513
LDVER=`ld -V 2>&1`
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2514
echo $LDVER | tee -a $build_environ_file >> $LOGFILE
13938
cab67b95c26b 3298 illumos link-editor and related tools should be differentiable
Richard Lowe <richlowe@richlowe.net>
parents: 13660
diff changeset
  2515
LDVER=`echo $LDVER | sed -e "s/.*-1\.\([0-9]*\).*/\1/"`
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2516
if [ `expr $LDVER \< 422` -eq 1 ]; then
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2517
	echo "The link-editor needs to be at version 422 or higher to build" | \
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2518
	    tee -a $build_environ_file >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2519
	echo "the latest stuff.  Hope your build works." | \
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2520
	    tee -a $build_environ_file >> $LOGFILE
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2521
fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2522
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2523
#
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2524
# Build and use the workspace's tools if requested
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2525
#
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2526
if [[ "$t_FLAG" = "y" || "$O_FLAG" = y ]]; then
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2527
	set_non_debug_build_flags
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2528
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2529
	build_tools ${TOOLS_PROTO}
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2530
	if [[ $? != 0  && "$t_FLAG" = y ]]; then
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2531
		use_tools $TOOLS_PROTO
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2532
	fi
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2533
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2534
2868
c6c11cf3e587 6460124 nightly -X doesn't properly copy the IHV proto area
dduvall
parents: 2730
diff changeset
  2535
#
c6c11cf3e587 6460124 nightly -X doesn't properly copy the IHV proto area
dduvall
parents: 2730
diff changeset
  2536
# copy ihv proto area in addition to the build itself
c6c11cf3e587 6460124 nightly -X doesn't properly copy the IHV proto area
dduvall
parents: 2730
diff changeset
  2537
#
c6c11cf3e587 6460124 nightly -X doesn't properly copy the IHV proto area
dduvall
parents: 2730
diff changeset
  2538
if [ "$X_FLAG" = "y" ]; then
c6c11cf3e587 6460124 nightly -X doesn't properly copy the IHV proto area
dduvall
parents: 2730
diff changeset
  2539
	copy_ihv_proto
c6c11cf3e587 6460124 nightly -X doesn't properly copy the IHV proto area
dduvall
parents: 2730
diff changeset
  2540
fi
c6c11cf3e587 6460124 nightly -X doesn't properly copy the IHV proto area
dduvall
parents: 2730
diff changeset
  2541
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2542
if [ "$i_FLAG" = "y" -a "$SH_FLAG" = "y" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2543
	echo "\n==== NOT Building base OS-Net source ====\n" | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2544
	    tee -a $LOGFILE >> $mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2545
else
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2546
	# timestamp the start of the normal build; the findunref tool uses it.
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2547
	touch $SRC/.build.tstamp
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2548
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2549
	normal_build
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2550
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2551
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2552
#
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
  2553
# Generate the THIRDPARTYLICENSE files if needed.  This is done after
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
  2554
# the build, so that dynamically-created license files are there.
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
  2555
# It's done before findunref to help identify license files that need
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
  2556
# to be added to tools/opensolaris/license-list.
5357
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  2557
#
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  2558
if [ "$O_FLAG" = y -a "$build_ok" = y ]; then
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
  2559
	echo "\n==== Generating THIRDPARTYLICENSE files ====\n" |
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
  2560
	    tee -a "$mail_msg_file" >> "$LOGFILE"
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
  2561
13010
c0270875939a 6929502 packages are missing some license files
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12899
diff changeset
  2562
	if [ -d $ROOT/licenses/usr ]; then
c0270875939a 6929502 packages are missing some license files
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12899
diff changeset
  2563
		( cd $ROOT/licenses ; \
c0270875939a 6929502 packages are missing some license files
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12899
diff changeset
  2564
		    mktpl $SRC/pkg/license-list ) >> "$LOGFILE" 2>&1
c0270875939a 6929502 packages are missing some license files
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12899
diff changeset
  2565
		if (( $? != 0 )) ; then
c0270875939a 6929502 packages are missing some license files
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12899
diff changeset
  2566
			echo "Couldn't create THIRDPARTYLICENSE files" |
c0270875939a 6929502 packages are missing some license files
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12899
diff changeset
  2567
			    tee -a "$mail_msg_file" >> "$LOGFILE"
c0270875939a 6929502 packages are missing some license files
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12899
diff changeset
  2568
		fi
c0270875939a 6929502 packages are missing some license files
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12899
diff changeset
  2569
	else
c0270875939a 6929502 packages are missing some license files
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12899
diff changeset
  2570
		echo "No licenses found under $ROOT/licenses" |
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
  2571
		    tee -a "$mail_msg_file" >> "$LOGFILE"
5357
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  2572
	fi
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  2573
fi
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  2574
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2575
ORIG_SRC=$SRC
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2576
BINARCHIVE=${CODEMGR_WS}/bin-${MACH}.cpio.Z
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2577
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2578
if [ "$SE_FLAG" = "y" -o "$SD_FLAG" = "y" -o "$SH_FLAG" = "y" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2579
	save_binaries
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2580
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2581
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2582
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2583
# EXPORT_SRC comes after CRYPT_SRC since a domestic build will need
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2584
# $SRC pointing to the export_source usr/src.
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2585
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2586
if [ "$SE_FLAG" = "y" -o "$SD_FLAG" = "y" -o "$SH_FLAG" = "y" ]; then
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2587
	if [ "$SD_FLAG" = "y" -a $build_ok = y ]; then
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2588
	    set_up_source_build ${CODEMGR_WS} ${CRYPT_SRC} CRYPT_SRC
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2589
	fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2590
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2591
	if [ $build_ok = y ]; then
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2592
	    set_up_source_build ${CODEMGR_WS} ${EXPORT_SRC} EXPORT_SRC
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2593
	fi
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2594
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2595
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2596
if [ "$SD_FLAG" = "y" -a $build_ok = y ]; then
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2597
	# drop the crypt files in place.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2598
	cd ${EXPORT_SRC}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2599
	echo "\nextracting crypt_files.cpio.Z onto export_source.\n" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2600
	    >> ${LOGFILE}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2601
	zcat ${CODEMGR_WS}/crypt_files.cpio.Z | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2602
	    cpio -idmucvB 2>/dev/null >> ${LOGFILE}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2603
	if [ "$?" = "0" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2604
		echo "\n==== DOMESTIC extraction succeeded ====\n" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2605
		    >> $mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2606
	else
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2607
		echo "\n==== DOMESTIC extraction failed ====\n" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2608
		    >> $mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2609
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2610
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2611
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2612
12649
87a8e25df5cf 6919429 new crypto tarball doesn't play well with ON Tonic builds
Mike Kupfer <Mike.Kupfer@Oracle.COM>
parents: 12486
diff changeset
  2613
if [ "$SO_FLAG" = "y" -a "$build_ok" = y ]; then
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  2614
	#
13325
ab46f88a2660 842 src/lib/Makefile has libc_i18n vestiges
Garrett D'Amore <garrett@nexenta.com>
parents: 13290
diff changeset
  2615
	# Copy the open sources into their own tree.
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2616
	# If copy_source fails, it will have already generated an
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2617
	# error message and set build_ok=n, so we don't need to worry
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2618
	# about that here.
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2619
	#
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  2620
	copy_source $CODEMGR_WS $OPEN_SRCDIR OPEN_SOURCE usr/src
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2621
fi
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  2622
12649
87a8e25df5cf 6919429 new crypto tarball doesn't play well with ON Tonic builds
Mike Kupfer <Mike.Kupfer@Oracle.COM>
parents: 12486
diff changeset
  2623
if [ "$SO_FLAG" = "y" -a "$build_ok" = y ]; then
12210
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
  2624
	SRC=$OPEN_SRCDIR/usr/src
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2625
	export CLOSED_IS_PRESENT=no
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  2626
fi
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  2627
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  2628
if is_source_build && [ $build_ok = y ] ; then
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2629
	# remove proto area(s) here, since we don't clobber
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2630
	rm -rf `allprotos`
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2631
	if [ "$t_FLAG" = "y" ]; then
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2632
		set_non_debug_build_flags
2230
fb155af30623 6218814 nightly builds tools/ for EXPORT/CRYPT builds in original source tree
danmcd
parents: 2118
diff changeset
  2633
		ORIG_TOOLS=$TOOLS
2947
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  2634
		#
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  2635
		# SRC was set earlier to point to the source build
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  2636
		# source tree (e.g., $EXPORT_SRC).
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  2637
		#
490e4976e8af 6374716 need way to simulate OpenSolaris build
kupfer
parents: 2908
diff changeset
  2638
		TOOLS=${SRC}/tools
12276
5faf8d02346b 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12210
diff changeset
  2639
		TOOLS_PROTO=${TOOLS}/${TOOLS_PROTO_REL}; export TOOLS_PROTO
5faf8d02346b 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12210
diff changeset
  2640
		build_tools ${TOOLS_PROTO}
5faf8d02346b 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12210
diff changeset
  2641
		if [[ $? != 0 ]]; then
5faf8d02346b 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12210
diff changeset
  2642
			use_tools ${TOOLS_PROTO}
5faf8d02346b 6936772 nightly.sh inclusion of tools proto in allprotos causes issues for source builds
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 12210
diff changeset
  2643
		fi
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2644
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2645
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2646
	normal_build
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2647
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2648
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2649
#
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2650
# There are several checks that need to look at the proto area, but
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2651
# they only need to look at one, and they don't care whether it's
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2652
# DEBUG or non-DEBUG.
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2653
#
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2654
if [[ "$MULTI_PROTO" = yes && "$D_FLAG" = n ]]; then
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2655
	checkroot=$ROOT-nd
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2656
else
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2657
	checkroot=$ROOT
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2658
fi
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2659
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2660
if [ "$build_ok" = "y" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2661
	echo "\n==== Creating protolist system file at `date` ====" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2662
		>> $LOGFILE
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2663
	protolist $checkroot > $ATLOG/proto_list_${MACH}
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2664
	echo "==== protolist system file created at `date` ====\n" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2665
		>> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2666
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2667
	if [ "$N_FLAG" != "y" ]; then
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2668
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2669
		E1=
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2670
		f1=
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2671
		if [ -d "$SRC/pkgdefs" ]; then
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2672
			f1="$SRC/pkgdefs/etc/exception_list_$MACH"
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2673
			if [ "$X_FLAG" = "y" ]; then
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2674
				f1="$f1 $IA32_IHV_WS/usr/src/pkgdefs/etc/exception_list_$MACH"
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2675
			fi
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2676
		fi
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2677
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2678
		for f in $f1; do
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2679
			if [ -f "$f" ]; then
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2680
				E1="$E1 -e $f"
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2681
			fi
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2682
		done
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2683
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2684
		E2=
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2685
		f2=
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2686
		if [ -d "$SRC/pkg" ]; then
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2687
			f2="$f2 exceptions/packaging"
2868
c6c11cf3e587 6460124 nightly -X doesn't properly copy the IHV proto area
dduvall
parents: 2730
diff changeset
  2688
		fi
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2689
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2690
		for f in $f2; do
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2691
			if [ -f "$f" ]; then
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2692
				E2="$E2 -e $f"
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2693
			fi
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2694
		done
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2695
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2696
		if [ -f "$REF_PROTO_LIST" ]; then
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2697
			#
2908
73d7b826e6ed 6479443 nightly x86 builds showing apparently newly removed files
dduvall
parents: 2868
diff changeset
  2698
			# For builds that copy the IHV proto area (-X), add the
73d7b826e6ed 6479443 nightly x86 builds showing apparently newly removed files
dduvall
parents: 2868
diff changeset
  2699
			# IHV proto list to the reference list if the reference
73d7b826e6ed 6479443 nightly x86 builds showing apparently newly removed files
dduvall
parents: 2868
diff changeset
  2700
			# was built without -X.
73d7b826e6ed 6479443 nightly x86 builds showing apparently newly removed files
dduvall
parents: 2868
diff changeset
  2701
			#
73d7b826e6ed 6479443 nightly x86 builds showing apparently newly removed files
dduvall
parents: 2868
diff changeset
  2702
			# For builds that don't copy the IHV proto area, add the
73d7b826e6ed 6479443 nightly x86 builds showing apparently newly removed files
dduvall
parents: 2868
diff changeset
  2703
			# IHV proto list to the build's proto list if the
73d7b826e6ed 6479443 nightly x86 builds showing apparently newly removed files
dduvall
parents: 2868
diff changeset
  2704
			# reference was built with -X.
73d7b826e6ed 6479443 nightly x86 builds showing apparently newly removed files
dduvall
parents: 2868
diff changeset
  2705
			#
73d7b826e6ed 6479443 nightly x86 builds showing apparently newly removed files
dduvall
parents: 2868
diff changeset
  2706
			# Use the presence of the first file entry of the cached
73d7b826e6ed 6479443 nightly x86 builds showing apparently newly removed files
dduvall
parents: 2868
diff changeset
  2707
			# IHV proto list in the reference list to determine
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2708
			# whether it was built with -X or not.
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2709
			#
11855
606f75cdda48 6932330 nightly.sh changes failed to notice that ihv proto was squirreled away in pkgdefs
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 11846
diff changeset
  2710
			IHV_REF_PROTO_LIST=$SRC/pkg/proto_list_ihv_$MACH
2908
73d7b826e6ed 6479443 nightly x86 builds showing apparently newly removed files
dduvall
parents: 2868
diff changeset
  2711
			grepfor=$(nawk '$1 == "f" { print $2; exit }' \
73d7b826e6ed 6479443 nightly x86 builds showing apparently newly removed files
dduvall
parents: 2868
diff changeset
  2712
				$IHV_REF_PROTO_LIST 2> /dev/null)
73d7b826e6ed 6479443 nightly x86 builds showing apparently newly removed files
dduvall
parents: 2868
diff changeset
  2713
			if [ $? = 0 -a -n "$grepfor" ]; then
73d7b826e6ed 6479443 nightly x86 builds showing apparently newly removed files
dduvall
parents: 2868
diff changeset
  2714
				if [ "$X_FLAG" = "y" ]; then
73d7b826e6ed 6479443 nightly x86 builds showing apparently newly removed files
dduvall
parents: 2868
diff changeset
  2715
					grep -w "$grepfor" \
73d7b826e6ed 6479443 nightly x86 builds showing apparently newly removed files
dduvall
parents: 2868
diff changeset
  2716
						$REF_PROTO_LIST > /dev/null
73d7b826e6ed 6479443 nightly x86 builds showing apparently newly removed files
dduvall
parents: 2868
diff changeset
  2717
					if [ ! "$?" = "0" ]; then
73d7b826e6ed 6479443 nightly x86 builds showing apparently newly removed files
dduvall
parents: 2868
diff changeset
  2718
						REF_IHV_PROTO="-d $IHV_REF_PROTO_LIST"
73d7b826e6ed 6479443 nightly x86 builds showing apparently newly removed files
dduvall
parents: 2868
diff changeset
  2719
					fi
73d7b826e6ed 6479443 nightly x86 builds showing apparently newly removed files
dduvall
parents: 2868
diff changeset
  2720
				else
73d7b826e6ed 6479443 nightly x86 builds showing apparently newly removed files
dduvall
parents: 2868
diff changeset
  2721
					grep -w "$grepfor" \
73d7b826e6ed 6479443 nightly x86 builds showing apparently newly removed files
dduvall
parents: 2868
diff changeset
  2722
						$REF_PROTO_LIST > /dev/null
73d7b826e6ed 6479443 nightly x86 builds showing apparently newly removed files
dduvall
parents: 2868
diff changeset
  2723
					if [ "$?" = "0" ]; then
73d7b826e6ed 6479443 nightly x86 builds showing apparently newly removed files
dduvall
parents: 2868
diff changeset
  2724
						IHV_PROTO_LIST="$IHV_REF_PROTO_LIST"
73d7b826e6ed 6479443 nightly x86 builds showing apparently newly removed files
dduvall
parents: 2868
diff changeset
  2725
					fi
73d7b826e6ed 6479443 nightly x86 builds showing apparently newly removed files
dduvall
parents: 2868
diff changeset
  2726
				fi
73d7b826e6ed 6479443 nightly x86 builds showing apparently newly removed files
dduvall
parents: 2868
diff changeset
  2727
			fi
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2728
		fi
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2729
	fi
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2730
11845
5c6cbc713b93 6931951 nightly.sh test to avoid building ON SVr4 packages in an open-only ON build is wrong
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 11838
diff changeset
  2731
	if [ "$N_FLAG" != "y" -a -f $SRC/pkgdefs/Makefile ]; then
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2732
		echo "\n==== Impact on SVr4 packages ====\n" >> $mail_msg_file
11845
5c6cbc713b93 6931951 nightly.sh test to avoid building ON SVr4 packages in an open-only ON build is wrong
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 11838
diff changeset
  2733
		#
5c6cbc713b93 6931951 nightly.sh test to avoid building ON SVr4 packages in an open-only ON build is wrong
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 11838
diff changeset
  2734
		# Compare the build's proto list with current package
5c6cbc713b93 6931951 nightly.sh test to avoid building ON SVr4 packages in an open-only ON build is wrong
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 11838
diff changeset
  2735
		# definitions to audit the quality of package
5c6cbc713b93 6931951 nightly.sh test to avoid building ON SVr4 packages in an open-only ON build is wrong
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 11838
diff changeset
  2736
		# definitions and makefile install targets. Use the
5c6cbc713b93 6931951 nightly.sh test to avoid building ON SVr4 packages in an open-only ON build is wrong
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 11838
diff changeset
  2737
		# current exception list.
5c6cbc713b93 6931951 nightly.sh test to avoid building ON SVr4 packages in an open-only ON build is wrong
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 11838
diff changeset
  2738
		#
5c6cbc713b93 6931951 nightly.sh test to avoid building ON SVr4 packages in an open-only ON build is wrong
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 11838
diff changeset
  2739
		PKGDEFS_LIST=""
5c6cbc713b93 6931951 nightly.sh test to avoid building ON SVr4 packages in an open-only ON build is wrong
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 11838
diff changeset
  2740
		for d in $abssrcdirs; do
5c6cbc713b93 6931951 nightly.sh test to avoid building ON SVr4 packages in an open-only ON build is wrong
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 11838
diff changeset
  2741
			if [ -d $d/pkgdefs ]; then
5c6cbc713b93 6931951 nightly.sh test to avoid building ON SVr4 packages in an open-only ON build is wrong
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 11838
diff changeset
  2742
				PKGDEFS_LIST="$PKGDEFS_LIST -d $d/pkgdefs"
900
7a6a7342ba44 6346595 tools changes for split tree
kupfer
parents: 851
diff changeset
  2743
			fi
11845
5c6cbc713b93 6931951 nightly.sh test to avoid building ON SVr4 packages in an open-only ON build is wrong
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 11838
diff changeset
  2744
		done
5c6cbc713b93 6931951 nightly.sh test to avoid building ON SVr4 packages in an open-only ON build is wrong
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 11838
diff changeset
  2745
		if [ "$X_FLAG" = "y" -a \
5c6cbc713b93 6931951 nightly.sh test to avoid building ON SVr4 packages in an open-only ON build is wrong
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 11838
diff changeset
  2746
		    -d $IA32_IHV_WS/usr/src/pkgdefs ]; then
5c6cbc713b93 6931951 nightly.sh test to avoid building ON SVr4 packages in an open-only ON build is wrong
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 11838
diff changeset
  2747
			PKGDEFS_LIST="$PKGDEFS_LIST -d $IA32_IHV_WS/usr/src/pkgdefs"
2868
c6c11cf3e587 6460124 nightly -X doesn't properly copy the IHV proto area
dduvall
parents: 2730
diff changeset
  2748
		fi
11845
5c6cbc713b93 6931951 nightly.sh test to avoid building ON SVr4 packages in an open-only ON build is wrong
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 11838
diff changeset
  2749
		$PROTOCMPTERSE \
5c6cbc713b93 6931951 nightly.sh test to avoid building ON SVr4 packages in an open-only ON build is wrong
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 11838
diff changeset
  2750
		    "Files missing from the proto area:" \
5c6cbc713b93 6931951 nightly.sh test to avoid building ON SVr4 packages in an open-only ON build is wrong
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 11838
diff changeset
  2751
		    "Files missing from packages:" \
5c6cbc713b93 6931951 nightly.sh test to avoid building ON SVr4 packages in an open-only ON build is wrong
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 11838
diff changeset
  2752
		    "Inconsistencies between pkgdefs and proto area:" \
5c6cbc713b93 6931951 nightly.sh test to avoid building ON SVr4 packages in an open-only ON build is wrong
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 11838
diff changeset
  2753
		    ${E1} \
5c6cbc713b93 6931951 nightly.sh test to avoid building ON SVr4 packages in an open-only ON build is wrong
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 11838
diff changeset
  2754
		    ${PKGDEFS_LIST} \
5c6cbc713b93 6931951 nightly.sh test to avoid building ON SVr4 packages in an open-only ON build is wrong
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 11838
diff changeset
  2755
		    $ATLOG/proto_list_${MACH} \
5c6cbc713b93 6931951 nightly.sh test to avoid building ON SVr4 packages in an open-only ON build is wrong
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 11838
diff changeset
  2756
		    >> $mail_msg_file
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2757
	fi
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2758
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2759
	if [ "$N_FLAG" != "y" -a -d $SRC/pkg ]; then
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2760
		echo "\n==== Validating manifests against proto area ====\n" \
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2761
		    >> $mail_msg_file
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2762
		( cd $SRC/pkg ; $MAKE -e protocmp ROOT="$checkroot" ) \
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2763
		    >> $mail_msg_file
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2764
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2765
	fi
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2766
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2767
	if [ "$N_FLAG" != "y" -a -f "$REF_PROTO_LIST" ]; then
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2768
		echo "\n==== Impact on proto area ====\n" >> $mail_msg_file
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2769
		if [ -n "$E2" ]; then
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2770
			ELIST=$E2
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2771
		else
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2772
			ELIST=$E1
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2773
		fi
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2774
		$PROTOCMPTERSE \
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2775
			"Files in yesterday's proto area, but not today's:" \
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2776
			"Files in today's proto area, but not yesterday's:" \
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2777
			"Files that changed between yesterday and today:" \
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2778
			${ELIST} \
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2779
			-d $REF_PROTO_LIST \
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2780
			$REF_IHV_PROTO \
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2781
			$ATLOG/proto_list_${MACH} \
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2782
			$IHV_PROTO_LIST \
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2783
			>> $mail_msg_file
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2784
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2785
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2786
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2787
if [ "$u_FLAG" = "y"  -a "$build_ok" = "y" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2788
	staffer cp $ATLOG/proto_list_${MACH} \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2789
		$PARENT_WS/usr/src/proto_list_${MACH}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2790
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2791
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2792
# Update parent proto area if necessary. This is done now
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2793
# so that the proto area has either DEBUG or non-DEBUG kernels.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2794
# Note that this clears out the lock file, so we can dispense with
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2795
# the variable now.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2796
if [ "$U_FLAG" = "y" -a "$build_ok" = "y" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2797
	echo "\n==== Copying proto area to $NIGHTLY_PARENT_ROOT ====\n" | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2798
	    tee -a $LOGFILE >> $mail_msg_file
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2799
	rm -rf $NIGHTLY_PARENT_ROOT/*
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2800
	unset Ulockfile
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2801
	mkdir -p $NIGHTLY_PARENT_ROOT
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2802
	if [[ "$MULTI_PROTO" = no || "$D_FLAG" = y ]]; then
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2803
		( cd $ROOT; tar cf - . |
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2804
		    ( cd $NIGHTLY_PARENT_ROOT;  umask 0; tar xpf - ) ) 2>&1 |
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2805
		    tee -a $mail_msg_file >> $LOGFILE
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2806
	fi
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2807
	if [[ "$MULTI_PROTO" = yes && "$F_FLAG" = n ]]; then
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2808
		rm -rf $NIGHTLY_PARENT_ROOT-nd/*
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2809
		mkdir -p $NIGHTLY_PARENT_ROOT-nd
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2810
		cd $ROOT-nd
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2811
		( tar cf - . |
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2812
		    ( cd $NIGHTLY_PARENT_ROOT-nd; umask 0; tar xpf - ) ) 2>&1 |
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2813
		    tee -a $mail_msg_file >> $LOGFILE
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  2814
	fi
11961
cf8b29303819 6935095 nightly.sh is once again borked for SFW
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 11855
diff changeset
  2815
	if [ -n "${NIGHTLY_PARENT_TOOLS_ROOT}" ]; then
cf8b29303819 6935095 nightly.sh is once again borked for SFW
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 11855
diff changeset
  2816
		echo "\n==== Copying tools proto area to $NIGHTLY_PARENT_TOOLS_ROOT ====\n" | \
cf8b29303819 6935095 nightly.sh is once again borked for SFW
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 11855
diff changeset
  2817
		    tee -a $LOGFILE >> $mail_msg_file
cf8b29303819 6935095 nightly.sh is once again borked for SFW
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 11855
diff changeset
  2818
		rm -rf $NIGHTLY_PARENT_TOOLS_ROOT/*
cf8b29303819 6935095 nightly.sh is once again borked for SFW
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 11855
diff changeset
  2819
		mkdir -p $NIGHTLY_PARENT_TOOLS_ROOT
cf8b29303819 6935095 nightly.sh is once again borked for SFW
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 11855
diff changeset
  2820
		if [[ "$MULTI_PROTO" = no || "$D_FLAG" = y ]]; then
cf8b29303819 6935095 nightly.sh is once again borked for SFW
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 11855
diff changeset
  2821
			( cd $TOOLS_PROTO; tar cf - . |
cf8b29303819 6935095 nightly.sh is once again borked for SFW
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 11855
diff changeset
  2822
			    ( cd $NIGHTLY_PARENT_TOOLS_ROOT; 
cf8b29303819 6935095 nightly.sh is once again borked for SFW
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 11855
diff changeset
  2823
			    umask 0; tar xpf - ) ) 2>&1 |
cf8b29303819 6935095 nightly.sh is once again borked for SFW
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 11855
diff changeset
  2824
			    tee -a $mail_msg_file >> $LOGFILE
cf8b29303819 6935095 nightly.sh is once again borked for SFW
Mark J. Nelson <Mark.J.Nelson@Oracle.COM>
parents: 11855
diff changeset
  2825
		fi
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2826
	fi
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2827
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2828
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2829
#
10355
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2830
# ELF verification: ABI (-A) and runtime (-r) checks
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2831
#
10355
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2832
if [[ ($build_ok = y) && ( ($A_FLAG = y) || ($r_FLAG = y) ) ]]; then
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2833
	# Directory ELF-data.$MACH holds the files produced by these tests.
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2834
	elf_ddir=$SRC/ELF-data.$MACH
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2835
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2836
	# If there is a previous ELF-data backup directory, remove it. Then,
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2837
	# rotate current ELF-data directory into its place and create a new
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2838
	# empty directory
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2839
	rm -rf $elf_ddir.ref
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2840
	if [[ -d $elf_ddir ]]; then
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2841
		mv $elf_ddir $elf_ddir.ref
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2842
	fi
10355
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2843
	mkdir -p $elf_ddir
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2844
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2845
	# Call find_elf to produce a list of the ELF objects in the proto area.
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2846
	# This list is passed to check_rtime and interface_check, preventing
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2847
	# them from separately calling find_elf to do the same work twice.
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2848
	find_elf -fr $checkroot > $elf_ddir/object_list
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2849
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2850
	if [[ $A_FLAG = y ]]; then
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2851
	       	echo "\n==== Check versioning and ABI information ====\n"  | \
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2852
		    tee -a $LOGFILE >> $mail_msg_file
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2853
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2854
		# Produce interface description for the proto. Report errors.
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2855
		interface_check -o -w $elf_ddir -f object_list \
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2856
			-i interface -E interface.err
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2857
		if [[ -s $elf_ddir/interface.err ]]; then
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2858
			tee -a $LOGFILE < $elf_ddir/interface.err \
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2859
				>> $mail_msg_file
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2860
		fi
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2861
12478
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2862
		# If ELF_DATA_BASELINE_DIR is defined, compare the new interface
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2863
		# description file to that from the baseline gate. Issue a
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2864
		# warning if the baseline is not present, and keep going.
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2865
		if [[ "$ELF_DATA_BASELINE_DIR" != '' ]]; then
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2866
			base_ifile="$ELF_DATA_BASELINE_DIR/interface"
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2867
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2868
		       	echo "\n==== Compare versioning and ABI information" \
12486
adfcb325b195 6952650 nightly builds should use daily S10 interface description files (fix nightly nit)
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12478
diff changeset
  2869
			    "to baseline ====\n"  | \
12478
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2870
			    tee -a $LOGFILE >> $mail_msg_file
12486
adfcb325b195 6952650 nightly builds should use daily S10 interface description files (fix nightly nit)
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12478
diff changeset
  2871
		       	echo "Baseline:  $base_ifile\n" >> $LOGFILE
12478
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2872
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2873
			if [[ -f $base_ifile ]]; then
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2874
				interface_cmp -d -o $base_ifile \
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2875
				    $elf_ddir/interface > $elf_ddir/interface.cmp
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2876
				if [[ -s $elf_ddir/interface.cmp ]]; then
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2877
					echo | tee -a $LOGFILE >> $mail_msg_file
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2878
					tee -a $LOGFILE < \
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2879
					    $elf_ddir/interface.cmp \
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2880
					    >> $mail_msg_file
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2881
				fi
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2882
			else
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2883
			       	echo "baseline not available. comparison" \
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2884
                                    "skipped" | \
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2885
				    tee -a $LOGFILE >> $mail_msg_file
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2886
			fi
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2887
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2888
		fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2889
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2890
10355
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2891
	if [[ $r_FLAG = y ]]; then
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2892
		echo "\n==== Check ELF runtime attributes ====\n" | \
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2893
		    tee -a $LOGFILE >> $mail_msg_file
10355
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2894
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  2895
		# If we're doing a DEBUG build the proto area will be left
10355
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2896
		# with debuggable objects, thus don't assert -s.
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2897
		if [[ $D_FLAG = y ]]; then
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2898
			rtime_sflag=""
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2899
		else
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2900
			rtime_sflag="-s"
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2901
		fi
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2902
		check_rtime -i -m -v $rtime_sflag -o -w $elf_ddir \
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2903
			-D object_list  -f object_list -E runtime.err \
10445
c04fc41621a9 6878175 Fix for 6866605 can produce large noisy nightly -r output
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10355
diff changeset
  2904
			-I runtime.attr.raw
c04fc41621a9 6878175 Fix for 6866605 can produce large noisy nightly -r output
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10355
diff changeset
  2905
c04fc41621a9 6878175 Fix for 6866605 can produce large noisy nightly -r output
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10355
diff changeset
  2906
		# check_rtime -I output needs to be sorted in order to 
c04fc41621a9 6878175 Fix for 6866605 can produce large noisy nightly -r output
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10355
diff changeset
  2907
		# compare it to that from previous builds.
c04fc41621a9 6878175 Fix for 6866605 can produce large noisy nightly -r output
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10355
diff changeset
  2908
		sort $elf_ddir/runtime.attr.raw > $elf_ddir/runtime.attr
c04fc41621a9 6878175 Fix for 6866605 can produce large noisy nightly -r output
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10355
diff changeset
  2909
		rm $elf_ddir/runtime.attr.raw
10355
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2910
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2911
		# Report errors
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2912
		if [[ -s $elf_ddir/runtime.err ]]; then
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2913
			tee -a $LOGFILE < $elf_ddir/runtime.err \
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2914
				>> $mail_msg_file
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2915
		fi
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2916
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2917
		# If there is an ELF-data directory from a previous build,
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2918
		# then diff the attr files. These files contain information
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2919
		# about dependencies, versioning, and runpaths. There is some
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2920
		# overlap with the ABI checking done above, but this also
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2921
		# flushes out non-ABI interface differences along with the
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2922
		# other information.
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2923
		echo "\n==== Diff ELF runtime attributes" \
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2924
		    "(since last build) ====\n" | \
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2925
		    tee -a $LOGFILE >> $mail_msg_file >> $mail_msg_file
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2926
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2927
		if [[ -f $elf_ddir.ref/runtime.attr ]]; then
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2928
			diff $elf_ddir.ref/runtime.attr \
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2929
				$elf_ddir/runtime.attr \
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2930
				>> $mail_msg_file
26c444652867 6866605 SUNWonbld ELF analysis tools need overhaul
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10313
diff changeset
  2931
		fi
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2932
	fi
12478
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2933
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2934
	# If -u set, copy contents of ELF-data.$MACH to the parent workspace.
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2935
	if [[ "$u_FLAG" = "y" ]]; then
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2936
		p_elf_ddir=$PARENT_WS/usr/src/ELF-data.$MACH
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2937
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2938
		# If parent lacks the ELF-data.$MACH directory, create it
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2939
		if [[ ! -d $p_elf_ddir ]]; then
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2940
			staffer mkdir -p $p_elf_ddir
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2941
		fi
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2942
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2943
		# These files are used asynchronously by other builds for ABI
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2944
		# verification, as above for the -A option. As such, we require
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2945
		# the file replacement to be atomic. Copy the data to a temp
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2946
		# file in the same filesystem and then rename into place. 
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2947
		(
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2948
			cd $elf_ddir
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2949
			for elf_dfile in *; do
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2950
				staffer cp $elf_dfile \
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2951
				    ${p_elf_ddir}/${elf_dfile}.new
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2952
				staffer mv -f ${p_elf_ddir}/${elf_dfile}.new \
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2953
				    ${p_elf_ddir}/${elf_dfile}
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2954
			done
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2955
		)
a267bf553e0e 6952658 onbld ELF tools could be more flexible for non-OSnet objects
Ali Bahrami <Ali.Bahrami@Oracle.COM>
parents: 12374
diff changeset
  2956
	fi
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2957
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2958
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2959
# DEBUG lint of kernel begins
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2960
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2961
if [ "$i_CMD_LINE_FLAG" = "n" -a "$l_FLAG" = "y" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2962
	if [ "$LINTDIRS" = "" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2963
		# LINTDIRS="$SRC/uts y $SRC/stand y $SRC/psm y"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2964
		LINTDIRS="$SRC y"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2965
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2966
	set $LINTDIRS
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2967
	while [ $# -gt 0 ]; do
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2968
		dolint $1 $2; shift; shift
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2969
	done
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2970
else
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2971
	echo "\n==== No '$MAKE lint' ====\n" >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2972
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2973
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2974
# "make check" begins
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2975
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2976
if [ "$i_CMD_LINE_FLAG" = "n" -a "$C_FLAG" = "y" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2977
	# remove old check.out
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2978
	rm -f $SRC/check.out
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2979
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2980
	rm -f $SRC/check-${MACH}.out
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2981
	cd $SRC
13215
25c1876a8d9c 334 "make check" fails if MULTI_PROTO is yes and only building non-debug
Albert Lee <trisk@opensolaris.org>
parents: 13193
diff changeset
  2982
	$MAKE -ek check ROOT="$checkroot" 2>&1 | tee -a $SRC/check-${MACH}.out \
25c1876a8d9c 334 "make check" fails if MULTI_PROTO is yes and only building non-debug
Albert Lee <trisk@opensolaris.org>
parents: 13193
diff changeset
  2983
	    >> $LOGFILE
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2984
	echo "\n==== cstyle/hdrchk errors ====\n" >> $mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2985
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2986
	grep ":" $SRC/check-${MACH}.out |
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2987
		egrep -v "Ignoring unknown host" | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2988
		sort | uniq >> $mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2989
else
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2990
	echo "\n==== No '$MAKE check' ====\n" >> $LOGFILE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2991
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2992
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2993
echo "\n==== Find core files ====\n" | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2994
    tee -a $LOGFILE >> $mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2995
900
7a6a7342ba44 6346595 tools changes for split tree
kupfer
parents: 851
diff changeset
  2996
find $abssrcdirs -name core -a -type f -exec file {} \; | \
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2997
	tee -a $LOGFILE >> $mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2998
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  2999
if [ "$f_FLAG" = "y" -a "$build_ok" = "y" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3000
	echo "\n==== Diff unreferenced files (since last build) ====\n" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3001
	    | tee -a $LOGFILE >>$mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3002
	rm -f $SRC/unref-${MACH}.ref
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3003
	if [ -f $SRC/unref-${MACH}.out ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3004
		mv $SRC/unref-${MACH}.out $SRC/unref-${MACH}.ref
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3005
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3006
10313
ca42e2f0424a 6869889 findunref needs to grok mercurial
meem <Peter.Memishian@Sun.COM>
parents: 10222
diff changeset
  3007
	findunref -S $SCM_TYPE -t $SRC/.build.tstamp -s usr $CODEMGR_WS \
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  3008
	    ${TOOLS}/findunref/exception_list 2>> $mail_msg_file | \
10313
ca42e2f0424a 6869889 findunref needs to grok mercurial
meem <Peter.Memishian@Sun.COM>
parents: 10222
diff changeset
  3009
	    sort > $SRC/unref-${MACH}.out
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3010
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3011
	if [ ! -f $SRC/unref-${MACH}.ref ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3012
		cp $SRC/unref-${MACH}.out $SRC/unref-${MACH}.ref
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3013
	fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3014
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3015
	diff $SRC/unref-${MACH}.ref $SRC/unref-${MACH}.out >>$mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3016
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3017
5357
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3018
#
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3019
# Generate the OpenSolaris deliverables if requested.  Some of these
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3020
# steps need to come after findunref and are commented below.
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3021
#
11562
1ce42c60d482 6855998 put signed crypto in its own tarball, not with the closed bins
Mike Kupfer <Mike.Kupfer@Sun.COM>
parents: 10934
diff changeset
  3022
12210
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
  3023
# If we are doing an OpenSolaris _source_ build (-S O) then we do
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
  3024
# not have usr/closed available to us to generate closedbins from,
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
  3025
# so skip this part.
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
  3026
if [ "$SO_FLAG" = n -a "$O_FLAG" = y -a "$build_ok" = y ]; then
5357
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3027
	echo "\n==== Generating OpenSolaris tarballs ====\n" | \
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3028
	    tee -a $mail_msg_file >> $LOGFILE
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3029
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3030
	cd $CODEMGR_WS
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3031
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3032
	#
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3033
	# This step grovels through the package manifests, so it
5357
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3034
	# must come after findunref.
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3035
	#
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3036
	# We assume no DEBUG vs non-DEBUG package content variation
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3037
	# here; if that changes, then the "make all" in $SRC/pkg will
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3038
	# need to be moved into the conditionals and repeated for each
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3039
	# different build.
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3040
	#
5357
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3041
	echo "Generating closed binaries tarball(s)..." >> $LOGFILE
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3042
	closed_basename=on-closed-bins
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3043
	if [ "$D_FLAG" = y ]; then
12210
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
  3044
		bindrop "$closed_basename" >>"$LOGFILE" 2>&1
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  3045
		if (( $? != 0 )) ; then
5357
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3046
			echo "Couldn't create DEBUG closed binaries." |
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3047
			    tee -a $mail_msg_file >> $LOGFILE
12649
87a8e25df5cf 6919429 new crypto tarball doesn't play well with ON Tonic builds
Mike Kupfer <Mike.Kupfer@Oracle.COM>
parents: 12486
diff changeset
  3048
			build_ok=n
5357
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3049
		fi
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3050
	fi
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3051
	if [ "$F_FLAG" = n ]; then
12210
436b06ce515d 6593513 make nightly -O cheaper
jmcp <James.McPherson@Sun.COM>
parents: 11961
diff changeset
  3052
		bindrop -n "$closed_basename-nd" >>"$LOGFILE" 2>&1
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  3053
		if (( $? != 0 )) ; then
5357
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3054
			echo "Couldn't create non-DEBUG closed binaries." |
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3055
			    tee -a $mail_msg_file >> $LOGFILE
12649
87a8e25df5cf 6919429 new crypto tarball doesn't play well with ON Tonic builds
Mike Kupfer <Mike.Kupfer@Oracle.COM>
parents: 12486
diff changeset
  3056
			build_ok=n
5357
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3057
		fi
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3058
	fi
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3059
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3060
	echo "Generating README.opensolaris..." >> $LOGFILE
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3061
	cat $SRC/tools/opensolaris/README.opensolaris.tmpl | \
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3062
	    mkreadme_osol $CODEMGR_WS/README.opensolaris >> $LOGFILE 2>&1
7078
935563142864 6538468 add Mercurial support to ON developer tools
mjnelson
parents: 6972
diff changeset
  3063
	if (( $? != 0 )) ; then
5357
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3064
		echo "Couldn't create README.opensolaris." |
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3065
		    tee -a $mail_msg_file >> $LOGFILE
12649
87a8e25df5cf 6919429 new crypto tarball doesn't play well with ON Tonic builds
Mike Kupfer <Mike.Kupfer@Oracle.COM>
parents: 12486
diff changeset
  3066
		build_ok=n
5357
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3067
	fi
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3068
fi
7069aecc6a82 6609947 nightly: findunref, then sdrop
kupfer
parents: 4973
diff changeset
  3069
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3070
# Verify that the usual lists of files, such as exception lists,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3071
# contain only valid references to files.  If the build has failed,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3072
# then don't check the proto area.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3073
CHECK_PATHS=${CHECK_PATHS:-y}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3074
if [ "$CHECK_PATHS" = y -a "$N_FLAG" != y ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3075
	echo "\n==== Check lists of files ====\n" | tee -a $LOGFILE \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3076
		>>$mail_msg_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3077
	arg=-b
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3078
	[ "$build_ok" = y ] && arg=
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  3079
	checkpaths $arg $checkroot 2>&1 | tee -a $LOGFILE >>$mail_msg_file
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3080
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3081
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3082
if [ "$M_FLAG" != "y" -a "$build_ok" = y ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3083
	echo "\n==== Impact on file permissions ====\n" \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3084
		>> $mail_msg_file
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3085
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3086
	abspkgdefs=
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3087
	abspkg=
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3088
	for d in $abssrcdirs; do
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3089
		if [ -d "$d/pkgdefs" ]; then
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3090
			abspkgdefs="$abspkgdefs $d"
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3091
		fi
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3092
		if [ -d "$d/pkg" ]; then
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3093
			abspkg="$abspkg $d"
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3094
		fi
11838
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3095
	done
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3096
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3097
	if [ -n "$abspkgdefs" ]; then
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3098
		pmodes -qvdP \
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3099
		    `find $abspkgdefs -name pkginfo.tmpl -print -o \
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3100
		    -name .del\* -prune | sed -e 's:/pkginfo.tmpl$::' | \
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3101
		    sort -u` >> $mail_msg_file
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3102
	fi
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3103
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3104
	if [ -n "$abspkg" ]; then
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3105
		for d in "$abspkg"; do
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3106
			( cd $d/pkg ; $MAKE -e pmodes ) >> $mail_msg_file
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3107
		done
32bb5d254240 PSARC 2010/067 Interim modernization updates
Liane Praza <Liane.Praza@Sun.COM>
parents: 11763
diff changeset
  3108
	fi
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3109
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3110
2538
b5894d78c55a 5016095 nightly should help determine what really changes from build to build
esaxe
parents: 2456
diff changeset
  3111
if [ "$w_FLAG" = "y" -a "$build_ok" = "y" ]; then
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  3112
	if [[ "$MULTI_PROTO" = no || "$D_FLAG" = y ]]; then
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  3113
		do_wsdiff DEBUG $ROOT.prev $ROOT
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  3114
	fi
2538
b5894d78c55a 5016095 nightly should help determine what really changes from build to build
esaxe
parents: 2456
diff changeset
  3115
4162
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  3116
	if [[ "$MULTI_PROTO" = yes && "$F_FLAG" = n ]]; then
4bfd590bb99a 6455242 nightly should be able to preserve all proto areas from a single build.
kupfer
parents: 3827
diff changeset
  3117
		do_wsdiff non-DEBUG $ROOT-nd.prev $ROOT-nd
2538
b5894d78c55a 5016095 nightly should help determine what really changes from build to build
esaxe
parents: 2456
diff changeset
  3118
	fi
b5894d78c55a 5016095 nightly should help determine what really changes from build to build
esaxe
parents: 2456
diff changeset
  3119
fi
b5894d78c55a 5016095 nightly should help determine what really changes from build to build
esaxe
parents: 2456
diff changeset
  3120
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3121
END_DATE=`date`
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3122
echo "==== Nightly $maketype build completed: $END_DATE ====" | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3123
    tee -a $LOGFILE >> $build_time_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3124
10194
1f03122e3c81 6675948 when ksh is ksh93, nightly prints decimal number of hours
Darren Moffat <Darren.Moffat@Sun.COM>
parents: 8794
diff changeset
  3125
typeset -i10 hours
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3126
typeset -Z2 minutes
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3127
typeset -Z2 seconds
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3128
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3129
elapsed_time=$SECONDS
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3130
((hours = elapsed_time / 3600 ))
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3131
((minutes = elapsed_time / 60  % 60))
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3132
((seconds = elapsed_time % 60))
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3133
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3134
echo "\n==== Total build time ====" | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3135
    tee -a $LOGFILE >> $build_time_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3136
echo "\nreal    ${hours}:${minutes}:${seconds}" | \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3137
    tee -a $LOGFILE >> $build_time_file
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3138
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3139
if [ "$u_FLAG" = "y" -a "$f_FLAG" = "y" -a "$build_ok" = "y" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3140
	staffer cp ${SRC}/unref-${MACH}.out $PARENT_WS/usr/src/
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3141
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3142
	#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3143
	# Produce a master list of unreferenced files -- ideally, we'd
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3144
	# generate the master just once after all of the nightlies
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3145
	# have finished, but there's no simple way to know when that
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3146
	# will be.  Instead, we assume that we're the last nightly to
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3147
	# finish and merge all of the unref-${MACH}.out files in
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3148
	# $PARENT_WS/usr/src/.  If we are in fact the final ${MACH} to
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3149
	# finish, then this file will be the authoritative master
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3150
	# list.  Otherwise, another ${MACH}'s nightly will eventually
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3151
	# overwrite ours with its own master, but in the meantime our
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3152
	# temporary "master" will be no worse than any older master
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3153
	# which was already on the parent.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3154
	#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3155
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3156
	set -- $PARENT_WS/usr/src/unref-*.out
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3157
	cp "$1" ${TMPDIR}/unref.merge
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3158
	shift
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3159
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3160
	for unreffile; do
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3161
		comm -12 ${TMPDIR}/unref.merge "$unreffile" > ${TMPDIR}/unref.$$
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3162
		mv ${TMPDIR}/unref.$$ ${TMPDIR}/unref.merge
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3163
	done
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3164
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3165
	staffer cp ${TMPDIR}/unref.merge $PARENT_WS/usr/src/unrefmaster.out
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3166
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3167
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3168
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3169
# All done save for the sweeping up.
2371
fece52ab5cdc 6417866 The TRACE and GPROF builds must die
sommerfe
parents: 2298
diff changeset
  3170
# (whichever exit we hit here will trigger the "cleanup" trap which
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3171
# optionally sends mail on completion).
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3172
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3173
if [ "$build_ok" = "y" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3174
	exit 0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3175
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
  3176
exit 1