#
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
#
# Create and fill a package staging area for X
#
# This script should be run from the base of the build tree.
#
# Arguments:
# -v Enable verbose mode
# -p <publisher> Set publisher name in built repo to <publisher>
#
# Make sure that we aren't affected by the personal environment of
# whoever is running this script
export PATH
progname="$0"
function fatal_error
{
print -u2 "${progname}: ERROR: $*"
exit 1
}
# Path to directory in build tree containing build tools
set -- $(getopt p:v $*)
if [ $? != 0 ] ; then
exit 2
fi
for i in $* ; do
case $i in
-v) VERBOSE_FLAGS="-v"; shift;;
esac
done
# Get build version from hg by searching for most recent tag matching s11u*
if [[ -z "${BUILD_TAG}" ]] ; then
fatal_error "BUILD_TAG could not be found from hg parent"
fi
print "Building packages for X Consolidation, build ${BUILD_TAG}"
# Remove old packages
XMAKE="${BUILD_TOOLS}/xmake ${VERBOSE_FLAGS} -k"
cd pkg
print "Result log is in ${LOG}"
print "Checking built packages"
print "Package check log is in ${CHECK_LOG}"
"${BUILD_TOOLS}/find-build-errors" -s "${LOG}"
exit 0