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