]> git.ozlabs.org Git - next-scripts/blobdiff - common.sh
check_commits: check for unexpected files in commits
[next-scripts] / common.sh
index 74a31c79ce417bcfcc1f7517ac8e2ef9e42a3f13..9f18277ca57cc1b8d782514d27724bb851f1dfdd 100644 (file)
--- a/common.sh
+++ b/common.sh
@@ -6,11 +6,12 @@
 [ "$_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="ash"
 build_dir="/home/sfr/next/next"
@@ -47,4 +48,10 @@ 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