#!/bin/bash
-. "$(dirname $0)/common.sh" ""
+tools_dir=$(dirname "$0")
+. "$tools_dir/common.sh" ""
to="Linux Next Mailing List <linux-next@vger.kernel.org>"
cc="Linux Kernel Mailing List <linux-kernel@vger.kernel.org>"
prev=$(git tag -l next-* | sort | tail -n 2 | head -n 1 | sed 's/next-//')
nmc=$(git rev-list --no-merges --count origin/master..HEAD^)
ss=$(git diff --shortstat -M -C origin/master..HEAD^)
-ntrees=$(wc -l <../etc/control)
+ntrees=$(grep -v -c '^#' "$CTRL_FILE")
sed -i.bak -e 's/^\(Changes since\) [0-9]*:/\1 '"$prev"':/' \
-e 's/^\(Non-merge commits .*:\) [0-9]*/\1 '"$nmc"'/'\
-e 's/^\(I am currently merging\) [0-9]* /\1 '"$ntrees"' /' \
../last_msg
-$(dirname $0)/send_email "$to" "$cc" "$subject" <../last_msg
+"$tools_dir/send_email" "$to" "$cc" "$subject" <../last_msg
exit 0