diff --git a/.hgignore b/.hgignore index c398e60c0033..349b9404ebf9 100644 --- a/.hgignore +++ b/.hgignore @@ -35,6 +35,7 @@ compile_commands\.json ^\.clang-tidy ^\.mozconfig ^mozconfig* +^\.moz-fast-forward ^old-configure$ ^config\.cache$ ^config\.log$ diff --git a/dom/media/webrtc/third_party_build/use_config_env.sh b/dom/media/webrtc/third_party_build/use_config_env.sh index 90d950a6fe85..f05fca74a839 100644 --- a/dom/media/webrtc/third_party_build/use_config_env.sh +++ b/dom/media/webrtc/third_party_build/use_config_env.sh @@ -1,10 +1,28 @@ #!/bin/bash -SCRIPT_DIR="dom/media/webrtc/third_party_build" +# Assume that if STATE_DIR is already defined, we do not need to +# execute this file again. +if [ "x$STATE_DIR" != "x" ]; then + # no need to run script since we've already run + return +fi + +export SCRIPT_DIR="dom/media/webrtc/third_party_build" +# first, make sure we're running from the top of moz-central repo +if [ ! -d $SCRIPT_DIR ]; then + echo "Error: unable to find directory $SCRIPT_DIR" + exit 1 +fi + +# Should we tie the location of the STATE_DIR to the path +# in MOZ_CONFIG_PATH? Probably. +export STATE_DIR=`pwd`/.moz-fast-forward +export LOG_DIR=$STATE_DIR/logs +export TMP_DIR=$STATE_DIR/tmp # Allow user to override default path to config_env if [ "x$MOZ_CONFIG_PATH" = "x" ]; then - MOZ_CONFIG_PATH=~/config_env + MOZ_CONFIG_PATH=$STATE_DIR/config_env echo "Using default MOZ_CONFIG_PATH=$MOZ_CONFIG_PATH" fi @@ -19,6 +37,36 @@ if [ ! -f $MOZ_CONFIG_PATH ]; then fi source $MOZ_CONFIG_PATH +if [ ! -d $STATE_DIR ]; then + echo "Creating missing $STATE_DIR" + mkdir -p $STATE_DIR + if [ ! -d $STATE_DIR ]; then + echo "error: unable to find (or create) $STATE_DIR" + exit 1 + fi +fi +echo "Using STATE_DIR=$STATE_DIR" + +if [ ! -d $LOG_DIR ]; then + echo "Creating missing $LOG_DIR" + mkdir -p $LOG_DIR + if [ ! -d $LOG_DIR ]; then + echo "error: unable to find (or create) $LOG_DIR" + exit 1 + fi +fi +echo "Using LOG_DIR=$LOG_DIR" + +if [ ! -d $TMP_DIR ]; then + echo "Creating missing $TMP_DIR" + mkdir -p $TMP_DIR + if [ ! -d $TMP_DIR ]; then + echo "error: unable to find (or create) $TMP_DIR" + exit 1 + fi +fi +echo "Using TMP_DIR=$TMP_DIR" + function find_base_commit() { # read the last line of README.moz-ff-commit to retrieve our current base @@ -33,6 +81,7 @@ function find_base_commit() MOZ_LIBWEBRTC_BASE=`cd $MOZ_LIBWEBRTC_SRC ; git rev-parse --short $MOZ_LIBWEBRTC_BASE` echo "adjusted MOZ_LIBWEBRTC_BASE: $MOZ_LIBWEBRTC_BASE" } +export -f find_base_commit function find_next_commit() { @@ -41,3 +90,4 @@ function find_next_commit() git log --oneline --ancestry-path $MOZ_LIBWEBRTC_BASE^..$MOZ_TARGET_UPSTREAM_BRANCH_HEAD \ | tail -2 | head -1 | awk '{print $1;}'` } +export -f find_next_commit