Merge branch 'pw/add-p-single'
[gitweb.git] / ci / lib-travisci.sh
index bade716171c60634e959d32b37a6b51e658b5cf2..1efee55ef79cdcf2ca07135eed76073b91d91ff9 100755 (executable)
@@ -21,8 +21,6 @@ skip_branch_tip_with_tag () {
        fi
 }
 
-good_trees_file="$HOME/travis-cache/good-trees"
-
 # Save some info about the current commit's tree, so we can skip the build
 # job if we encounter the same tree again and can provide a useful info
 # message.
@@ -67,13 +65,26 @@ skip_good_tree () {
        exit 0
 }
 
+check_unignored_build_artifacts ()
+{
+       ! git ls-files --other --exclude-standard --error-unmatch \
+               -- ':/*' 2>/dev/null ||
+       {
+               echo "$(tput setaf 1)error: found unignored build artifacts$(tput sgr0)"
+               false
+       }
+}
+
 # Set 'exit on error' for all CI scripts to let the caller know that
 # something went wrong.
 # Set tracing executed commands, primarily setting environment variables
 # and installing dependencies.
 set -ex
 
-mkdir -p "$HOME/travis-cache"
+cache_dir="$HOME/travis-cache"
+good_trees_file="$cache_dir/good-trees"
+
+mkdir -p "$cache_dir"
 
 skip_branch_tip_with_tag
 skip_good_tree
@@ -99,8 +110,8 @@ linux-clang|linux-gcc)
        export LINUX_P4_VERSION="16.2"
        export LINUX_GIT_LFS_VERSION="1.5.2"
 
-       P4_PATH="$(pwd)/custom/p4"
-       GIT_LFS_PATH="$(pwd)/custom/git-lfs"
+       P4_PATH="$HOME/custom/p4"
+       GIT_LFS_PATH="$HOME/custom/git-lfs"
        export PATH="$GIT_LFS_PATH:$P4_PATH:$PATH"
        ;;
 osx-clang|osx-gcc)