]> git.ozlabs.org Git - next-scripts/blobdiff - common.sh
check_commits: check for unexpected files in commits
[next-scripts] / common.sh
index b02a06e18caba794362034d374ceeec447a692ff..9f18277ca57cc1b8d782514d27724bb851f1dfdd 100644 (file)
--- a/common.sh
+++ b/common.sh
@@ -6,18 +6,31 @@
 [ "$_next_common_included" ] && return 0
 _next_common_included=1
 
-bin_dir="$(dirname $0)"
+bin_dir=$(realpath $(dirname "$0"))
+top_dir=$(dirname "$bin_dir")
 
-LOG_FILE="../merge.log"
-SHA1_FILE="../SHA1s"
-CTRL_FILE="../etc/control"
+[ "$LOG_FILE" ] || LOG_FILE="$top_dir/merge.log"
+SHA1_FILE="$top_dir/SHA1s"
+CTRL_FILE="$top_dir/etc/control"
 
-build_host="ka2"
-build_dir="/scratch/sfr/next"
+build_host="ash"
+build_dir="/home/sfr/next/next"
 gcc_version="4.9.0"
+j_factor=$(nproc)
+gpg_key=89F91C0A41D5C07A
+kup_gpg_key=015042F34957D06C
 
-[ "$NEXT_BUILD_HOST" ] && build_host="$NEXT_BUILD_HOST"
+[ "$NEXT_BUILD_HOST" ] && {
+       build_host="$NEXT_BUILD_HOST"
+       [ "$build_host" = "none" ] && build_host=""
+}
 [ "$NEXT_BUILD_DIR" ] && build_dir="$NEXT_BUILD_DIR"
+[ "$NEXT_GCC_VERSION" ] && gcc_version="$NEXT_GCC_VERSION"
+gcc_ppc_version=$gcc_version
+[ "$NEXT_GCC_PPC_VERSION" ] && gcc_ppc_version="$NEXT_GCC_PPC_VERSION"
+gcc_ppcle_version=$gcc_ppc_version
+[ "$NEXT_GCC_PPCLE_VERSION" ] && gcc_ppcle_version="$NEXT_GCC_PPCLE_VERSION"
+[ "$NEXT_J_FACTOR" ] && j_factor="$NEXT_J_FACTOR"
 
 [ -n "$1" ] && {
        build_host="$1"
@@ -28,7 +41,17 @@ gcc_version="4.9.0"
        shift
 }
 
-export NEXT_BUILD_HOST="$build_host"
+export NEXT_BUILD_HOST="${build_host:-none}"
 export NEXT_BUILD_DIR="$build_dir"
+export NEXT_GCC_VERSION="$gcc_version"
+export NEXT_GCC_PPC_VERSION="$gcc_ppc_version"
+export NEXT_GCC_PPCLE_VERSION="$gcc_ppcle_version"
+export NEXT_J_FACTOR="$j_factor"
+
+# Support functions
+get_contacts()
+{
+       awk -F '\t' '/^[^#]/ && $3=="'"$1"'" { print $1; }' $CTRL_FILE
+}
 
 true