make_release_packages revision 1003
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes#! /bin/ksh93
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes#
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes# Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes#
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes# Permission is hereby granted, free of charge, to any person obtaining a
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes# copy of this software and associated documentation files (the "Software"),
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes# to deal in the Software without restriction, including without limitation
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes# the rights to use, copy, modify, merge, publish, distribute, sublicense,
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes# and/or sell copies of the Software, and to permit persons to whom the
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes# Software is furnished to do so, subject to the following conditions:
0662ed52e814f8f08ef0e09956413a792584eddffuankg#
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes# The above copyright notice and this permission notice (including the next
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes# paragraph) shall be included in all copies or substantial portions of the
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes# Software.
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes#
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholes# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholes# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
44f575c8cb19a7a5cd61664a7848be6bc197df02fuankg# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
44f575c8cb19a7a5cd61664a7848be6bc197df02fuankg# DEALINGS IN THE SOFTWARE.
16b55a35cff91315d261d1baa776138af465c4e4fuankg#
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes#
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes# Create and fill a package staging area for X
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes#
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes# This script should be run from the base of the build tree.
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes#
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes# Arguments:
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes# -v Enable verbose mode
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes# -p <publisher> Set publisher name in built repo to <publisher>
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes#
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes# Make sure that we aren't affected by the personal environment of
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes# whoever is running this script
cb2846ded4de1abbb5934b92132baf826f1babfebnicholesPATH=/usr/bin:/usr/ccs/bin:/opt/onbld/bin:${PATH}
cb2846ded4de1abbb5934b92132baf826f1babfebnicholesSHELL=/bin/ksh93
cb2846ded4de1abbb5934b92132baf826f1babfebnicholesexport PATH
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes
cb2846ded4de1abbb5934b92132baf826f1babfebnicholesprogname="$0"
cb2846ded4de1abbb5934b92132baf826f1babfebnicholesfunction fatal_error
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes{
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes print -u2 "${progname}: ERROR: $*"
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes exit 1
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes}
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes# Path to directory in build tree containing build tools
cb2846ded4de1abbb5934b92132baf826f1babfebnicholesBUILD_TOOLS="$(pwd)/open-src/util/build-tools/"
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes
cb2846ded4de1abbb5934b92132baf826f1babfebnicholesVERBOSE_FLAGS="" # verbosity flags passed to make
cb2846ded4de1abbb5934b92132baf826f1babfebnicholesPUBLISHER_FLAGS="" # publisher flags passed to make
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes
cb2846ded4de1abbb5934b92132baf826f1babfebnicholesset -- $(getopt p:v $*)
cb2846ded4de1abbb5934b92132baf826f1babfebnicholesif [ $? != 0 ] ; then
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes print -u2 USAGE: $0 [-v]
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes exit 2
cb2846ded4de1abbb5934b92132baf826f1babfebnicholesfi
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes
ac7985784d08a3655291f24f711812b4d8b1cbcffuankgfor i in $* ; do
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes case $i in
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes -p) PUBLISHER_FLAGS="PKGPUBLISHER=$2"; shift 2;;
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes -v) VERBOSE_FLAGS="-v"; shift;;
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes esac
cb2846ded4de1abbb5934b92132baf826f1babfebnicholesdone
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes[ -d log ] || mkdir log
cb2846ded4de1abbb5934b92132baf826f1babfebnicholesLOG="$(pwd)/log/make-pkgs"
cb2846ded4de1abbb5934b92132baf826f1babfebnicholesCHECK_LOG="$(pwd)/log/check-pkgs"
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes
cb2846ded4de1abbb5934b92132baf826f1babfebnicholesif [[ -z "${XNV_BUILDNUM}" ]] ; then
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes # Get build version from hg by searching for most recent tag matching nv_*
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg BUILD_TAG="$(hg log | \
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes perl -l -n -e 'if ($_ =~ m/^tag:\s+nv_(\d+)/) {print $1 ; exit}')"
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes if [[ -z "${BUILD_TAG}" ]] ; then
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes fatal_error "BUILD_TAG could not be found from hg_log"
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes fi
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes XNV_BUILDNUM="${BUILD_TAG}"
cb2846ded4de1abbb5934b92132baf826f1babfebnicholesfi
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes
cb2846ded4de1abbb5934b92132baf826f1babfebnicholesprint "Building packages for X Consolidation, Nevada build ${XNV_BUILDNUM}"
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes
cb2846ded4de1abbb5934b92132baf826f1babfebnicholesMACH="$(uname -p)"
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes# Remove old packages
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes/bin/rm -rf "proto/pkg_${MACH}"
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes
cb2846ded4de1abbb5934b92132baf826f1babfebnicholesXMAKE="${BUILD_TOOLS}/xmake ${VERBOSE_FLAGS} -k"
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes
cb2846ded4de1abbb5934b92132baf826f1babfebnicholescd pkg
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes${XMAKE} clean > "${LOG}" 2>&1
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes${XMAKE} install XNV_BUILDNUM="${XNV_BUILDNUM}" "${PUBLISHER_FLAGS}" > "${LOG}" 2>&1
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes${XMAKE} check XNV_BUILDNUM="${XNV_BUILDNUM}" > "${CHECK_LOG}" 2>&1
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg
cb2846ded4de1abbb5934b92132baf826f1babfebnicholesprint "Result log is in ${LOG}"
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg"${BUILD_TOOLS}/find-build-errors" -s "${LOG}"
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes"${BUILD_TOOLS}/find-build-errors" -s "${CHECK_LOG}"
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes
0a39e7683f6611d66c55712f50bb240428d832a1bnicholesexit 0
cb2846ded4de1abbb5934b92132baf826f1babfebnicholes