From 543f60ec729701d7db73ce2d4ebd7b6f68722182 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Tue, 21 May 2013 10:52:54 +1000 Subject: [PATCH] add the control file to common.sh --- common.sh | 6 ++++++ do_merge | 4 ++-- fetch_trees | 6 ++++-- make_tree_file | 6 ++++-- message_helper | 6 ++++-- update_trees | 8 +++++--- 6 files changed, 25 insertions(+), 11 deletions(-) diff --git a/common.sh b/common.sh index bac6dfd..31478c3 100644 --- a/common.sh +++ b/common.sh @@ -1,10 +1,16 @@ # # Common setup for linux-next scripts # + +# Just in case this gets included twice ... +[ "$_next_common_included" ] && return 0 +_next_common_included=1 + bin_dir="$(dirname $0)" LOG_FILE="../merge.log" SHA1_FILE="../SHA1s" +CTRL_FILE="../etc/control" build_host="ka2" build_dir="/scratch/sfr/next" diff --git a/do_merge b/do_merge index 66e0b5e..35f3f57 100755 --- a/do_merge +++ b/do_merge @@ -90,7 +90,7 @@ do_rebase() } -heads=$(grep -v '^#' ../etc/control | awk -F '\t' '$2=="quilt" || $2=="git" { printf("%s/%s ", $3, $5); }') +heads=$(grep -v '^#' $CTRL_FILE | awk -F '\t' '$2=="quilt" || $2=="git" { printf("%s/%s ", $3, $5); }') need_build=false @@ -151,7 +151,7 @@ for h in $heads; do } $need_build || continue - do_build=$(grep -v '^#' ../etc/control | awk -F ' ' '$3=="'$tree'" { print $6; }') + do_build=$(grep -v '^#' $CTRL_FILE | awk -F ' ' '$3=="'$tree'" { print $6; }') [ "$do_build" = "yes" ] || continue git push -f "$build_host":"$build_dir" master:refs/heads/next || { diff --git a/fetch_trees b/fetch_trees index 29f22a9..b3db1a3 100755 --- a/fetch_trees +++ b/fetch_trees @@ -1,16 +1,18 @@ #!/bin/bash +. "$(dirname $0)/common.sh" "" + origwd=$(pwd) get_field() { - grep -v '^#' ../etc/control | + grep -v '^#' $CTRL_FILE | awk -F '\t' '$3 == "'$1'" { print $'$2'; }' } trees="$@" [ "$trees" ] || - trees=$(grep -v '^#' ../etc/control | awk -F '\t' '{ print $3 }') + trees=$(grep -v '^#' $CTRL_FILE | awk -F '\t' '{ print $3 }') for name in $trees; do type=$(get_field "$name" 2) diff --git a/make_tree_file b/make_tree_file index f1a7e32..5a468e0 100755 --- a/make_tree_file +++ b/make_tree_file @@ -1,5 +1,7 @@ #!/bin/bash +. "$(dirname $0)/common.sh" + # Don't do releases in the wee hours :-) h=$(date '+%H') (( "$h" < 10 && "$h" > 4 )) && { @@ -31,7 +33,7 @@ while read email type name url ref build; do [ "${ref%:*}" = "${ref}" ] || ref=${ref##*:} [ "$type" = "git" ] && url="$url#$ref" printf "%s$tab%s\t%s\n" $name $type $url >>Next/Trees -done <../etc/control +done <$CTRL_FILE ) mv ../SHA1s Next/SHA1s @@ -53,7 +55,7 @@ git diff-tree -p "$l.." >"../$p" gpg2 -u 41D5C07A -a -b "../$p" #echo "$l" > "../LATEST-IS-$n" -$(dirname $0)/make_abat_scripts "$d" "$l" +"$bin_dir/make_abat_scripts" "$d" "$l" oldest=$(date --date "3 months ago" '+%Y%m%d') echo "Removing old releases ... <= next-$oldest" diff --git a/message_helper b/message_helper index 80bf255..a35a65e 100755 --- a/message_helper +++ b/message_helper @@ -1,8 +1,10 @@ #!/bin/bash -log=../merge.log +. "$(dirname $0)/common.sh" "" + +log=$LOG_FILE [ -f merge.log ] && log=merge.log -control=../etc/control +control=$CTRL_FILE [ -f control ] && control=control branch="" diff --git a/update_trees b/update_trees index 6841b5b..266e9c2 100755 --- a/update_trees +++ b/update_trees @@ -1,5 +1,7 @@ #!/bin/bash +. "$(dirname $0)/common.sh" + log_file=../quilt-import.log #cp /dev/null $log_file @@ -17,14 +19,14 @@ execute() cpwd=$(pwd) -quilters=$(grep -v '^#' ../etc/control | awk -F '\t' '$2=="quilt" { print $3; }') +quilters=$(grep -v '^#' $CTRL_FILE | awk -F '\t' '$2=="quilt" { print $3; }') for name in $quilters; do sfile="../quilt/$name/series" base=$(sed -n 's/^#[ \t]*NEXT[-_]BASE[ \t]*\([^ \t]*\)[ \t]*$/\1/p' "$sfile") if [ -n "$base" ]; then - nbase=$(grep -v '^#' ../etc/control | awk -F '\t' '$3=="'"$base"'" { printf("%s/%s", "'"$base"'", $5); }') + nbase=$(grep -v '^#' $CTRL_FILE | awk -F '\t' '$3=="'"$base"'" { printf("%s/%s", "'"$base"'", $5); }') [ -n "$nbase" ] && base="$nbase" else base=$(sed -n 's/^#[ \t]*BASE[ \t]*\(.*\)[ \t]*$/\1/p' "$sfile") @@ -37,7 +39,7 @@ for name in $quilters; do fi rbase="$base" case "$base" in - *-git[0-9]*) rbase=$($(dirname $0)/get_gitid "${base}") + *-git[0-9]*) rbase=$("$bin_dir/get_gitid" "${base}") ;; commit*) rbase=${base##commit*[[:space:]]} ;; -- 2.39.2