Merge
This commit is contained in:
commit
f477129597
@ -735,4 +735,20 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_MISC],
|
|||||||
[COMPILER_SUPPORTS_TARGET_BITS_FLAG=true],
|
[COMPILER_SUPPORTS_TARGET_BITS_FLAG=true],
|
||||||
[COMPILER_SUPPORTS_TARGET_BITS_FLAG=false])
|
[COMPILER_SUPPORTS_TARGET_BITS_FLAG=false])
|
||||||
AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG)
|
AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG)
|
||||||
|
|
||||||
|
case "${TOOLCHAIN_TYPE}" in
|
||||||
|
microsoft)
|
||||||
|
CFLAGS_WARNINGS_ARE_ERRORS="/WX"
|
||||||
|
;;
|
||||||
|
solstudio)
|
||||||
|
CFLAGS_WARNINGS_ARE_ERRORS="-errtags -errwarn=%all"
|
||||||
|
;;
|
||||||
|
gcc)
|
||||||
|
CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
|
||||||
|
;;
|
||||||
|
clang)
|
||||||
|
CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
AC_SUBST(CFLAGS_WARNINGS_ARE_ERRORS)
|
||||||
])
|
])
|
||||||
|
@ -673,6 +673,7 @@ XMKMF
|
|||||||
FIXPATH
|
FIXPATH
|
||||||
ZIP_DEBUGINFO_FILES
|
ZIP_DEBUGINFO_FILES
|
||||||
ENABLE_DEBUG_SYMBOLS
|
ENABLE_DEBUG_SYMBOLS
|
||||||
|
CFLAGS_WARNINGS_ARE_ERRORS
|
||||||
COMPILER_SUPPORTS_TARGET_BITS_FLAG
|
COMPILER_SUPPORTS_TARGET_BITS_FLAG
|
||||||
ZERO_ARCHFLAG
|
ZERO_ARCHFLAG
|
||||||
LDFLAGS_CXX_JDK
|
LDFLAGS_CXX_JDK
|
||||||
@ -1860,8 +1861,8 @@ Optional Packages:
|
|||||||
--with-jvm-variants JVM variants (separated by commas) to build (server,
|
--with-jvm-variants JVM variants (separated by commas) to build (server,
|
||||||
client, minimal1, kernel, zero, zeroshark, core)
|
client, minimal1, kernel, zero, zeroshark, core)
|
||||||
[server]
|
[server]
|
||||||
--with-debug-level set the debug level (release, fastdebug, slowdebug)
|
--with-debug-level set the debug level (release, fastdebug, slowdebug,
|
||||||
[release]
|
optimized (HotSpot build only)) [release]
|
||||||
--with-conf-name use this as the name of the configuration [generated
|
--with-conf-name use this as the name of the configuration [generated
|
||||||
from important configuration options]
|
from important configuration options]
|
||||||
--with-builddeps-conf use this configuration file for the builddeps
|
--with-builddeps-conf use this configuration file for the builddeps
|
||||||
@ -4232,7 +4233,7 @@ TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++"
|
|||||||
#CUSTOM_AUTOCONF_INCLUDE
|
#CUSTOM_AUTOCONF_INCLUDE
|
||||||
|
|
||||||
# Do not change or remove the following line, it is needed for consistency checks:
|
# Do not change or remove the following line, it is needed for consistency checks:
|
||||||
DATE_WHEN_GENERATED=1394794899
|
DATE_WHEN_GENERATED=1395652496
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
@ -14647,6 +14648,7 @@ $as_echo "$with_jvm_variants" >&6; }
|
|||||||
#
|
#
|
||||||
# Set the debug level
|
# Set the debug level
|
||||||
# release: no debug information, all optimizations, no asserts.
|
# release: no debug information, all optimizations, no asserts.
|
||||||
|
# optimized: no debug information, all optimizations, no asserts, HotSpot target is 'optimized'.
|
||||||
# fastdebug: debug information (-g), all optimizations, all asserts
|
# fastdebug: debug information (-g), all optimizations, all asserts
|
||||||
# slowdebug: debug information (-g), no optimizations, all asserts
|
# slowdebug: debug information (-g), no optimizations, all asserts
|
||||||
#
|
#
|
||||||
@ -14679,6 +14681,7 @@ fi
|
|||||||
$as_echo "$DEBUG_LEVEL" >&6; }
|
$as_echo "$DEBUG_LEVEL" >&6; }
|
||||||
|
|
||||||
if test "x$DEBUG_LEVEL" != xrelease && \
|
if test "x$DEBUG_LEVEL" != xrelease && \
|
||||||
|
test "x$DEBUG_LEVEL" != xoptimized && \
|
||||||
test "x$DEBUG_LEVEL" != xfastdebug && \
|
test "x$DEBUG_LEVEL" != xfastdebug && \
|
||||||
test "x$DEBUG_LEVEL" != xslowdebug; then
|
test "x$DEBUG_LEVEL" != xslowdebug; then
|
||||||
as_fn_error $? "Allowed debug levels are: release, fastdebug and slowdebug" "$LINENO" 5
|
as_fn_error $? "Allowed debug levels are: release, fastdebug and slowdebug" "$LINENO" 5
|
||||||
@ -14715,8 +14718,30 @@ $as_echo "$DEBUG_LEVEL" >&6; }
|
|||||||
HOTSPOT_DEBUG_LEVEL="jvmg"
|
HOTSPOT_DEBUG_LEVEL="jvmg"
|
||||||
HOTSPOT_EXPORT="debug"
|
HOTSPOT_EXPORT="debug"
|
||||||
;;
|
;;
|
||||||
|
optimized )
|
||||||
|
VARIANT="OPT"
|
||||||
|
FASTDEBUG="false"
|
||||||
|
DEBUG_CLASSFILES="false"
|
||||||
|
BUILD_VARIANT_RELEASE="-optimized"
|
||||||
|
HOTSPOT_DEBUG_LEVEL="optimized"
|
||||||
|
HOTSPOT_EXPORT="optimized"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# The debug level 'optimized' is a little special because it is currently only
|
||||||
|
# applicable to the HotSpot build where it means to build a completely
|
||||||
|
# optimized version of the VM without any debugging code (like for the
|
||||||
|
# 'release' debug level which is called 'product' in the HotSpot build) but
|
||||||
|
# with the exception that it can contain additional code which is otherwise
|
||||||
|
# protected by '#ifndef PRODUCT' macros. These 'optimized' builds are used to
|
||||||
|
# test new and/or experimental features which are not intended for customer
|
||||||
|
# shipment. Because these new features need to be tested and benchmarked in
|
||||||
|
# real world scenarios, we want to build the containing JDK at the 'release'
|
||||||
|
# debug level.
|
||||||
|
if test "x$DEBUG_LEVEL" = xoptimized; then
|
||||||
|
DEBUG_LEVEL="release"
|
||||||
|
fi
|
||||||
|
|
||||||
#####
|
#####
|
||||||
# Generate the legacy makefile targets for hotspot.
|
# Generate the legacy makefile targets for hotspot.
|
||||||
# The hotspot api for selecting the build artifacts, really, needs to be improved.
|
# The hotspot api for selecting the build artifacts, really, needs to be improved.
|
||||||
@ -41989,6 +42014,22 @@ $as_echo "$supports" >&6; }
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
case "${TOOLCHAIN_TYPE}" in
|
||||||
|
microsoft)
|
||||||
|
CFLAGS_WARNINGS_ARE_ERRORS="/WX"
|
||||||
|
;;
|
||||||
|
solstudio)
|
||||||
|
CFLAGS_WARNINGS_ARE_ERRORS="-errtags -errwarn=%all"
|
||||||
|
;;
|
||||||
|
gcc)
|
||||||
|
CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
|
||||||
|
;;
|
||||||
|
clang)
|
||||||
|
CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Setup debug symbols (need objcopy from the toolchain for that)
|
# Setup debug symbols (need objcopy from the toolchain for that)
|
||||||
|
|
||||||
@ -50203,6 +50244,7 @@ $CHMOD +x $OUTPUT_ROOT/compare.sh
|
|||||||
printf "\n"
|
printf "\n"
|
||||||
printf "Configuration summary:\n"
|
printf "Configuration summary:\n"
|
||||||
printf "* Debug level: $DEBUG_LEVEL\n"
|
printf "* Debug level: $DEBUG_LEVEL\n"
|
||||||
|
printf "* HS debug level: $HOTSPOT_DEBUG_LEVEL\n"
|
||||||
printf "* JDK variant: $JDK_VARIANT\n"
|
printf "* JDK variant: $JDK_VARIANT\n"
|
||||||
printf "* JVM variants: $with_jvm_variants\n"
|
printf "* JVM variants: $with_jvm_variants\n"
|
||||||
printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n"
|
printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n"
|
||||||
|
@ -200,6 +200,7 @@ AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS],
|
|||||||
printf "\n"
|
printf "\n"
|
||||||
printf "Configuration summary:\n"
|
printf "Configuration summary:\n"
|
||||||
printf "* Debug level: $DEBUG_LEVEL\n"
|
printf "* Debug level: $DEBUG_LEVEL\n"
|
||||||
|
printf "* HS debug level: $HOTSPOT_DEBUG_LEVEL\n"
|
||||||
printf "* JDK variant: $JDK_VARIANT\n"
|
printf "* JDK variant: $JDK_VARIANT\n"
|
||||||
printf "* JVM variants: $with_jvm_variants\n"
|
printf "* JVM variants: $with_jvm_variants\n"
|
||||||
printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n"
|
printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n"
|
||||||
|
@ -176,6 +176,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL],
|
|||||||
#
|
#
|
||||||
# Set the debug level
|
# Set the debug level
|
||||||
# release: no debug information, all optimizations, no asserts.
|
# release: no debug information, all optimizations, no asserts.
|
||||||
|
# optimized: no debug information, all optimizations, no asserts, HotSpot target is 'optimized'.
|
||||||
# fastdebug: debug information (-g), all optimizations, all asserts
|
# fastdebug: debug information (-g), all optimizations, all asserts
|
||||||
# slowdebug: debug information (-g), no optimizations, all asserts
|
# slowdebug: debug information (-g), no optimizations, all asserts
|
||||||
#
|
#
|
||||||
@ -189,7 +190,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL],
|
|||||||
], [ENABLE_DEBUG="no"])
|
], [ENABLE_DEBUG="no"])
|
||||||
|
|
||||||
AC_ARG_WITH([debug-level], [AS_HELP_STRING([--with-debug-level],
|
AC_ARG_WITH([debug-level], [AS_HELP_STRING([--with-debug-level],
|
||||||
[set the debug level (release, fastdebug, slowdebug) @<:@release@:>@])],
|
[set the debug level (release, fastdebug, slowdebug, optimized (HotSpot build only)) @<:@release@:>@])],
|
||||||
[
|
[
|
||||||
DEBUG_LEVEL="${withval}"
|
DEBUG_LEVEL="${withval}"
|
||||||
if test "x$ENABLE_DEBUG" = xyes; then
|
if test "x$ENABLE_DEBUG" = xyes; then
|
||||||
@ -199,6 +200,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL],
|
|||||||
AC_MSG_RESULT([$DEBUG_LEVEL])
|
AC_MSG_RESULT([$DEBUG_LEVEL])
|
||||||
|
|
||||||
if test "x$DEBUG_LEVEL" != xrelease && \
|
if test "x$DEBUG_LEVEL" != xrelease && \
|
||||||
|
test "x$DEBUG_LEVEL" != xoptimized && \
|
||||||
test "x$DEBUG_LEVEL" != xfastdebug && \
|
test "x$DEBUG_LEVEL" != xfastdebug && \
|
||||||
test "x$DEBUG_LEVEL" != xslowdebug; then
|
test "x$DEBUG_LEVEL" != xslowdebug; then
|
||||||
AC_MSG_ERROR([Allowed debug levels are: release, fastdebug and slowdebug])
|
AC_MSG_ERROR([Allowed debug levels are: release, fastdebug and slowdebug])
|
||||||
@ -235,8 +237,30 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL],
|
|||||||
HOTSPOT_DEBUG_LEVEL="jvmg"
|
HOTSPOT_DEBUG_LEVEL="jvmg"
|
||||||
HOTSPOT_EXPORT="debug"
|
HOTSPOT_EXPORT="debug"
|
||||||
;;
|
;;
|
||||||
|
optimized )
|
||||||
|
VARIANT="OPT"
|
||||||
|
FASTDEBUG="false"
|
||||||
|
DEBUG_CLASSFILES="false"
|
||||||
|
BUILD_VARIANT_RELEASE="-optimized"
|
||||||
|
HOTSPOT_DEBUG_LEVEL="optimized"
|
||||||
|
HOTSPOT_EXPORT="optimized"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# The debug level 'optimized' is a little special because it is currently only
|
||||||
|
# applicable to the HotSpot build where it means to build a completely
|
||||||
|
# optimized version of the VM without any debugging code (like for the
|
||||||
|
# 'release' debug level which is called 'product' in the HotSpot build) but
|
||||||
|
# with the exception that it can contain additional code which is otherwise
|
||||||
|
# protected by '#ifndef PRODUCT' macros. These 'optimized' builds are used to
|
||||||
|
# test new and/or experimental features which are not intended for customer
|
||||||
|
# shipment. Because these new features need to be tested and benchmarked in
|
||||||
|
# real world scenarios, we want to build the containing JDK at the 'release'
|
||||||
|
# debug level.
|
||||||
|
if test "x$DEBUG_LEVEL" = xoptimized; then
|
||||||
|
DEBUG_LEVEL="release"
|
||||||
|
fi
|
||||||
|
|
||||||
#####
|
#####
|
||||||
# Generate the legacy makefile targets for hotspot.
|
# Generate the legacy makefile targets for hotspot.
|
||||||
# The hotspot api for selecting the build artifacts, really, needs to be improved.
|
# The hotspot api for selecting the build artifacts, really, needs to be improved.
|
||||||
|
@ -324,6 +324,8 @@ CXX_O_FLAG_NONE:=@CXX_O_FLAG_NONE@
|
|||||||
C_FLAG_DEPS:=@C_FLAG_DEPS@
|
C_FLAG_DEPS:=@C_FLAG_DEPS@
|
||||||
CXX_FLAG_DEPS:=@CXX_FLAG_DEPS@
|
CXX_FLAG_DEPS:=@CXX_FLAG_DEPS@
|
||||||
|
|
||||||
|
CFLAGS_WARNINGS_ARE_ERRORS:=@CFLAGS_WARNINGS_ARE_ERRORS@
|
||||||
|
|
||||||
# Tools that potentially need to be cross compilation aware.
|
# Tools that potentially need to be cross compilation aware.
|
||||||
CC:=@FIXPATH@ @CCACHE@ @CC@
|
CC:=@FIXPATH@ @CCACHE@ @CC@
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||||
@ -24,12 +24,53 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
# Shell script for a fast parallel forest command
|
# Shell script for a fast parallel forest command
|
||||||
command="$1"
|
|
||||||
pull_extra_base="$2"
|
|
||||||
|
|
||||||
if [ "" = "$command" ] ; then
|
global_opts=""
|
||||||
echo No command to hg supplied!
|
status_output="/dev/stdout"
|
||||||
|
qflag="false"
|
||||||
|
vflag="false"
|
||||||
|
while [ $# -gt 0 ]
|
||||||
|
do
|
||||||
|
case $1 in
|
||||||
|
-q | --quiet )
|
||||||
|
qflag="true"
|
||||||
|
global_opts="${global_opts} -q"
|
||||||
|
status_output="/dev/null"
|
||||||
|
;;
|
||||||
|
|
||||||
|
-v | --verbose )
|
||||||
|
vflag="true"
|
||||||
|
global_opts="${global_opts} -v"
|
||||||
|
;;
|
||||||
|
|
||||||
|
'--' ) # no more options
|
||||||
|
shift; break
|
||||||
|
;;
|
||||||
|
|
||||||
|
-*) # bad option
|
||||||
|
usage
|
||||||
|
;;
|
||||||
|
|
||||||
|
* ) # non option
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
command="$1"; shift
|
||||||
|
repo_base="$@"
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
echo "usage: $0 [-q|--quiet] [-v|--verbose] [--] <command> [repo_base_path]" > ${status_output}
|
||||||
exit 1
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if [ "x" = "x$command" ] ; then
|
||||||
|
echo "ERROR: No command to hg supplied!"
|
||||||
|
usage
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Clean out the temporary directory that stores the pid files.
|
# Clean out the temporary directory that stores the pid files.
|
||||||
@ -40,17 +81,17 @@ mkdir -p ${tmp}
|
|||||||
safe_interrupt () {
|
safe_interrupt () {
|
||||||
if [ -d ${tmp} ]; then
|
if [ -d ${tmp} ]; then
|
||||||
if [ "`ls ${tmp}/*.pid`" != "" ]; then
|
if [ "`ls ${tmp}/*.pid`" != "" ]; then
|
||||||
echo "Waiting for processes ( `cat ${tmp}/*.pid | tr '\n' ' '`) to terminate nicely!"
|
echo "Waiting for processes ( `cat ${tmp}/*.pid | tr '\n' ' '`) to terminate nicely!" > ${status_output}
|
||||||
sleep 1
|
sleep 1
|
||||||
# Pipe stderr to dev/null to silence kill, that complains when trying to kill
|
# Pipe stderr to dev/null to silence kill, that complains when trying to kill
|
||||||
# a subprocess that has already exited.
|
# a subprocess that has already exited.
|
||||||
kill -TERM `cat ${tmp}/*.pid | tr '\n' ' '` 2> /dev/null
|
kill -TERM `cat ${tmp}/*.pid | tr '\n' ' '` 2> /dev/null
|
||||||
wait
|
wait
|
||||||
echo Interrupt complete!
|
echo "Interrupt complete!" > ${status_output}
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
rm -f -r ${tmp}
|
rm -f -r ${tmp}
|
||||||
exit 1
|
fi
|
||||||
|
exit 130
|
||||||
}
|
}
|
||||||
|
|
||||||
nice_exit () {
|
nice_exit () {
|
||||||
@ -58,28 +99,30 @@ nice_exit () {
|
|||||||
if [ "`ls ${tmp}`" != "" ]; then
|
if [ "`ls ${tmp}`" != "" ]; then
|
||||||
wait
|
wait
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
rm -f -r ${tmp}
|
rm -f -r ${tmp}
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
trap 'safe_interrupt' INT QUIT
|
trap 'safe_interrupt' INT QUIT
|
||||||
trap 'nice_exit' EXIT
|
trap 'nice_exit' EXIT
|
||||||
|
|
||||||
|
subrepos="corba jaxp jaxws langtools jdk hotspot nashorn"
|
||||||
|
subrepos_extra="closed jdk/src/closed jdk/make/closed jdk/test/closed hotspot/make/closed hotspot/src/closed hotspot/test/closed deploy install sponsors pubs"
|
||||||
|
|
||||||
# Only look in specific locations for possible forests (avoids long searches)
|
# Only look in specific locations for possible forests (avoids long searches)
|
||||||
pull_default=""
|
pull_default=""
|
||||||
repos=""
|
repos=""
|
||||||
repos_extra=""
|
repos_extra=""
|
||||||
if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then
|
if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then
|
||||||
subrepos="corba jaxp jaxws langtools jdk hotspot nashorn"
|
|
||||||
if [ -f .hg/hgrc ] ; then
|
if [ -f .hg/hgrc ] ; then
|
||||||
pull_default=`hg paths default`
|
pull_default=`hg paths default`
|
||||||
if [ "${pull_default}" = "" ] ; then
|
if [ "${pull_default}" = "" ] ; then
|
||||||
echo "ERROR: Need initial clone with 'hg paths default' defined"
|
echo "ERROR: Need initial clone with 'hg paths default' defined" > ${status_output}
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ "${pull_default}" = "" ] ; then
|
if [ "${pull_default}" = "" ] ; then
|
||||||
echo "ERROR: Need initial repository to use this script"
|
echo "ERROR: Need initial repository to use this script" > ${status_output}
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
for i in ${subrepos} ; do
|
for i in ${subrepos} ; do
|
||||||
@ -87,10 +130,9 @@ if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then
|
|||||||
repos="${repos} ${i}"
|
repos="${repos} ${i}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [ "${pull_extra_base}" != "" ] ; then
|
if [ "${repo_base}" != "" ] ; then
|
||||||
subrepos_extra="closed jdk/src/closed jdk/make/closed jdk/test/closed hotspot/make/closed hotspot/src/closed hotspot/test/closed deploy install sponsors pubs"
|
|
||||||
pull_default_tail=`echo ${pull_default} | sed -e 's@^.*://[^/]*/\(.*\)@\1@'`
|
pull_default_tail=`echo ${pull_default} | sed -e 's@^.*://[^/]*/\(.*\)@\1@'`
|
||||||
pull_extra="${pull_extra_base}/${pull_default_tail}"
|
pull_extra="${repo_base}/${pull_default_tail}"
|
||||||
for i in ${subrepos_extra} ; do
|
for i in ${subrepos_extra} ; do
|
||||||
if [ ! -f ${i}/.hg/hgrc ] ; then
|
if [ ! -f ${i}/.hg/hgrc ] ; then
|
||||||
repos_extra="${repos_extra} ${i}"
|
repos_extra="${repos_extra} ${i}"
|
||||||
@ -100,35 +142,64 @@ if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then
|
|||||||
at_a_time=2
|
at_a_time=2
|
||||||
# Any repos to deal with?
|
# Any repos to deal with?
|
||||||
if [ "${repos}" = "" -a "${repos_extra}" = "" ] ; then
|
if [ "${repos}" = "" -a "${repos_extra}" = "" ] ; then
|
||||||
|
echo "No repositories to process." > ${status_output}
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
hgdirs=`ls -d ./.hg ./*/.hg ./*/*/.hg ./*/*/*/.hg ./*/*/*/*/.hg 2>/dev/null`
|
for i in . ${subrepos} ${subrepos_extra} ; do
|
||||||
# Derive repository names from the .hg directory locations
|
if [ -d ${i}/.hg ] ; then
|
||||||
for i in ${hgdirs} ; do
|
repos="${repos} ${i}"
|
||||||
repos="${repos} `echo ${i} | sed -e 's@/.hg$@@'`"
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Any repos to deal with?
|
||||||
|
if [ "${repos}" = "" ] ; then
|
||||||
|
echo "No repositories to process." > ${status_output}
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# any of the repos locked?
|
||||||
for i in ${repos} ; do
|
for i in ${repos} ; do
|
||||||
if [ -h ${i}/.hg/store/lock -o -f ${i}/.hg/store/lock ] ; then
|
if [ -h ${i}/.hg/store/lock -o -f ${i}/.hg/store/lock ] ; then
|
||||||
locked="${i} ${locked}"
|
locked="${i} ${locked}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
at_a_time=8
|
|
||||||
# Any repos to deal with?
|
|
||||||
if [ "${repos}" = "" ] ; then
|
|
||||||
echo "No repositories to process."
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
if [ "${locked}" != "" ] ; then
|
if [ "${locked}" != "" ] ; then
|
||||||
echo "These repositories are locked: ${locked}"
|
echo "ERROR: These repositories are locked: ${locked}" > ${status_output}
|
||||||
exit
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
at_a_time=8
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Echo out what repositories we do a command on.
|
# Echo out what repositories we do a command on.
|
||||||
echo "# Repositories: ${repos} ${repos_extra}"
|
echo "# Repositories: ${repos} ${repos_extra}" > ${status_output}
|
||||||
echo
|
|
||||||
|
|
||||||
|
if [ "${command}" = "serve" ] ; then
|
||||||
|
# "serve" is run for all the repos.
|
||||||
|
(
|
||||||
|
(
|
||||||
|
(
|
||||||
|
echo "[web]"
|
||||||
|
echo "description = $(basename $(pwd))"
|
||||||
|
echo "allow_push = *"
|
||||||
|
echo "push_ssl = False"
|
||||||
|
|
||||||
|
echo "[paths]"
|
||||||
|
for i in ${repos} ${repos_extra} ; do
|
||||||
|
if [ "${i}" != "." ] ; then
|
||||||
|
echo "/$(basename $(pwd))/${i} = ${i}"
|
||||||
|
else
|
||||||
|
echo "/$(basename $(pwd)) = $(pwd)"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
) > ${tmp}/serve.web-conf
|
||||||
|
|
||||||
|
echo "serving root repo $(basename $(pwd))"
|
||||||
|
|
||||||
|
(PYTHONUNBUFFERED=true hg${global_opts} serve -A ${status_output} -E ${status_output} --pid-file ${tmp}/serve.pid --web-conf ${tmp}/serve.web-conf; echo "$?" > ${tmp}/serve.pid.rc ) 2>&1 &
|
||||||
|
) 2>&1 | sed -e "s@^@serve: @" > ${status_output}
|
||||||
|
) &
|
||||||
|
else
|
||||||
# Run the supplied command on all repos in parallel.
|
# Run the supplied command on all repos in parallel.
|
||||||
n=0
|
n=0
|
||||||
for i in ${repos} ${repos_extra} ; do
|
for i in ${repos} ${repos_extra} ; do
|
||||||
@ -145,7 +216,7 @@ for i in ${repos} ${repos_extra} ; do
|
|||||||
(
|
(
|
||||||
if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then
|
if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then
|
||||||
pull_newrepo="`echo ${pull_base}/${i} | sed -e 's@\([^:]/\)//*@\1@g'`"
|
pull_newrepo="`echo ${pull_base}/${i} | sed -e 's@\([^:]/\)//*@\1@g'`"
|
||||||
echo hg clone ${pull_newrepo} ${i}
|
echo "hg clone ${pull_newrepo} ${i}" > ${status_output}
|
||||||
path="`dirname ${i}`"
|
path="`dirname ${i}`"
|
||||||
if [ "${path}" != "." ] ; then
|
if [ "${path}" != "." ] ; then
|
||||||
times=0
|
times=0
|
||||||
@ -153,25 +224,29 @@ for i in ${repos} ${repos_extra} ; do
|
|||||||
do
|
do
|
||||||
times=`expr ${times} '+' 1`
|
times=`expr ${times} '+' 1`
|
||||||
if [ `expr ${times} '%' 10` -eq 0 ] ; then
|
if [ `expr ${times} '%' 10` -eq 0 ] ; then
|
||||||
echo ${path} still not created, waiting...
|
echo "${path} still not created, waiting..." > ${status_output}
|
||||||
fi
|
fi
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
(PYTHONUNBUFFERED=true hg clone ${pull_newrepo} ${i}; echo "$?" > ${tmp}/${repopidfile}.pid.rc )&
|
(PYTHONUNBUFFERED=true hg${global_opts} clone ${pull_newrepo} ${i}; echo "$?" > ${tmp}/${repopidfile}.pid.rc ) 2>&1 &
|
||||||
else
|
else
|
||||||
echo "cd ${i} && hg $*"
|
echo "cd ${i} && hg${global_opts} ${command} ${repo_base}" > ${status_output}
|
||||||
cd ${i} && (PYTHONUNBUFFERED=true hg "$@"; echo "$?" > ${tmp}/${repopidfile}.pid.rc )&
|
cd ${i} && (PYTHONUNBUFFERED=true hg${global_opts} ${command} ${command_repo}; echo "$?" > ${tmp}/${repopidfile}.pid.rc ) 2>&1 &
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo $! > ${tmp}/${repopidfile}.pid
|
echo $! > ${tmp}/${repopidfile}.pid
|
||||||
) 2>&1 | sed -e "s@^@${reponame}: @") &
|
) 2>&1 | sed -e "s@^@${reponame}: @" > ${status_output}
|
||||||
|
) &
|
||||||
|
|
||||||
if [ `expr ${n} '%' ${at_a_time}` -eq 0 ] ; then
|
if [ `expr ${n} '%' ${at_a_time}` -eq 0 ] ; then
|
||||||
sleep 2
|
sleep 2
|
||||||
echo Waiting 5 secs before spawning next background command.
|
echo "Waiting 5 secs before spawning next background command." > ${status_output}
|
||||||
sleep 3
|
sleep 3
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
# Wait for all hg commands to complete
|
# Wait for all hg commands to complete
|
||||||
wait
|
wait
|
||||||
|
|
||||||
@ -181,7 +256,8 @@ if [ -d ${tmp} ]; then
|
|||||||
for rc in ${tmp}/*.pid.rc ; do
|
for rc in ${tmp}/*.pid.rc ; do
|
||||||
exit_code=`cat ${rc} | tr -d ' \n\r'`
|
exit_code=`cat ${rc} | tr -d ' \n\r'`
|
||||||
if [ "${exit_code}" != "0" ] ; then
|
if [ "${exit_code}" != "0" ] ; then
|
||||||
echo "WARNING: ${rc} exited abnormally."
|
repo="`echo ${rc} | sed -e s@^${tmp}@@ -e 's@/*\([^/]*\)\.pid\.rc$@\1@' -e 's@_@/@g'`"
|
||||||
|
echo "WARNING: ${repo} exited abnormally." > ${status_output}
|
||||||
ec=1
|
ec=1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user