nightly.sh revision 40bc9153236fa42f7cbe2c25c5476e8703eb7894
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#!/bin/ksh -p
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# CDDL HEADER START
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# The contents of this file are subject to the terms of the
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Common Development and Distribution License (the "License").
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# You may not use this file except in compliance with the License.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# or http://www.opensolaris.org/os/licensing.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# See the License for the specific language governing permissions
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# and limitations under the License.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# When distributing Covered Code, include this CDDL HEADER in each
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# If applicable, add the following below this CDDL HEADER, with the
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# fields enclosed by brackets "[]" replaced with your own identifying
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# information: Portions Copyright [yyyy] [name of copyright owner]
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# CDDL HEADER END
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Use is subject to license terms.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# ident "%Z%%M% %I% %E% SMI"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Based on the nightly script from the integration folks,
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Mostly modified and owned by mike_s.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Changes also by kjc, dmk.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# BRINGOVER_WS may be specified in the env file.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# The default is the old behavior of CLONE_WS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# -i on the command line, means fast options, so when it's on the
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# command line (only), lint and check builds are skipped no matter what
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# the setting of their individual flags are in NIGHTLY_OPTIONS.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# LINTDIRS can be set in the env file, format is a list of:
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# /dirname-to-run-lint-on flag
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer# Where flag is: y - enable lint noise diff output
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff# n - disable lint noise diff output
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# For example: LINTDIRS="$SRC/uts n $SRC/stand y $SRC/psm y"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# -A flag in NIGHTLY_OPTIONS checks ABI diffs in .so files
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# This option requires a couple of scripts.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# OPTHOME and TEAMWARE may be set in the environment to override /opt
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# and /opt/teamware defaults.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# The CDPATH variable causes ksh's `cd' builtin to emit messages to stdout
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# under certain circumstances, which can really screw things up; unset it.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset CDPATH
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# function to do a DEBUG and non-DEBUG build. Needed because we might
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# need to do another for the source build, and since we only deliver DEBUG or
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# non-DEBUG packages.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkinormal_build() {
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # timestamp the start of a nightly build; the findunref tool uses it.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki touch $SRC/.build.tstamp
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # non-DEBUG build begins
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$F_FLAG" = "n" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export INTERNAL_RELEASE_BUILD ; INTERNAL_RELEASE_BUILD=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export RELEASE_BUILD ; RELEASE_BUILD=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki unset EXTRA_OPTIONS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki unset EXTRA_CFLAGS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki build non-DEBUG -nd
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$build_ok" = "y" -a "$X_FLAG" = "y" -a "$p_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki copy_ihv_pkgs non-DEBUG -nd
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== No non-DEBUG build ====\n" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # non-DEBUG build ends
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # DEBUG build begins
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$D_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export INTERNAL_RELEASE_BUILD ; INTERNAL_RELEASE_BUILD=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki unset RELEASE_BUILD
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki unset EXTRA_OPTIONS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki unset EXTRA_CFLAGS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki build DEBUG ""
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw if [ "$build_ok" = "y" -a "$X_FLAG" = "y" -a "$p_FLAG" = "y" ]; then
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw copy_ihv_pkgs DEBUG ""
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer else
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer echo "\n==== No DEBUG build ====\n" >> $LOGFILE
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer fi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # DEBUG build ends
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer}
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyerfilelist() {
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer if [ $# -ne 2 ]; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer echo "usage: filelist DESTDIR PATTERN"
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer exit 1;
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer fi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer DEST=$1
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer PATTERN=$2
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer cd ${DEST}
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer OBJFILES=${ORIG_SRC}/xmod/obj_files
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer if [ ! -f ${OBJFILES} ]; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer return;
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer fi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer for i in `grep -v '^#' ${ORIG_SRC}/xmod/obj_files | \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer grep ${PATTERN} | cut -d: -f2 | tr -d ' \t'`
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer do
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # wildcard expansion
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki for j in $i
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki do
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -f "$j" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo $j
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -d "$j" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo $j
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki done
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki done | sort | uniq
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# function to save off binaries after a full build for later
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# restoration
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkisave_binaries() {
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # save off list of binaries
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Saving binaries from build at `date` ====\n" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f ${BINARCHIVE}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd ${CODEMGR_WS}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki filelist ${CODEMGR_WS} '^preserve:' >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki filelist ${CODEMGR_WS} '^preserve:' | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cpio -ocB 2>/dev/null | compress \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki > ${BINARCHIVE}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# delete files
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkihybridize_files() {
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ $# -ne 2 ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "usage: hybridize_files DESTDIR MAKE_TARGET"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1;
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw fi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw DEST=$1
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw MAKETARG=$2
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "\n==== Hybridizing files at `date` ====\n" | \
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw tee -a $mail_msg_file >> $LOGFILE
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw for i in `filelist ${DEST} '^delete:'`
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw do
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "removing ${i}." | tee -a $mail_msg_file >> $LOGFILE
c8268b2c32246a4fd927df00921c772baab114e0Kelly Moyer rm -rf "${i}"
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw done
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw for i in `filelist ${DEST} '^hybridize:' `
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki do
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "hybridizing ${i}." | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f ${i}+
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki sed -e "/^# HYBRID DELETE START/,/^# HYBRID DELETE END/d" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki < ${i} > ${i}+
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mv ${i}+ ${i}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki done
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# restore binaries into the proper source tree.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkirestore_binaries() {
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ $# -ne 2 ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "usage: restore_binaries DESTDIR MAKE_TARGET"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki DEST=$1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki MAKETARG=$2
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "\n==== Restoring binaries to ${MAKETARG} at `date` ====\n" | \
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw tee -a $mail_msg_file >> $LOGFILE
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw cd ${DEST}
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw zcat ${BINARCHIVE} | \
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw cpio -idmucvB 2>/dev/null | tee -a $mail_msg_file >> ${LOGFILE}
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw}
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw# rename files we save binaries of
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwrename_files() {
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw if [ $# -ne 2 ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "usage: rename_files DESTDIR MAKE_TARGET"
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw exit 1;
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw fi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki DEST=$1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki MAKETARG=$2
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Renaming source files in ${MAKETARG} at `date` ====\n" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki for i in `filelist ${DEST} '^rename:'`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki do
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo ${i} | tee -a $mail_msg_file >> ${LOGFILE}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f ${i}.export
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mv ${i} ${i}.export
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki done
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# function to create the export/crypt source tree
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# usage: clone_source CODEMGR_WS DESTDIR MAKE_TARGET
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiclone_source() {
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ $# -ne 3 ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "usage: clone_source CODEMGR_WS DESTDIR MAKE_TARGET"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki WS=$1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki DEST=$2
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki MAKETARG=$3
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Creating ${DEST} source from ${WS} (${MAKETARG}) ====\n" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "cleaning out ${DEST}." >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -rf "${DEST}" >> $LOGFILE 2>&1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mkdir -p ${DEST}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd ${WS}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "creating ${DEST}." >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki find usr -name 's\.*' -a -type f -print | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki sed -e 's,SCCS\/s.,,' | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki grep -v '/\.del-*' | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cpio -pd ${DEST} >>$LOGFILE 2>&1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki SRC=${DEST}/usr/src
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd $SRC
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f ${MAKETARG}.out
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "making ${MAKETARG} in ${SRC}." >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki /bin/time $MAKE -e ${MAKETARG} 2>&1 | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $SRC/${MAKETARG}.out >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== ${MAKETARG} build errors ====\n" >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep ":" $SRC/${MAKETARG}.out | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep -e "(^${MAKE}:|[ ]error[: \n])" | \
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw egrep -v "Ignoring unknown host" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep -v "warning" >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "clearing state files." >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki find . -name '.make*' -exec rm -f {} \;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd ${DEST}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "${MAKETARG}" = "CRYPT_SRC" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f ${CODEMGR_WS}/crypt_files.cpio.Z
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== xmod/cry_files that don't exist ====\n" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki CRYPT_FILES=${WS}/usr/src/xmod/cry_files
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki for i in `cat ${CRYPT_FILES}`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki do
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # make sure the files exist
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -f "$i" ]; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer continue
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer fi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer if [ -d "$i" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki continue
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "$i" | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki done
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki find `cat ${CRYPT_FILES}` -print 2>/dev/null | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cpio -ocB 2>/dev/null | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki compress > ${CODEMGR_WS}/crypt_files.cpio.Z
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "${MAKETARG}" = "EXPORT_SRC" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # rename first, since we might restore a file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # of the same name (mapfiles)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rename_files ${EXPORT_SRC} EXPORT_SRC
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$SH_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki hybridize_files ${EXPORT_SRC} EXPORT_SRC
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # save the cleartext
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Creating ${MAKETARG}.cpio.Z ====\n" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd ${DEST}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f ${MAKETARG}.cpio.Z
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki find usr -depth -print | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki grep -v usr/src/${MAKETARG}.out | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cpio -ocB 2>/dev/null | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki compress > ${CODEMGR_WS}/${MAKETARG}.cpio.Z
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "${MAKETARG}" = "EXPORT_SRC" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki restore_binaries ${EXPORT_SRC} EXPORT_SRC
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "${MAKETARG}" = "CRYPT_SRC" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki restore_binaries ${CRYPT_SRC} CRYPT_SRC
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# function to do the build.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# usage: build LABEL SUFFIX
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkibuild() {
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
2ea390f3bec3fff24e17f2bb5bf7457e44834af2Michael Bergknoff if [ $# -ne 2 ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "usage: build LABEL SUFFIX"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki LABEL=$1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki SUFFIX=$2
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki INSTALLOG=install${SUFFIX}-${MACH}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki NOISE=noise${SUFFIX}-${MACH}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki CPIODIR=${CPIODIR_ORIG}${SUFFIX}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki PKGARCHIVE=${PKGARCHIVE_ORIG}${SUFFIX}
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw if [ "$SPARC_RM_PKGARCHIVE_ORIG" ]; then
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw SPARC_RM_PKGARCHIVE=${SPARC_RM_PKGARCHIVE_ORIG}${SUFFIX}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #remove old logs
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki OLDINSTALLOG=install${SUFFIX}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki OLDNOISE=noise${SUFFIX}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f $SRC/${OLDINSTALLOG}.out
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f $SRC/${OLDNOISE}.ref
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw if [ -f $SRC/${OLDNOISE}.out ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mv $SRC/${OLDNOISE}.out $SRC/${NOISE}.ref
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw this_build_ok=y
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw #
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw # Build OS-Networking source
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw #
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer echo "\n==== Building OS-Net source at `date` ($LABEL) ====\n" \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer >> $LOGFILE
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer rm -f $SRC/${INSTALLOG}.out
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer cd $SRC
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer /bin/time $MAKE -e install 2>&1 | \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer tee -a $SRC/${INSTALLOG}.out >> $LOGFILE
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer echo "\n==== SCCS Noise ($LABEL) ====\n" >> $mail_msg_file
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer egrep 'sccs(check| get)' $SRC/${INSTALLOG}.out >> $mail_msg_file
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer echo "\n==== Build errors ($LABEL) ====\n" >> $mail_msg_file
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer egrep ":" $SRC/${INSTALLOG}.out |
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer egrep -e "(^${MAKE}:|[ ]error[: \n])" | \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer egrep -v "Ignoring unknown host" | \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer egrep -v "cc .* -o error " | \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer egrep -v "warning" >> $mail_msg_file
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer if [ "$?" = "0" ]; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer build_ok=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki this_build_ok=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki grep "bootblock image is .* bytes too big" $SRC/${INSTALLOG}.out \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$?" = "0" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki build_ok=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki this_build_ok=n
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw fi
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw if [ "$W_FLAG" = "n" ]; then
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw echo "\n==== Build warnings ($LABEL) ====\n" >>$mail_msg_file
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw egrep -i warning: $SRC/${INSTALLOG}.out \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v '^tic:' \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v "symbol \`timezone' has differing types:" \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v "parameter <PSTAMP> set to" \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v "Ignoring unknown host" \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v "redefining segment flags attribute for" \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw >> $mail_msg_file
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw fi
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw echo "\n==== Ended OS-Net source build at `date` ($LABEL) ====\n" \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw >> $LOGFILE
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw echo "\n==== Elapsed build time ($LABEL) ====\n" >>$mail_msg_file
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw tail -3 $SRC/${INSTALLOG}.out >>$mail_msg_file
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer if [ "$i_FLAG" = "n" -a "$W_FLAG" = "n" ]; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer rm -f $SRC/${NOISE}.ref
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer if [ -f $SRC/${NOISE}.out ]; then
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw mv $SRC/${NOISE}.out $SRC/${NOISE}.ref
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw fi
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw grep : $SRC/${INSTALLOG}.out \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v '^/' \
dc6ca969834c6d8d1aac19aaea19d86c5b73cf75fw | egrep -v '^(Start|Finish|real|user|sys|./bld_awk)' \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v '^tic:' \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v '^mcs' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v '^LD_LIBRARY_PATH=' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v 'ar: creating' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v 'ar: writing' \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v 'conflicts:' \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v ':saved created' \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v '^stty.*c:' \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v '^mfgname.c:' \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v '^uname-i.c:' \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v '^volumes.c:' \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v '^lint library construction:' \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v 'tsort: INFORM:' \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v 'stripalign:' \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v 'chars, width' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v "symbol \`timezone' has differing types:" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v 'PSTAMP' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v '|%WHOANDWHERE%|' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v '^Manifying' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v 'Ignoring unknown host' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v 'Processing method:' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v '^Writing' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v 'spellin1:' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v '^adding:' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v "^echo 'msgid" \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v '^echo ' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v '\.c:$' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v '^Adding file:' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v 'CLASSPATH=' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v '\/var\/mail\/:saved' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v -- '-DUTS_VERSION=' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v '^Running Mkbootstrap' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v '^Applet length read:' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v 'bytes written:' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v '^File:SolarisAuthApplet.bin' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v -i 'jibversion' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v '^Output size:' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v '^Solo size statistics:' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v '^Using ROM API Version' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v '^Zero Signature length:' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v '^Note \(probably harmless\):' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v '::' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v -- '-xcache' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v '^\+' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v '^cc1: note: -fwritable-strings' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v 'svc:/' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | sort | uniq >$SRC/${NOISE}.out
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff if [ ! -f $SRC/${NOISE}.ref ]; then
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff cp $SRC/${NOISE}.out $SRC/${NOISE}.ref
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff fi
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff echo "\n==== Build noise differences ($LABEL) ====\n" \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff >>$mail_msg_file
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff diff $SRC/${NOISE}.ref $SRC/${NOISE}.out >>$mail_msg_file
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff fi
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # Create cpio archives for preintegration testing (PIT)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$a_FLAG" = "y" -a "$this_build_ok" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Creating $LABEL cpio archives at `date` ====\n" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki makebfu_file="${TMPDIR}/makebfu"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f ${makebfu_file}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki makebfu 2>&1 | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a ${makebfu_file} >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== cpio archives build errors ($LABEL) ====\n" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki grep -v "^Creating .* archive:" ${makebfu_file} | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki grep -v "^Making" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki grep -v "^$" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki sort | uniq >> $mail_msg_file
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw rm -f ${makebfu_file}
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw # hack for test folks
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -z "`echo $PARENT_WS|egrep '^\/ws\/'`" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki X=/net/`uname -n`${CPIODIR}
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw else
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw X=${CPIODIR}
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "Archive_directory: ${X}" >${TMPDIR}/f
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cp ${TMPDIR}/f ${CPIODIR}/../../.${MACH}_wgtrun
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f ${TMPDIR}/f
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Not creating $LABEL cpio archives ====\n" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw # Building Packages
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw #
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw if [ "$p_FLAG" = "y" -a "$this_build_ok" = "y" ]; then
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw echo "\n==== Creating $LABEL packages at `date` ====\n" \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw >> $LOGFILE
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw rm -f $SRC/pkgdefs/${INSTALLOG}.out
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "Clearing out $PKGARCHIVE ..." >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -rf $PKGARCHIVE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mkdir -p $PKGARCHIVE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw # Optional build of sparc realmode on i386
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$MACH" = "i386" ] && [ "${SPARC_RM_PKGARCHIVE}" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "Clearing out ${SPARC_RM_PKGARCHIVE} ..." \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -rf ${SPARC_RM_PKGARCHIVE}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mkdir -p ${SPARC_RM_PKGARCHIVE}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd $SRC/pkgdefs
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki $MAKE -e install 2>&1 | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $SRC/pkgdefs/${INSTALLOG}.out >> $LOGFILE
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw echo "\n==== Package build errors ($LABEL) ====\n" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $mail_msg_file
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer egrep "${MAKE}|ERROR|WARNING" $SRC/pkgdefs/${INSTALLOG}.out | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki grep ':' | \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw grep -v PSTAMP | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep -v "Ignoring unknown host" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Not creating $LABEL packages ====\n" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkidolint() {
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # Arg. 2 is a flag to turn on/off the lint diff output
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki dl_usage="Usage: dolint /dir y|n"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer if [ $# -ne 2 ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo $dl_usage
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ ! -d "$1" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo $dl_usage
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$2" != "y" -a "$2" != "n" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo $dl_usage
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki lintdir=$1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki dodiff=$2
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki base=`basename $lintdir`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki LINTOUT=$lintdir/lint-${MACH}.out
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki LINTNOISE=$lintdir/lint-noise-${MACH}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export INTERNAL_RELEASE_BUILD ; INTERNAL_RELEASE_BUILD=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki unset RELEASE_BUILD
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki unset EXTRA_OPTIONS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki unset EXTRA_CFLAGS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # '$MAKE lint' in $lintdir
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Begin '$MAKE lint' of $base at `date` ====\n" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # remove old lint.out
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f $lintdir/lint.out $lintdir/lint-noise.out
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -f $lintdir/lint-noise.ref ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mv $lintdir/lint-noise.ref ${LINTNOISE}.ref
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f $LINTOUT
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd $lintdir
806db1d7d3933321464d3e214503005b510991befw #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # Remove all .ln files to ensure a full reference file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw rm -f Nothing_to_remove \
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw `find . -name SCCS -prune -o -type f -name '*.ln' -print `
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki /bin/time $MAKE -ek lint 2>&1 | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $LINTOUT >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== '$MAKE lint' of $base ERRORS ====\n" >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki grep "$MAKE:" $LINTOUT |
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep -v "Ignoring unknown host" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Ended '$MAKE lint' of $base at `date` ====\n" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Elapsed time of '$MAKE lint' of $base ====\n" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >>$mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tail -3 $LINTOUT >>$mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f ${LINTNOISE}.ref
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -f ${LINTNOISE}.out ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mv ${LINTNOISE}.out ${LINTNOISE}.ref
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw grep : $LINTOUT | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep -v '^(real|user|sys)' |
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw egrep -v '(library construction)' | \
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw egrep -v ': global crosschecks' | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep -v 'Ignoring unknown host' | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep -v '\.c:$' | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki sort | uniq > ${LINTNOISE}.out
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ ! -f ${LINTNOISE}.ref ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cp ${LINTNOISE}.out ${LINTNOISE}.ref
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$dodiff" != "n" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== lint warnings $base ====\n" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >>$mail_msg_file
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw # should be none, though there are a few that were filtered out
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw # above
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw egrep -i '(warning|lint):' ${LINTNOISE}.out \
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw | sort | uniq >> $mail_msg_file
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw echo "\n==== lint noise differences $base ====\n" \
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw >> $mail_msg_file
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw diff ${LINTNOISE}.ref ${LINTNOISE}.out \
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw >> $mail_msg_file
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw fi
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw}
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw# Install proto area from IHV build
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfwcopy_ihv_proto() {
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw echo "\n==== Installing $IA32_IHV_ROOT ====\n" \
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw >> $LOGFILE
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw if [ -d "$IA32_IHV_ROOT" ]; then
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw if [ ! -d "$ROOT" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "mkdir -p $ROOT" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mkdir -p $ROOT
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "cd $IA32_IHV_ROOT\n" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd $IA32_IHV_ROOT
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tar -cf - . | (cd $ROOT; umask 0; tar xpf - ) 2>&1 >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "$IA32_IHV_ROOT: not found" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Install IHV packages in PKGARCHIVE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkicopy_ihv_pkgs() {
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw if [ $# -ne 2 ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "usage: copy_ihv_pkgs LABEL SUFFIX"
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw exit 1;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki LABEL=$1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki SUFFIX=$2
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # always use non-DEBUG IHV packages
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki IA32_IHV_PKGS=${IA32_IHV_PKGS_ORIG}-nd
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki PKGARCHIVE=${PKGARCHIVE_ORIG}${SUFFIX}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Installing IHV packages from $IA32_IHV_PKGS ($LABEL) ====\n" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -d "$IA32_IHV_PKGS" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd $IA32_IHV_PKGS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tar -cf - * | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki (cd $PKGARCHIVE; umask 0; tar xpf - ) 2>&1 >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "$IA32_IHV_PKGS: not found" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Installing IHV packages from $IA32_IHV_BINARY_PKGS ($LABEL) ====\n" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -d "$IA32_IHV_BINARY_PKGS" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd $IA32_IHV_BINARY_PKGS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tar -cf - * | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki (cd $PKGARCHIVE; umask 0; tar xpf - ) 2>&1 >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "$IA32_IHV_BINARY_PKGS: not found" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkibuild_tools() {
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ $# -ne 1 ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "usage: build_tools DESTROOT"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki DESTROOT=$1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki INSTALLOG=install-${MACH}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Building tools at `date` ====\n" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f ${TOOLS}/${INSTALLOG}.out
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd ${TOOLS}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki /bin/time $MAKE ROOT=${DESTROOT} -e install 2>&1 | \
5413ab1b25eb8f7cbf9070adc2e222772aa054daMichael Bergknoff tee -a ${TOOLS}/${INSTALLOG}.out >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Tools build errors ====\n" >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep ":" ${TOOLS}/${INSTALLOG}.out |
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep -e "(${MAKE}:|[ ]error[: \n])" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep -v "Ignoring unknown host" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep -v warning >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$?" != "0" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki STABS=${DESTROOT}/opt/onbld/bin/${MACH}/stabs
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export STABS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki CTFSTABS=${DESTROOT}/opt/onbld/bin/${MACH}/ctfstabs
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export CTFSTABS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki GENOFFSETS=${DESTROOT}/opt/onbld/bin/genoffsets
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export GENOFFSETS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki CTFCONVERT=${DESTROOT}/opt/onbld/bin/${MACH}/ctfconvert
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export CTFCONVERT
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki CTFMERGE=${DESTROOT}/opt/onbld/bin/${MACH}/ctfmerge
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export CTFMERGE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki CTFCVTPTBL=${DESTROOT}/opt/onbld/bin/ctfcvtptbl
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export CTFCVTPTBL
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki CTFFINDMOD=${DESTROOT}/opt/onbld/bin/ctffindmod
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export CTFFINDMOD
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$VERIFY_ELFSIGN" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ELFSIGN=${DESTROOT}/opt/onbld/bin/elfsigncmp
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ELFSIGN=${DESTROOT}/opt/onbld/bin/${MACH}/elfsign
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export ELFSIGN
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki PATH="${DESTROOT}/opt/onbld/bin/${MACH}:${PATH}"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki PATH="${DESTROOT}/opt/onbld/bin:${PATH}"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export PATH
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== New environment settings. ====\n" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "STABS=${STABS}" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "CTFSTABS=${CTFSTABS}" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "CTFCONVERT=${CTFCONVERT}" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "CTFMERGE=${CTFMERGE}" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "CTFCVTPTBL=${CTFCVTPTBL}" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "CTFFINDMOD=${CTFFINDMOD}" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "ELFSIGN=${ELFSIGN}" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "PATH=${PATH}" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkistaffer() {
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ $ISUSER -ne 0 ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "$@"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki arg="\"$1\""
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki shift
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki for i
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki do
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki arg="$arg \"$i\""
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki done
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki eval su $STAFFER -c \'$arg\'
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw}
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Verify that the closed tree is present if it needs to be.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Sets CLOSED_IS_PRESENT for future use.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkicheck_closed_tree() {
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -z "$CLOSED_IS_PRESENT" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -d $SRC/../closed ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki CLOSED_IS_PRESENT="yes"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki CLOSED_IS_PRESENT="no"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw export CLOSED_IS_PRESENT
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw fi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw if [[ "$CLOSED_IS_PRESENT" = no && ! -d "$ON_CLOSED_BINS" ]]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # If it's an old (pre-split) tree or an empty
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # workspace, don't complain.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if grep -s CLOSED_BUILD $SRC/Makefile.master > /dev/null; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "If the closed sources are not present," \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "ON_CLOSED_BINS"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "must point to the closed binaries tree."
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw fi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw}
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiobsolete_build() {
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "WARNING: Obsolete $1 build requested; request will be ignored"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
aaba19e23c48a32e927f4e39464be188bfcbef37fwMACH=`uname -p`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
aaba19e23c48a32e927f4e39464be188bfcbef37fwif [ "$OPTHOME" = "" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki OPTHOME=/opt
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export OPTHOME
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$TEAMWARE" = "" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki TEAMWARE=$OPTHOME/teamware
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export TEAMWARE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiUSAGE='Usage: nightly [-in] [-V VERS ] [ -S E|D|H ] <env_file>
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiWhere:
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -i Fast incremental options (no clobber, lint, check)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -n Do not do a bringover
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -V VERS set the build version string to VERS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -S Build a variant of the source product
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki E - build exportable source
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki D - build domestic source (exportable + crypt)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki H - build hybrid source (binaries + deleted source)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki <env_file> file in Bourne shell syntax that sets and exports
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki variables that configure the operation of this script and many of
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki the scripts this one calls. If <env_file> does not exist,
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki it will be looked for in $OPTHOME/onbld/env.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkinon-DEBUG is the default build type. Build options can be set in the
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiNIGHTLY_OPTIONS variable in the <env_file> as follows:
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -A check for ABI differences in .so files
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -C check for cstyle/hdrchk errors
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -D do a build with DEBUG on
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -F do _not_ do a non-DEBUG build
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -G gate keeper default group of options (-au)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -I integration engineer default group of options (-ampu)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -M do not run pmodes (safe file permission checker)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -N do not run protocmp
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -R default group of options for building a release (-mp)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -U update proto area in the parent
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -V VERS set the build version string to VERS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -X copy x86 IHV proto area
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -a create cpio archives
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -f find unreferenced files
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -i do an incremental build (no "make clobber")
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -l do "make lint" in $LINTDIRS (default: $SRC y)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -m send mail to $MAILTO at end of build
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -n do not do a bringover
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -o build using root privileges to set OWNER/GROUP (old style)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -p create packages
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -r check ELF runtime attributes in the proto area
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -t build and use the tools in $SRC/tools
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw -u update proto_list_$MACH and friends in the parent workspace;
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw when used with -f, also build an unrefmaster.out in the parent
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw -z compress cpio archives with gzip
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -W Do not report warnings (freeware gate ONLY)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -S Build a variant of the source product
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki E - build exportable source
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki D - build domestic source (exportable + crypt)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki H - build hybrid source (binaries + deleted source)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki'
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# -x less public handling of xmod source for the source product
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# A log file will be generated under the name $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# for partially completed build and log.`date '+%F'`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# in the same directory for fully completed builds.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# default values for low-level FLAGS; G I R are group FLAGS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiA_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkia_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiC_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiF_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkif_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiD_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiP_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiT_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkin_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkio_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkii_FLAG=n; i_CMD_LINE_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkil_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkim_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkip_FLAG=n
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwr_FLAG=n
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwt_FLAG=n
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwu_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiU_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiV_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiM_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiN_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiz_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiW_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiSE_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiSD_FLAG=n
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwSH_FLAG=n
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwX_FLAG=n
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiXMOD_OPT=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkibuild_ok=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# examine arguments
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiOPTIND=1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiwhile getopts inV:S:t FLAG
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkido
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki case $FLAG in
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki i ) i_FLAG=y; i_CMD_LINE_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki n ) n_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki V ) V_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki V_ARG="$OPTARG"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki S )
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$SE_FLAG" = "y" -o "$SD_FLAG" = "y" -o "$SH_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "Can only build one source variant at a time."
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "${OPTARG}" = "E" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki SE_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki elif [ "${OPTARG}" = "D" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki SD_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki elif [ "${OPTARG}" = "H" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki SH_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "$USAGE"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki t ) t_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki \? ) echo "$USAGE"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki esac
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkidone
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# correct argument count after options
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkishift `expr $OPTIND - 1`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# test that the path to the environment-setting file was given
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ $# -ne 1 ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "$USAGE"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# check if user is running nightly as root
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# ISUSER is set non-zero if an ordinary user runs nightly, or is zero
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# when root invokes nightly.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki/usr/bin/id | grep '^uid=0(' >/dev/null 2>&1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiISUSER=$?; export ISUSER
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# force locale to C
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiLC_COLLATE=C; export LC_COLLATE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiLC_CTYPE=C; export LC_CTYPE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiLC_MESSAGES=C; export LC_MESSAGES
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiLC_MONETARY=C; export LC_MONETARY
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiLC_NUMERIC=C; export LC_NUMERIC
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiLC_TIME=C; export LC_TIME
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# clear environment variables we know to be bad for the build
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_OPTIONS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_AUDIT LD_AUDIT_32 LD_AUDIT_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_BIND_NOW LD_BIND_NOW_32 LD_BIND_NOW_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_BREADTH LD_BREADTH_32 LD_BREADTH_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_CONFIG LD_CONFIG_32 LD_CONFIG_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_DEBUG LD_DEBUG_32 LD_DEBUG_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_DEMANGLE LD_DEMANGLE_32 LD_DEMANGLE_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_FLAGS LD_FLAGS_32 LD_FLAGS_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_LIBRARY_PATH LD_LIBRARY_PATH_32 LD_LIBRARY_PATH_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_LOADFLTR LD_LOADFLTR_32 LD_LOADFLTR_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_NOAUDIT LD_NOAUDIT_32 LD_NOAUDIT_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_NOAUXFLTR LD_NOAUXFLTR_32 LD_NOAUXFLTR_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_NOCONFIG LD_NOCONFIG_32 LD_NOCONFIG_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_NODIRCONFIG LD_NODIRCONFIG_32 LD_NODIRCONFIG_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_NODIRECT LD_NODIRECT_32 LD_NODIRECT_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_NOLAZYLOAD LD_NOLAZYLOAD_32 LD_NOLAZYLOAD_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_NOOBJALTER LD_NOOBJALTER_32 LD_NOOBJALTER_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_NOVERSION LD_NOVERSION_32 LD_NOVERSION_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_ORIGIN LD_ORIGIN_32 LD_ORIGIN_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_PRELOAD LD_PRELOAD_32 LD_PRELOAD_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_PROFILE LD_PROFILE_32 LD_PROFILE_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset CONFIG
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset GROUP
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset OWNER
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset REMOTE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset ENV
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset ARCH
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset CLASSPATH
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset NAME
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Setup environmental variables
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ -f $1 ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [[ $1 = */* ]]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki . $1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki . ./$1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkielse
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -f $OPTHOME/onbld/env/$1 ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki . $OPTHOME/onbld/env/$1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "Cannot find env file as either $1 or $OPTHOME/onbld/env/$1"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# place ourselves in a new task, respecting BUILD_PROJECT if set.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ -z "$BUILD_PROJECT" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki /usr/bin/newtask -c $$
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkielse
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki /usr/bin/newtask -c $$ -p $BUILD_PROJECT
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkips -o taskid= -p $$ | read build_taskid
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkips -o project= -p $$ | read build_project
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# See if NIGHTLY_OPTIONS is set
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$NIGHTLY_OPTIONS" = "" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki NIGHTLY_OPTIONS="-aBm"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# If BRINGOVER_WS was not specified, let it default to CLONE_WS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$BRINGOVER_WS" = "" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki BRINGOVER_WS=$CLONE_WS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# If BRINGOVER_FILES was not specified, default to usr
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$BRINGOVER_FILES" = "" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki BRINGOVER_FILES="usr"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# If the closed sources are not present, the closed binaries must be
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# present for the build to succeed. If there's no pointer to the
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# closed binaries, flag that now, rather than forcing the user to wait
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# a couple hours (or more) to find out.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiorig_closed_is_present="$CLOSED_IS_PRESENT"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkicheck_closed_tree
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Note: changes to the option letters here should also be applied to the
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# bldenv script. `d' is listed for backward compatibility.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiNIGHTLY_OPTIONS=-${NIGHTLY_OPTIONS#-}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiOPTIND=1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiwhile getopts ABDFNMPTCGIRafinlmoptuUxdrtzWS:X FLAG $NIGHTLY_OPTIONS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkido
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki case $FLAG in
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki A ) A_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki B ) D_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;; # old version of D
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki F ) F_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki D ) D_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki P ) P_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;; # obsolete
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki T ) T_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;; # obsolete
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki C ) C_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki M ) M_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki N ) N_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki G ) a_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki u_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki I ) a_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki m_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki p_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki u_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki R ) m_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki p_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki a ) a_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki f ) f_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki i ) i_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki n ) n_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki o ) o_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki l ) l_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki m ) m_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki p ) p_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki r ) r_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki t ) t_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki u ) u_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki z ) z_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki U )
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -z "${PARENT_ROOT}" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "PARENT_ROOT must be set if the U flag is" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "present in NIGHTLY_OPTIONS."
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki U_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki NIGHTLY_PARENT_ROOT=$PARENT_ROOT
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw x ) XMOD_OPT="-x"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki W ) W_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki S )
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$SE_FLAG" = "y" -o "$SD_FLAG" = "y" -o "$SH_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "Can only build one source variant at a time."
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "${OPTARG}" = "E" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki SE_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki elif [ "${OPTARG}" = "D" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki SD_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki elif [ "${OPTARG}" = "H" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki SH_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "$USAGE"
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw exit 1
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw fi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw ;;
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw X ) # now that we no longer need realmode builds, just
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw # copy IHV packages. only meaningful on x86.
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw if [ "$MACH" = "i386" ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw X_FLAG=y
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw fi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw ;;
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw \? ) echo "$USAGE"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki esac
af71cc4ed6be914d26e9de3a90a2bb56e4bbe78dMichael Bergknoffdone
af71cc4ed6be914d26e9de3a90a2bb56e4bbe78dMichael Bergknoff
af71cc4ed6be914d26e9de3a90a2bb56e4bbe78dMichael Bergknoffif [ $ISUSER -ne 0 ]; then
af71cc4ed6be914d26e9de3a90a2bb56e4bbe78dMichael Bergknoff if [ "$o_FLAG" = "y" ]; then
af71cc4ed6be914d26e9de3a90a2bb56e4bbe78dMichael Bergknoff echo "Old-style build requires root permission."
af71cc4ed6be914d26e9de3a90a2bb56e4bbe78dMichael Bergknoff exit 1
af71cc4ed6be914d26e9de3a90a2bb56e4bbe78dMichael Bergknoff fi
af71cc4ed6be914d26e9de3a90a2bb56e4bbe78dMichael Bergknoff
af71cc4ed6be914d26e9de3a90a2bb56e4bbe78dMichael Bergknoff # Set default value for STAFFER, if needed.
af71cc4ed6be914d26e9de3a90a2bb56e4bbe78dMichael Bergknoff if [ -z "$STAFFER" -o "$STAFFER" = "nobody" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki STAFFER=`/usr/xpg4/bin/id -un`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export STAFFER
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ -z "$MAILTO" -o "$MAILTO" = "nobody" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki MAILTO=$STAFFER
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export MAILTO
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiPATH="$OPTHOME/onbld/bin:$OPTHOME/onbld/bin/${MACH}:/usr/ccs/bin"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiPATH="$PATH:$OPTHOME/SUNWspro/bin:$TEAMWARE/bin:/usr/bin:/usr/sbin:/usr/ucb"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiPATH="$PATH:/usr/openwin/bin:/usr/sfw/bin:/opt/sfw/bin:."
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiexport PATH
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# roots of source trees, both relative to $SRC and absolute.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkirelsrcdirs="."
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [[ -d $SRC/../closed && "$CLOSED_IS_PRESENT" != no ]]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki relsrcdirs="$relsrcdirs ../closed"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiabssrcdirs=""
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifor d in $relsrcdirs; do
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki abssrcdirs="$abssrcdirs $SRC/$d"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkidone
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset CH
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$o_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# root invoked old-style build -- make sure it works as it always has
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# by exporting 'CH'. The current Makefile.master doesn't use this, but
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# the old ones still do.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki PROTOCMPTERSE="protocmp.terse"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki CH=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export CH
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkielse
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki PROTOCMPTERSE="protocmp.terse -gu"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiPOUND_SIGN="#"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# we export POUND_SIGN to speed up the build process -- prevents evaluation of
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# the Makefile.master definitions.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiexport o_FLAG POUND_SIGN
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkimaketype="distributed"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiMAKE=dmake
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# get the dmake version string alone
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiDMAKE_VERSION=$( $MAKE -v )
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiDMAKE_VERSION=${DMAKE_VERSION#*: }
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# focus in on just the dotted version number alone
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiDMAKE_MAJOR=$( echo $DMAKE_VERSION | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki sed -e 's/.*\<\([^.]*\.[^ ]*\).*$/\1/' )
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# extract the second (or final) integer
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiDMAKE_MINOR=${DMAKE_MAJOR#*.}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiDMAKE_MINOR=${DMAKE_MINOR%%.*}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# extract the first integer
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiDMAKE_MAJOR=${DMAKE_MAJOR%%.*}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiCHECK_DMAKE=${CHECK_DMAKE:-y}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# x86 was built on the 12th, sparc on the 13th.
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwif [ "$CHECK_DMAKE" = "y" -a \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "$DMAKE_VERSION" != "Sun Distributed Make 7.3 2003/03/12" -a \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "$DMAKE_VERSION" != "Sun Distributed Make 7.3 2003/03/13" -a \( \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "$DMAKE_MAJOR" -lt 7 -o \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "$DMAKE_MAJOR" -eq 7 -a "$DMAKE_MINOR" -lt 4 \) ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -z "$DMAKE_VERSION" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "$MAKE is missing."
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo `whence $MAKE`" version is:"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo " ${DMAKE_VERSION}"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cat <<EOF
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiThis version may not be safe for use. Either set TEAMWARE to a better
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkipath or (if you really want to use this version of dmake anyway), add
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkithe following to your environment to disable this check:
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki CHECK_DMAKE=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiEOF
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiexport PATH
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiexport MAKE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "${SUNWSPRO}" != "" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki PATH="${SUNWSPRO}/bin:$PATH"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export PATH
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwhostname=`uname -n`
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwif [ ! -f $HOME/.make.machines ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw DMAKE_MAX_JOBS=4
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwelse
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw DMAKE_MAX_JOBS="`grep $hostname $HOME/.make.machines | \
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw tail -1 | awk -F= '{print $ 2;}'`"
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw if [ "$DMAKE_MAX_JOBS" = "" ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw DMAKE_MAX_JOBS=4
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiDMAKE_MODE=parallel;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiexport DMAKE_MODE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiexport DMAKE_MAX_JOBS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ -z "${ROOT}" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "ROOT must be set."
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$SE_FLAG" = "y" -o "$SD_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -z "${EXPORT_SRC}" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "EXPORT_SRC must be set for a source build."
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -z "${CRYPT_SRC}" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "CRYPT_SRC must be set for a source build."
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$SH_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -z "${EXPORT_SRC}" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "EXPORT_SRC must be set for a source build."
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw fi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwfi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# if -V flag was given, reset VERSION to V_ARG
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$V_FLAG" = "y" ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw VERSION=$V_ARG
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwfi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Check for IHV root for copying ihv proto area
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$X_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$IA32_IHV_ROOT" = "" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "IA32_IHV_ROOT: must be set for copying ihv proto"
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw args_ok=n
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ ! -d "$IA32_IHV_ROOT" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "$IA32_IHV_ROOT: not found"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki args_ok=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwfi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw# Append source version
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwif [ "$SE_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki VERSION="${VERSION}:EXPORT"
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwfi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwif [ "$SD_FLAG" = "y" ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw VERSION="${VERSION}:DOMESTIC"
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwfi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$SH_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki VERSION="${VERSION}:MODIFIED_SOURCE_PRODUCT"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiTMPDIR="/tmp/nightly.tmpdir.$$"
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwexport TMPDIR
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwrm -rf ${TMPDIR}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkimkdir -p $TMPDIR || exit 1
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Keep elfsign's use of pkcs11_softtoken from looking in the user home
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# directory, which doesn't always work. Needed until all build machines
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# have the fix for 6271754
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiSOFTTOKEN_DIR=$TMPDIR
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiexport SOFTTOKEN_DIR
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiTOOLS=${SRC}/tools
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiTOOLS_PROTO=${TOOLS}/proto
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset CFLAGS LD_LIBRARY_PATH LDFLAGS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# create directories that are automatically removed if the nightly script
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# fails to start correctly
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkinewdir() {
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki dir=$1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki toadd=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki while [ ! -d $dir ]; do
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki toadd="$dir $toadd"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki dir=`dirname $dir`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki done
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki torm=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki newlist=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki for dir in $toadd; do
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if staffer mkdir $dir; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki newlist="$ISUSER $dir $newlist"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki torm="$dir $torm"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki [ -z "$torm" ] || staffer rmdir $torm
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki return 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki done
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki newdirlist="$newlist $newdirlist"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki return 0
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkinewdirlist=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki[ -d $CODEMGR_WS ] || newdir $CODEMGR_WS || exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# since this script assumes the build is from full source, it nullifies
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# variables likely to have been set by a "ws" script; nullification
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# confines the search space for headers and libraries to the proto area
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# built from this immediate source.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiENVLDLIBS1=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiENVLDLIBS2=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiENVLDLIBS3=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiENVCPPFLAGS1=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiENVCPPFLAGS2=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiENVCPPFLAGS3=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiENVCPPFLAGS4=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiPARENT_ROOT=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiexport ENVLDLIBS3 ENVCPPFLAGS1 ENVCPPFLAGS2 ENVCPPFLAGS3 ENVCPPFLAGS4 \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki PARENT_ROOT
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiENVLDLIBS1="-L$ROOT/lib -L$ROOT/usr/lib"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiENVCPPFLAGS1="-I$ROOT/usr/include"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiexport ENVLDLIBS1 ENVLDLIBS2
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiCPIODIR_ORIG=$CPIODIR
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiPKGARCHIVE_ORIG=$PKGARCHIVE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiIA32_IHV_PKGS_ORIG=$IA32_IHV_PKGS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$SPARC_RM_PKGARCHIVE" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki SPARC_RM_PKGARCHIVE_ORIG=$SPARC_RM_PKGARCHIVE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Juggle the logs and optionally send mail on completion.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkilogshuffle() {
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki LLOG="$ATLOG/log.`date '+%F'`"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -rf $ATLOG/log.??`date '+%d'`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -rf $ATLOG/log.????-??-`date '+%d'`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -f $LLOG -o -d $LLOG ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki LLOG=$LLOG.$$
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mkdir $LLOG
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export LLOG
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$build_ok" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mv $ATLOG/proto_list_${MACH} $LLOG
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # Now that we're about to send mail, it's time to check the noise
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # file. In the event that an error occurs beyond this point, it will
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # be recorded in the nightly.log file, but nowhere else. This would
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw # include only errors that cause the copying of the noise log to fail
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw # or the mail itself not to be sent.
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exec >>$LOGFILE 2>&1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -s $build_noise_file ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Nightly build noise ====\n" |
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $LOGFILE >>$mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cat $build_noise_file >>$LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cat $build_noise_file >>$mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo | tee -a $LOGFILE >>$mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f $build_noise_file
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw case "$build_ok" in
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw y)
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw state=Completed
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw ;;
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw i)
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw state=Interrupted
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw ;;
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw *)
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw state=Failed
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw ;;
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw esac
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki NIGHTLY_STATUS=$state
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw export NIGHTLY_STATUS
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw if [ -n "$POST_NIGHTLY" ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "\n==== Running POST_NIGHTLY command:" \
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw "$POST_NIGHTLY ====\n" | tee -a $mail_msg_file >> $LOGFILE
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw $POST_NIGHTLY $state 2>&1 | tee -a $mail_msg_file >> $LOGFILE
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw fi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw cat $build_time_file $mail_msg_file > ${LLOG}/mail_msg
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw if [ "$m_FLAG" = "y" ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw cat $build_time_file $mail_msg_file |
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw /usr/bin/mailx -s \
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw "Nightly ${MACH} Build of `basename ${CODEMGR_WS}` ${state}." \
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw ${MAILTO}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$u_FLAG" = "y" -a "$build_ok" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki staffer cp ${LLOG}/mail_msg $PARENT_WS/usr/src/mail_msg-${MACH}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki staffer cp $LOGFILE $PARENT_WS/usr/src/nightly-${MACH}.log
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mv $LOGFILE $LLOG
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Remove the locks and temporary files on any exit
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkicleanup() {
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki logshuffle
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki [ -z "$lockfile" ] || staffer rm -f $lockfile
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki [ -z "$atloglockfile" ] || rm -f $atloglockfile
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki [ -z "$ulockfile" ] || staffer rm -f $ulockfile
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki [ -z "$Ulockfile" ] || rm -f $Ulockfile
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki set -- $newdirlist
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki while [ $# -gt 0 ]; do
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ISUSER=$1 staffer rmdir $2
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki shift; shift
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki done
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -rf $TMPDIR
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkicleanup_signal() {
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki build_ok=i
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # this will trigger cleanup(), above.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkitrap cleanup 0
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkitrap cleanup_signal 1 2 3 15
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
aaba19e23c48a32e927f4e39464be188bfcbef37fw#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Generic lock file processing -- make sure that the lock file doesn't
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# exist. If it does, it should name the build host and PID. If it
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# doesn't, then make sure we can create it. Clean up locks that are
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# known to be stale (assumes host name is unique among build systems
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# for the workspace).
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkicreate_lock() {
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki lockf=$1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki lockvar=$2
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -f $lockf ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki basews=`basename $CODEMGR_WS`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if read host user pid < $lockf; then
aaba19e23c48a32e927f4e39464be188bfcbef37fw if [ "$host" != "$hostname" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "$MACH build of $basews apparently" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "already started by $user on $host as $pid."
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki elif kill -s 0 $pid 2>/dev/null; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "$MACH build of $basews already started" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "by $user as $pid."
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # stale lock; clear it out and continue
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f $lockf
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "$MACH build of $basews already running."
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -f $lockf ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "Lock file is $lockf."
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ldir=`dirname $lockf`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki [ -d $ldir ] || newdir $ldir || exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki eval $lockvar=$lockf
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki staffer sh -c "echo $hostname $STAFFER $$ > $lockf" || exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Ensure no other instance of this script is running on this host.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# LOCKNAME can be set in <env_file>, and is by default, but is not
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# required due to the use of $ATLOG below.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ -n "$LOCKNAME" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki create_lock /tmp/$LOCKNAME "lockfile"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Create from one, two, or three other locks:
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# $ATLOG/nightly.lock
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# - protects against multiple builds in same workspace
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# $PARENT_WS/usr/src/nightly.$MACH.lock
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# - protects against multiple 'u' copy-backs
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# $NIGHTLY_PARENT_ROOT/nightly.lock
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# - protects against multiple 'U' copy-backs
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Overriding ISUSER to 1 causes the lock to be created as root if the
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# script is run as root. The default is to create it as $STAFFER.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiISUSER=1 create_lock $ATLOG/nightly.lock "atloglockfile"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$u_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki create_lock $PARENT_WS/usr/src/nightly.$MACH.lock "ulockfile"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$U_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # NIGHTLY_PARENT_ROOT is written as root if script invoked as root.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ISUSER=1 create_lock $NIGHTLY_PARENT_ROOT/nightly.lock "Ulockfile"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Locks have been taken, so we're doing a build and we're committed to
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# the directories we may have created so far.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkinewdirlist=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Create mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkimail_msg_file="${TMPDIR}/mail_msg"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkitouch $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkibuild_time_file="${TMPDIR}/build_time"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Move old LOGFILE aside
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# ATLOG directory already made by 'create_lock' above
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ -f $LOGFILE ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mv -f $LOGFILE ${LOGFILE}-
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Build OsNet source
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
2ea390f3bec3fff24e17f2bb5bf7457e44834af2Michael BergknoffSTART_DATE=`date`
2ea390f3bec3fff24e17f2bb5bf7457e44834af2Michael BergknoffSECONDS=0
2ea390f3bec3fff24e17f2bb5bf7457e44834af2Michael Bergknoffecho "\n==== Nightly $maketype build started: $START_DATE ====" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | tee -a $LOGFILE > $build_time_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# make sure we log only to the nightly build file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkibuild_noise_file="${TMPDIR}/build_noise"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiexec </dev/null >$build_noise_file 2>&1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiecho "\n==== list of environment variables ====\n" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkienv >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiecho "\n==== Nightly argument issues ====\n" | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$P_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki obsolete_build GPROF | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$T_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki obsolete_build TRACE | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$SE_FLAG" = "y" -o "$SD_FLAG" = "y" -o "$SH_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$i_FLAG" = "y" -o "$i_CMD_LINE_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "WARNING: the -S flags do not support incremental" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "builds; forcing clobber\n" | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki i_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki i_CMD_LINE_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$N_FLAG" = "n" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "WARNING: the -S flags do not support protocmp;" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "protocmp disabled\n" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki N_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$l_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "WARNING: the -S flags do not support lint;" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "lint disabled\n" | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki l_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$C_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "WARNING: the -S flags do not support cstyle;" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "cstyle check disabled\n" | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki C_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkielse
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$N_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$p_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cat <<EOF | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiWARNING: the p option (create packages) is set, but so is the N option (do
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki not run protocmp); this is dangerous; you should unset the N option
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiEOF
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cat <<EOF | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiWarning: the N option (do not run protocmp) is set; it probably shouldn't be
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiEOF
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "" | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$a_FLAG" = "y" -a "$D_FLAG" = "n" -a "$F_FLAG" = "y" ]; then
2ea390f3bec3fff24e17f2bb5bf7457e44834af2Michael Bergknoff echo "WARNING: Neither DEBUG nor non-DEBUG build requested, but the" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "'a' option was set." | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$D_FLAG" = "n" -a "$l_FLAG" = "y" ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "WARNING: DEBUG build not requested, but lint will be with" \
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw "DEBUG enabled.\n" \
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw | tee -a $mail_msg_file >> $LOGFILE
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwfi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$f_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$i_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "WARNING: the -f flag cannot be used during incremental" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "builds; ignoring -f\n" | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki f_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$p_FLAG" != "y" -o "$l_FLAG" != "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "WARNING: the -f flag requires -l and -p; ignoring -f\n" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki f_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$t_FLAG" = "n" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # We're not doing a tools build, so make sure elfsign(1) is
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # new enough to safely sign non-crypto binaries. We test
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # debugging output from elfsign to detect the old version.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki newelfsigntest=`SUNW_CRYPTO_DEBUG=stderr /usr/bin/elfsign verify \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -e /usr/lib/security/pkcs11_softtoken.so.1 2>&1 \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep algorithmOID`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -z "$newelfsigntest" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "WARNING: /usr/bin/elfsign out of date;" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "will only sign crypto modules\n" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export ELFSIGN_OBJECT=true
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki elif [ "$VERIFY_ELFSIGN" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "WARNING: VERIFY_ELFSIGN=y requires" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "the -t flag; ignoring VERIFY_ELFSIGN\n" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# copy ihv proto area in addition to the build itself
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
aaba19e23c48a32e927f4e39464be188bfcbef37fwif [ "$X_FLAG" = "y" ]; then
aaba19e23c48a32e927f4e39464be188bfcbef37fw
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # Install IA32 IHV proto area
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki copy_ihv_proto
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiecho "==== Build environment ====\n" | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# System
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiwhence uname | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiuname -a 2>&1 | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiecho | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# nightly (will fail in year 2100 due to SCCS flaw)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiecho "$0 $@" | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiecho "%M% version %I% 20%E%\n" | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# make
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiwhence $MAKE | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki$MAKE -v | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiecho "number of concurrent jobs = $DMAKE_MAX_JOBS" |
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Report the compiler versions.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ -f $SRC/Makefile ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki srcroot=$SRC
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkielif [ -f $BRINGOVER_WS/usr/src/Makefile ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki srcroot=$BRINGOVER_WS/usr/src
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkielse
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\nUnable to find \"Makefile\" in $BRINGOVER_WS/usr/src or $SRC." |
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki( cd $srcroot
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki for target in cc-version cc64-version java-version; do
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # Put statefile somewhere we know we can write to rather than trip
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # over a read-only $srcroot.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f $TMPDIR/make-state
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export SRC=$srcroot
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if $MAKE -K $TMPDIR/make-state -e $target 2>/dev/null; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki continue
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki touch $TMPDIR/nocompiler
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki done
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki) | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ -f $TMPDIR/nocompiler ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f $TMPDIR/nocompiler
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki build_ok=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "Aborting due to missing compiler." |
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# as
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiwhence as | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkias -V 2>&1 | head -1 | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiecho | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Check that we're running a capable link-editor
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiwhence ld | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiLDVER=`ld -V 2>&1`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiecho $LDVER | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiLDVER=`echo $LDVER | sed -e "s/.*-1\.//" -e "s/:.*//"`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ `expr $LDVER \< 422` -eq 1 ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "The link-editor needs to be at version 422 or higher to build" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "the latest stuff, hope your build works." | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
dc6ca969834c6d8d1aac19aaea19d86c5b73cf75fw
dc6ca969834c6d8d1aac19aaea19d86c5b73cf75fwecho "\nBuild project: $build_project\nBuild taskid: $build_taskid" | \
dc6ca969834c6d8d1aac19aaea19d86c5b73cf75fw tee -a $mail_msg_file >> $LOGFILE
dc6ca969834c6d8d1aac19aaea19d86c5b73cf75fw
dc6ca969834c6d8d1aac19aaea19d86c5b73cf75fwecho "\n==== Build version ====\n" | tee -a $mail_msg_file >> $LOGFILE
dc6ca969834c6d8d1aac19aaea19d86c5b73cf75fwecho $VERSION | tee -a $mail_msg_file >> $LOGFILE
dc6ca969834c6d8d1aac19aaea19d86c5b73cf75fw
dc6ca969834c6d8d1aac19aaea19d86c5b73cf75fw#
dc6ca969834c6d8d1aac19aaea19d86c5b73cf75fw# Decide whether to clobber
dc6ca969834c6d8d1aac19aaea19d86c5b73cf75fw#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$i_FLAG" = "n" -a -d "$SRC" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Make clobber at `date` ====\n" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd $SRC
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # remove old clobber file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f $SRC/clobber.out
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw rm -f $SRC/clobber-${MACH}.out
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw # Remove all .make.state* files, just in case we are restarting
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw # the build after having interrupted a previous 'make clobber'.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki find . \( -name SCCS -o -name 'interfaces.*' \) -prune \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -o -name '.make.*' -print | xargs rm -f
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki $MAKE -ek clobber 2>&1 | tee -a $SRC/clobber-${MACH}.out >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Make clobber ERRORS ====\n" >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki grep "$MAKE:" $SRC/clobber-${MACH}.out |
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep -v "Ignoring unknown host" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $mail_msg_file
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw if [ "$t_FLAG" = "y" ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "\n==== Make tools clobber at `date` ====\n" >> $LOGFILE
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw cd ${TOOLS}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f ${TOOLS}/clobber-${MACH}.out
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki $MAKE -ek clobber 2>&1 | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a ${TOOLS}/clobber-${MACH}.out >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Make tools clobber ERRORS ====\n" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki grep "$MAKE:" ${TOOLS}/clobber-${MACH}.out \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -rf ${TOOLS_PROTO}
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw mkdir -p ${TOOLS_PROTO}
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw fi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw rm -rf $ROOT
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # Get back to a clean workspace as much as possible to catch
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # problems that only occur on fresh workspaces.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # Remove all .make.state* files, libraries, and .o's that may
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # have been omitted from clobber. A couple of libraries are
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # under SCCS, so leave them alone.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # We should probably blow away temporary directories too.
2ea390f3bec3fff24e17f2bb5bf7457e44834af2Michael Bergknoff cd $SRC
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki find $relsrcdirs \( -name SCCS -o -name 'interfaces.*' \) -prune -o \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki \( -name '.make.*' -o -name 'lib*.a' -o -name 'lib*.so*' -o \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -name '*.o' \) -print | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki grep -v 'tools/ctf/dwarf/.*/libdwarf' | xargs rm -f
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwelse
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "\n==== No clobber at `date` ====\n" >> $LOGFILE
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwfi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Decide whether to bringover to the codemgr workspace
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$n_FLAG" = "n" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== bringover to $CODEMGR_WS at `date` ====\n" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # sleep on the parent workspace's lock
2ea390f3bec3fff24e17f2bb5bf7457e44834af2Michael Bergknoff while egrep -s write $BRINGOVER_WS/Codemgr_wsdata/locks
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki do
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki sleep 120
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki done
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "\n==== BRINGOVER LOG ====\n" >> $mail_msg_file
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw (staffer $TEAMWARE/bin/bringover -c "nightly update" -p $BRINGOVER_WS \
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw -w $CODEMGR_WS $BRINGOVER_FILES < /dev/null 2>&1 ||
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki touch $TMPDIR/bringover_failed
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki staffer bringovercheck $CODEMGR_WS >$TMPDIR/bringovercheck.out 2>&1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -s $TMPDIR/bringovercheck.out ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== POST-BRINGOVER CLEANUP NOISE ====\n"
2ea390f3bec3fff24e17f2bb5bf7457e44834af2Michael Bergknoff cat $TMPDIR/bringovercheck.out
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ) | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw if [ -f $TMPDIR/bringover_failed ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw rm -f $TMPDIR/bringover_failed
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw build_ok=n
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "trouble with bringover, quitting at `date`." |
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # Possible transition from pre-split workspace to split
2ea390f3bec3fff24e17f2bb5bf7457e44834af2Michael Bergknoff # workspace. See if the bringover changed anything.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki CLOSED_IS_PRESENT="$orig_closed_is_present"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki check_closed_tree
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkielse
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "\n==== No bringover to $CODEMGR_WS ====\n" >> $LOGFILE
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwfi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Build tools if requested
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$t_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export INTERNAL_RELEASE_BUILD ; INTERNAL_RELEASE_BUILD=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export RELEASE_BUILD ; RELEASE_BUILD=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki unset EXTRA_OPTIONS
2ea390f3bec3fff24e17f2bb5bf7457e44834af2Michael Bergknoff unset EXTRA_CFLAGS
aaba19e23c48a32e927f4e39464be188bfcbef37fw
aaba19e23c48a32e927f4e39464be188bfcbef37fw export ONBLD_TOOLS=${ONBLD_TOOLS:=${TOOLS_PROTO}/opt/onbld}
aaba19e23c48a32e927f4e39464be188bfcbef37fw build_tools ${TOOLS_PROTO}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwif [ "$i_FLAG" = "y" -a "$SH_FLAG" = "y" ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "\n==== NOT Building base OS-Net source ====\n" | \
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw tee -a $LOGFILE >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkielse
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki normal_build
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiORIG_SRC=$SRC
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiBINARCHIVE=${CODEMGR_WS}/bin-${MACH}.cpio.Z
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$SE_FLAG" = "y" -o "$SD_FLAG" = "y" -o "$SH_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki save_binaries
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Retrieving SCCS files at `date` ====\n" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki SCCSHELPER=${TMPDIR}/sccs-helper
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f ${SCCSHELPER}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkicat >${SCCSHELPER} <<EOF
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#!/bin/ksh
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwcd \$1
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwcd ..
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwsccs get SCCS >/dev/null 2>&1
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwEOF
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd $SRC
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki chmod +x ${SCCSHELPER}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki find $relsrcdirs -name SCCS | xargs -L 1 ${SCCSHELPER}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f ${SCCSHELPER}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$SD_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki clone_source ${CODEMGR_WS} ${CRYPT_SRC} CRYPT_SRC
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw# EXPORT_SRC comes after CRYPT_SRC since a domestic build will need
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw# $SRC pointing to the export_source usr/src.
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwif [ "$SE_FLAG" = "y" -o "$SD_FLAG" = "y" -o "$SH_FLAG" = "y" ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw clone_source ${CODEMGR_WS} ${EXPORT_SRC} EXPORT_SRC
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$SD_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # drop the crypt files in place.
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer cd ${EXPORT_SRC}
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer echo "\nextracting crypt_files.cpio.Z onto export_source.\n" \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer >> ${LOGFILE}
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer zcat ${CODEMGR_WS}/crypt_files.cpio.Z | \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer cpio -idmucvB 2>/dev/null >> ${LOGFILE}
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer if [ "$?" = "0" ]; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer echo "\n==== DOMESTIC extraction succeeded ====\n" \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer >> $mail_msg_file
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer else
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer echo "\n==== DOMESTIC extraction failed ====\n" \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer >> $mail_msg_file
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer fi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyerfi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyerif [ "$SE_FLAG" = "y" -o "$SD_FLAG" = "y" -o "$SH_FLAG" = "y" ]; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # remove proto area here, since we don't clobber
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer rm -rf "$ROOT"
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer if [ "$t_FLAG" = "y" ]; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer export INTERNAL_RELEASE_BUILD ; INTERNAL_RELEASE_BUILD=
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer export RELEASE_BUILD ; RELEASE_BUILD=
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer unset EXTRA_OPTIONS
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer unset EXTRA_CFLAGS
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer ORIG_TOOLS=$TOOLS
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer TOOLS=${EXPORT_SRC}/usr/src/tools
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer build_tools ${EXPORT_SRC}/usr/src/tools/proto
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer TOOLS=$ORIG_TOOLS
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer fi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer export EXPORT_RELEASE_BUILD ; EXPORT_RELEASE_BUILD=#
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer normal_build
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyerfi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyerif [ "$build_ok" = "y" ]; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer echo "\n==== Creating protolist system file at `date` ====" \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer >> $LOGFILE
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer protolist $ROOT > $ATLOG/proto_list_${MACH}
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer echo "==== protolist system file created at `date` ====\n" \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer >> $LOGFILE
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer if [ "$N_FLAG" != "y" ]; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer echo "\n==== Impact on packages ====\n" >> $mail_msg_file
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # If there is a reference proto list, compare the build's proto
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # list with the reference to see changes in proto areas.
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # Use the current exception list.
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer exc=etc/exception_list_$MACH
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer if [ -f $SRC/pkgdefs/$exc ]; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer ELIST="-e $SRC/pkgdefs/$exc"
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer fi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer if [ -f "$REF_PROTO_LIST" ]; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer $PROTOCMPTERSE \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer "Files in yesterday's proto area, but not today's:" \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer "Files in today's proto area, but not yesterday's:" \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer "Files that changed between yesterday and today:" \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer ${ELIST} \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer -d $REF_PROTO_LIST \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer $ATLOG/proto_list_${MACH} \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer >> $mail_msg_file
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer fi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # Compare the build's proto list with current package
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # definitions to audit the quality of package definitions
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # and makefile install targets. Use the current exception list.
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer PKGDEFS_LIST=""
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer for d in $abssrcdirs; do
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer if [ -d $d/pkgdefs ]; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer PKGDEFS_LIST="$PKGDEFS_LIST -d $d/pkgdefs"
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer fi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer done
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer $PROTOCMPTERSE \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer "Files missing from the proto area:" \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer "Files missing from packages:" \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer "Inconsistencies between pkgdefs and proto area:" \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer ${ELIST} \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer ${PKGDEFS_LIST} \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer $ATLOG/proto_list_${MACH} \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer >> $mail_msg_file
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer fi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyerfi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyerif [ "$u_FLAG" = "y" -a "$build_ok" = "y" ]; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer staffer cp $ATLOG/proto_list_${MACH} \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer $PARENT_WS/usr/src/proto_list_${MACH}
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyerfi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer# Update parent proto area if necessary. This is done now
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer# so that the proto area has either DEBUG or non-DEBUG kernels.
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer# Note that this clears out the lock file, so we can dispense with
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer# the variable now.
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyerif [ "$U_FLAG" = "y" -a "$build_ok" = "y" ]; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer echo "\n==== Copying proto area to $NIGHTLY_PARENT_ROOT ====\n" | \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer tee -a $LOGFILE >> $mail_msg_file
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # The rm -rf command below produces predictable errors if
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # nightly is invoked from the parent's $ROOT/opt/onbld/bin,
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # and that directory is accessed via NFS. This is because
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # deleted-but-still-open files don't actually disappear as
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # expected, but rather turn into .nfsXXXX junk files, leaving
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # the directory non-empty. Since this is a not-unusual usage
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # pattern, and we still want to catch other errors here, we
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # take the unusal step of moving aside 'nightly' from that
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # directory (if we're using it).
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer mypath=${0##*/root_$MACH/}
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer if [ "$mypath" = $0 ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mypath=opt/onbld/bin/${0##*/}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ $0 -ef $PARENT_WS/proto/root_$MACH/$mypath ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mv -f $0 $PARENT_WS/proto/root_$MACH
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -rf $PARENT_WS/proto/root_$MACH/*
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki unset Ulockfile
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mkdir -p $NIGHTLY_PARENT_ROOT
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd $ROOT
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ( tar cf - . | ( cd $NIGHTLY_PARENT_ROOT; umask 0; tar xpf - ) ) 2>&1 |
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# do shared library interface verification
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$A_FLAG" = "y" -a "$build_ok" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Check versioning and ABI information ====\n" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $LOGFILE >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -rf $SRC/interfaces.ref
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -d $SRC/interfaces.out ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mv $SRC/interfaces.out $SRC/interfaces.ref
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -rf $SRC/interfaces.out
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mkdir -p $SRC/interfaces.out
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki intf_check -V -m -o -b $SRC/tools/abi/etc \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -d $SRC/interfaces.out $ROOT 2>&1 | sort \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki > $SRC/interfaces.out/log
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # report any ERROR found in log file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fgrep 'ERROR' $SRC/interfaces.out/log | sed 's/^ERROR: //' | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $LOGFILE >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ ! -d $SRC/interfaces.ref ] ; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mkdir -p $SRC/interfaces.ref
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -d $SRC/interfaces.out ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cp -r $SRC/interfaces.out/* $SRC/interfaces.ref
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Diff versioning warnings (since last build) ====\n" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $LOGFILE >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki out_vers=`grep ^VERSION $SRC/interfaces.out/log`;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ref_vers=`grep ^VERSION $SRC/interfaces.ref/log`;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # Report any differences in WARNING messages between last
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # and current build.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$out_vers" = "$ref_vers" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki diff $SRC/interfaces.ref/log $SRC/interfaces.out/log | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fgrep 'WARNING' | sed 's/WARNING: //' | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $LOGFILE >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$r_FLAG" = "y" -a "$build_ok" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Check ELF runtime attributes ====\n" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $LOGFILE >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki LDDUSAGE="^ldd: does not support -e"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki LDDWRONG="wrong class"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki CRLERROR="^crle:"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki CRLECONF="^crle: configuration file:"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f $SRC/runtime.ref
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -f $SRC/runtime.out ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep -v "$LDDUSAGE|$LDDWRONG|$CRLERROR|$CRLECONF" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki $SRC/runtime.out > $SRC/runtime.ref
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # If we're doing a debug build the proto area will be left with
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # debuggable objects, thus don't assert -s.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$D_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rtime_sflag=""
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rtime_sflag="-s"
fi
check_rtime -d $ROOT -i -m -o $rtime_sflag $ROOT 2>&1 | \
egrep -v ": unreferenced object=$ROOT/.*/lib(w|intl|thread|pthread).so" | \
egrep -v ": unused object=$ROOT/.*/lib(w|intl|thread|pthread).so" | \
sort >$SRC/runtime.out
# Determine any processing errors that will affect the final output
# and display these first.
grep -l "$LDDUSAGE" $SRC/runtime.out > /dev/null
if [ $? -eq 0 ]; then
echo "WARNING: ldd(1) does not support -e. The version of ldd(1)" | \
tee -a $LOGFILE >> $mail_msg_file
echo "on your system is old - 4390308 (s81_30) is required.\n" | \
tee -a $LOGFILE >> $mail_msg_file
fi
grep -l "$LDDWRONG" $SRC/runtime.out > /dev/null
if [ $? -eq 0 ]; then
echo "WARNING: wrong class message detected. ldd(1) was unable" | \
tee -a $LOGFILE >> $mail_msg_file
echo "to execute an object, thus it could not be checked fully." | \
tee -a $LOGFILE >> $mail_msg_file
echo "Perhaps a 64-bit object was encountered on a 32-bit system," | \
tee -a $LOGFILE >> $mail_msg_file
echo "or an i386 object was encountered on a sparc system?\n" | \
tee -a $LOGFILE >> $mail_msg_file
fi
grep -l "$CRLECONF" $SRC/runtime.out > /dev/null
if [ $? -eq 0 ]; then
echo "WARNING: creation of an alternative dependency cache failed." | \
tee -a $LOGFILE >> $mail_msg_file
echo "Dependencies will bind to the base system libraries.\n" | \
tee -a $LOGFILE >> $mail_msg_file
grep "$CRLECONF" $SRC/runtime.out | \
tee -a $LOGFILE >> $mail_msg_file
grep "$CRLERROR" $SRC/runtime.out | grep -v "$CRLECONF" | \
tee -a $LOGFILE >> $mail_msg_file
echo "\n" | tee -a $LOGFILE >> $mail_msg_file
fi
egrep '<dependency no longer necessary>' $SRC/runtime.out | \
tee -a $LOGFILE >> $mail_msg_file
# NEEDED= and RPATH= are informational; report anything else that we
# haven't already.
egrep -v "NEEDED=|RPATH=|$LDDUSAGE|$LDDWRONG|$CRLERROR|$CRLECONF" \
$SRC/runtime.out | tee -a $LOGFILE >> $mail_msg_file
# probably should compare against a 'known ok runpaths' list
if [ ! -f $SRC/runtime.ref ]; then
egrep -v "$LDDUSAGE|$LDDWRONG|$CRLERROR|$CRLECONF" \
$SRC/runtime.out > $SRC/runtime.ref
fi
echo "\n==== Diff ELF runtime attributes (since last build) ====\n" \
>> $mail_msg_file
egrep -v "$LDDUSAGE|$LDDWRONG|$CRLERROR|$CRLECONF" $SRC/runtime.out | \
diff $SRC/runtime.ref - >> $mail_msg_file
fi
# DEBUG lint of kernel begins
if [ "$i_CMD_LINE_FLAG" = "n" -a "$l_FLAG" = "y" ]; then
if [ "$LINTDIRS" = "" ]; then
# LINTDIRS="$SRC/uts y $SRC/stand y $SRC/psm y"
LINTDIRS="$SRC y"
fi
set $LINTDIRS
while [ $# -gt 0 ]; do
dolint $1 $2; shift; shift
done
else
echo "\n==== No '$MAKE lint' ====\n" >> $LOGFILE
fi
# "make check" begins
if [ "$i_CMD_LINE_FLAG" = "n" -a "$C_FLAG" = "y" ]; then
# remove old check.out
rm -f $SRC/check.out
rm -f $SRC/check-${MACH}.out
cd $SRC
$MAKE -ek check 2>&1 | tee -a $SRC/check-${MACH}.out >> $LOGFILE
echo "\n==== cstyle/hdrchk errors ====\n" >> $mail_msg_file
grep ":" $SRC/check-${MACH}.out |
egrep -v "Ignoring unknown host" | \
sort | uniq >> $mail_msg_file
else
echo "\n==== No '$MAKE check' ====\n" >> $LOGFILE
fi
echo "\n==== Find core files ====\n" | \
tee -a $LOGFILE >> $mail_msg_file
find $abssrcdirs -name core -a -type f -exec file {} \; | \
tee -a $LOGFILE >> $mail_msg_file
if [ "$f_FLAG" = "y" -a "$build_ok" = "y" ]; then
echo "\n==== Diff unreferenced files (since last build) ====\n" \
| tee -a $LOGFILE >>$mail_msg_file
rm -f $SRC/unref-${MACH}.ref
if [ -f $SRC/unref-${MACH}.out ]; then
mv $SRC/unref-${MACH}.out $SRC/unref-${MACH}.ref
fi
findunref -t $SRC/.build.tstamp $SRC/.. \
${TOOLS}/findunref/exception_list \
2>> $mail_msg_file | sort | \
sed -e s=^./src/=./= -e s=^./closed/=../closed/= \
> $SRC/unref-${MACH}.out
if [ ! -f $SRC/unref-${MACH}.ref ]; then
cp $SRC/unref-${MACH}.out $SRC/unref-${MACH}.ref
fi
diff $SRC/unref-${MACH}.ref $SRC/unref-${MACH}.out >>$mail_msg_file
fi
# Verify that the usual lists of files, such as exception lists,
# contain only valid references to files. If the build has failed,
# then don't check the proto area.
CHECK_PATHS=${CHECK_PATHS:-y}
if [ "$CHECK_PATHS" = y -a "$N_FLAG" != y ]; then
echo "\n==== Check lists of files ====\n" | tee -a $LOGFILE \
>>$mail_msg_file
arg=-b
[ "$build_ok" = y ] && arg=
checkpaths $arg $ROOT 2>&1 | tee -a $LOGFILE >>$mail_msg_file
fi
if [ "$M_FLAG" != "y" -a "$build_ok" = y ]; then
echo "\n==== Impact on file permissions ====\n" \
>> $mail_msg_file
#
# Get pkginfo files from usr/src/pkgdefs
#
pmodes -qvdP \
`for d in $abssrcdirs; do
if [ -d "$d/pkgdefs" ]
then
find $d/pkgdefs -name pkginfo.tmpl -print -o -name .del\* -prune
fi
done | sed -e 's:/pkginfo.tmpl$::' | sort -u ` >> $mail_msg_file
fi
END_DATE=`date`
echo "==== Nightly $maketype build completed: $END_DATE ====" | \
tee -a $LOGFILE >> $build_time_file
typeset -Z2 minutes
typeset -Z2 seconds
elapsed_time=$SECONDS
((hours = elapsed_time / 3600 ))
((minutes = elapsed_time / 60 % 60))
((seconds = elapsed_time % 60))
echo "\n==== Total build time ====" | \
tee -a $LOGFILE >> $build_time_file
echo "\nreal ${hours}:${minutes}:${seconds}" | \
tee -a $LOGFILE >> $build_time_file
if [ "$u_FLAG" = "y" -a "$f_FLAG" = "y" -a "$build_ok" = "y" ]; then
staffer cp ${SRC}/unref-${MACH}.out $PARENT_WS/usr/src/
#
# Produce a master list of unreferenced files -- ideally, we'd
# generate the master just once after all of the nightlies
# have finished, but there's no simple way to know when that
# will be. Instead, we assume that we're the last nightly to
# finish and merge all of the unref-${MACH}.out files in
# $PARENT_WS/usr/src/. If we are in fact the final ${MACH} to
# finish, then this file will be the authoritative master
# list. Otherwise, another ${MACH}'s nightly will eventually
# overwrite ours with its own master, but in the meantime our
# temporary "master" will be no worse than any older master
# which was already on the parent.
#
set -- $PARENT_WS/usr/src/unref-*.out
cp "$1" ${TMPDIR}/unref.merge
shift
for unreffile; do
comm -12 ${TMPDIR}/unref.merge "$unreffile" > ${TMPDIR}/unref.$$
mv ${TMPDIR}/unref.$$ ${TMPDIR}/unref.merge
done
staffer cp ${TMPDIR}/unref.merge $PARENT_WS/usr/src/unrefmaster.out
fi
#
# All done save for the sweeping up.
# (whichever exit we hit here will trigger the "cleanup" trap which
# optionally sends mail on completion).
#
if [ "$build_ok" = "y" ]; then
exit 0
fi
exit 1