subject="build failure after merge of the BRANCH tree"
-$(dirname $0)/message_helper "$@" "$subject" <<EOF
+tools_dir=$(dirname "$0")
+"$tools_dir"/message_helper "$@" "$subject" <<EOF
After merging the BRANCH tree, today's linux-next build (KCONFIG_NAME) failed like this:
subject="build warning after merge of the BRANCH tree"
-$(dirname $0)/message_helper "$@" "$subject" <<EOF
+tools_dir=$(dirname "$0")
+"$tools_dir"/message_helper "$@" "$subject" <<EOF
After merging the BRANCH tree, today's linux-next build (KCONFIG_NAME) produced this warning:
LOG_FILE="../left_over.log"
-cp /dev/null $LOG_FILE
-
-log()
-{
- echo "$@" | tee -a $LOG_FILE
-}
+cp /dev/null "$LOG_FILE"
heads=$(grep -v '^#' ../etc/control | awk -F ' ' '$2=="quilt" { printf("quilt/%s ", $3); } $2=="git" { printf("%s/%s ", $3, $5); }')
for h in $heads; do
- echo $h
- mb=$(git merge-base origin/master $h)
- rh=$(git rev-parse $h)
+ echo "$h"
+ mb=$(git merge-base origin/master "$h")
+ rh=$(git rev-parse "$h")
[ "$mb" = "$rh" ] &&
continue
- c=$(git rev-list --pretty='format:%m%H' --no-merges --left-right --cherry-pick origin/master...$h | sed -n 's/^>//p')
+ c=$(git rev-list --pretty='format:%m%H' --no-merges --left-right --cherry-pick origin/master..."$h" | sed -n 's/^>//p')
[ -z "$c" ] &&
continue
- log $h "$(echo $c | wc -w)" | tee -a $LOG_FILE
- git shortlog --no-walk $c 2>&1 | tee -a $LOG_FILE
+ echo "$h" $(echo "$c" | wc -w) | tee -a "$LOG_FILE"
+ git shortlog --no-walk "$c" 2>&1 | tee -a "$LOG_FILE"
# gitk stable..$h
[ "$_next_common_included" ] && return 0
_next_common_included=1
-bin_dir="$(dirname $0)"
+bin_dir=$(dirname "$0")
LOG_FILE="../merge.log"
SHA1_FILE="../SHA1s"
#!/bin/sh
-. "$(dirname $0)/common.sh"
+tools_dir=$(dirname "$0")
+. "$tools_dir/common.sh"
set -e
e=\$d.except
echo CONFIG_BUILD_DOCSRC=n >\$e || exit 1
echo CONFIG_MODULES=y >>\$e || exit 1
- KCONFIG_ALLCONFIG=\$e cross -n -N -a x86_64 -c $gcc_version O=\$d allmodconfig || exit 1
+ KCONFIG_ALLCONFIG=\$e cross -n -N -a x86_64 -c "$gcc_version" O=\$d allmodconfig || exit 1
echo "Forking x86 build ..."
- /usr/bin/time cross -n -N -a x86_64 -c $gcc_version O=\$d -j$j_factor -s > \$log_x86 2>&1 &
+ /usr/bin/time cross -n -N -a x86_64 -c "$gcc_version" O=\$d -j"$j_factor" -s > \$log_x86 2>&1 &
x86_64_pid=\$!
echo Building: powerpc ppc64_defconfig
d="$bparent/powerpc_ppc64_defconfig"
[ -d \$d ] || mkdir \$d || exit 1
log_ppc=\$d.log
- cross -n -N -a powerpc64 -k powerpc -c $gcc_ppc_version O=\$d ppc64_defconfig || exit 1
+ cross -n -N -a powerpc64 -k powerpc -c "$gcc_ppc_version" O=\$d ppc64_defconfig || exit 1
echo "Forking powerpc build ..."
- /usr/bin/time cross -n -N -a powerpc64 -k powerpc -c $gcc_ppc_version O=\$d -j$j_factor -s > \$log_ppc 2>&1 &
+ /usr/bin/time cross -n -N -a powerpc64 -k powerpc -c "$gcc_ppc_version" O=\$d -j"$j_factor" -s > \$log_ppc 2>&1 &
ppc64_pid=\$!
echo Building: arm multi_v7_defconfig
d="$bparent/arm_multi_v7_defconfig"
[ -d \$d ] || mkdir \$d || exit 1
log_arm=\$d.log
- cross -n -N -a arm -c $gcc_version O=\$d multi_v7_defconfig || exit 1
+ cross -n -N -a arm -c "$gcc_version" O=\$d multi_v7_defconfig || exit 1
echo "Forking arm build ..."
- /usr/bin/time cross -n -N -a arm -c $gcc_version O=\$d -j$j_factor -s > \$log_arm 2>&1 &
+ /usr/bin/time cross -n -N -a arm -c "$gcc_version" O=\$d -j"$j_factor" -s > \$log_arm 2>&1 &
arm_pid=\$!
echo Building: perf
[ -d \$d ] || mkdir \$d || exit 1
log_perf=\$d.log
echo "Forking perf build ..."
- /usr/bin/time make -s -C tools/perf JOBS=$j_factor O=\$d > \$log_perf 2>&1 &
+ /usr/bin/time make -s -C tools/perf JOBS="$j_factor" O=\$d > \$log_perf 2>&1 &
perf_pid=\$!
wait \$perf_pid
shift
}
-. "$(dirname $0)/common.sh"
+tool_dir=$(dirname "$0")
+. "$tool_dir/common.sh"
log()
{
- echo "$@" | tee -a $LOG_FILE
+ echo "$@" | tee -a "$LOG_FILE"
}
execute()
{
- log "$" $@
- $@ 2>&1 | tee -a $LOG_FILE
- return ${PIPESTATUS[0]}
+ log "$" "$@"
+ "$@" 2>&1 | tee -a "$LOG_FILE"
+ return "${PIPESTATUS[0]}"
}
do_rebase()
{
rbase=${1#*/}
- rbase=${rbase%%:*}
- rtop=${1#*:}
- rbid=$(git rev-parse $2/$rbase)
- rtid=$(git rev-parse $2/$rtop)
+ rbase="$2/${rbase%%:*}"
+ rtop="$2/${1#*:}"
+ rbid=$(git rev-parse "$rbase")
+ rtid=$(git rev-parse "$rtop")
[ "$rbid" = "$rtid" ] && {
echo Empty tree
return
}
- [ "$(git rev-list HEAD..$2/$rtop)" ] || {
+ [ "$(git rev-list HEAD..$rtop)" ] || {
echo Already merged
return
}
}
log '$' cd ../rebase-tmp
cd ../rebase-tmp
- execute git fetch --no-tags ../next refs/remotes/$2/$rtop:$2/$rtop || {
+ execute git fetch --no-tags ../next "refs/remotes/$rtop:$rtop" || {
echo Fetch of top failed 1>&2
bash -i || exit
}
- execute git fetch --no-tags ../next refs/remotes/$2/$rbase:$2/$rbase || {
+ execute git fetch --no-tags ../next "refs/remotes/$rbase:$rbase" || {
echo Fetch of base failed 1>&2
bash -i || exit
}
- execute git checkout $2/$rtop || {
+ execute git checkout "$rtop" || {
echo Checkout of top failed 1>&2
bash -i || exit
}
- execute git rebase --onto master $2/$rbase || {
+ execute git rebase --onto master "$rbase" || {
echo Rebase failed 1>&2
bash -i || exit
}
log '$' cd ../next
cd ../next
- execute git pull -f ../rebase-tmp $2/$rtop || {
+ execute git pull -f ../rebase-tmp "$rtop" || {
echo Pull failed 1>&2
- echo $h >>../merge.debug
+ echo "$h" >>../merge.debug
git diff >>../merge.debug 2>&1
git diff 2>&1 | egrep -q '<<<<<|^\*' && {
bash -i || exit
}
[ -n "$start_from" ] || {
- cp /dev/null $LOG_FILE
+ cp /dev/null "$LOG_FILE"
execute date -R
execute git checkout master
execute git reset --hard stable
- printf 'Name\t\tSHA1\n----\t\t----\n' > $SHA1_FILE
+ printf 'Name\t\tSHA1\n----\t\t----\n' > "$SHA1_FILE"
}
-heads=$(grep -v '^#' $CTRL_FILE | 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
fi
}
- hlog=$(git log -1 --oneline ${h/\/*://}) 2>/dev/null
+ hlog=$(git log -1 --oneline "${h/\/*://}") 2>/dev/null
old_head=$(git rev-parse HEAD)
[ -f "../pre-merge/$tree" ] && {
for p in $(cat "../pre-merge/$tree"); do
}
done
}
- log Merging $h "($hlog)"
+ log Merging "$h" "($hlog)"
case "$h" in
*:*)
- do_rebase $h $tree
+ do_rebase "$h" "$tree"
;;
*)
- execute git merge $h || {
+ execute git merge "$h" || {
echo Merge failed 1>&2
- echo $h >>../merge.debug
+ echo "$h" >>../merge.debug
git diff >>../merge.debug 2>&1
um_files=$(git diff 2>&1 | sed -n 's/^\* Unmerged path //p')
[ "$um_files" ] && [ -f "../merge-files/$tree" ] && {