From 2f20820f9b20b85ead0e8afaf42a07c8e0263540 Mon Sep 17 00:00:00 2001 From: Arthur She Date: Wed, 1 Oct 2014 22:28:38 -0700 Subject: 1. Reference kselftest-repo.conf in the same directory as kselftest-repo-update.sh 2. Move working directory to the same directory as kselftest-repo-update.sh 3. Break commit message into several lines 4. Prevent re-tag with same id modified: kselftest-repo-update.sh --- kselftest-repo-update.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/kselftest-repo-update.sh b/kselftest-repo-update.sh index b3e7d08..ab82808 100755 --- a/kselftest-repo-update.sh +++ b/kselftest-repo-update.sh @@ -1,10 +1,12 @@ #!/bin/bash # # This script is used to update in-kernel-tests (kernel_src/tools/testing/selftest) -CONFIG_FILE="./kselftest-repo.conf" +BASEDIR=$(readlink -f $(dirname ${BASH_SOURCE[0]})) +CONFIG_FILE="${BASEDIR}/kselftest-repo.conf" . ${CONFIG_FILE} -TCODE_REPO="ssh://git@git.linaro.org/people/arthur.she/in-kernel-tests.git" -WORKING_DIR="/tmp/qa-kselftest" +#TCODE_REPO="ssh://git@git.linaro.org/people/arthur.she/in-kernel-tests.git" +TCODE_REPO="file:///media/arthur/arthur-usb3/linaro/qa/git/tmp/kselftest.git" +WORKING_DIR="${BASEDIR}/working_dir" KSRC_DIR="${WORKING_DIR}/kernel_src" TCODE_DIR="${WORKING_DIR}/kselftest" @@ -73,7 +75,7 @@ do [ $? -ne 0 ] && continue pushd ${kworking_dir} > /dev/null cm=`git log -n1|head -n1|awk '{print $NF}'` - commit_comment="Update to ${cm} from repo ${remote_repo} branch ${remote_branch}" + commit_comment="Update to commit: ${cm}\nfrom repo: ${remote_repo}\nbranch: ${remote_branch}" popd > /dev/null IFS=' ';read -ra bn <<< ${KSELFTEST_BRANCH[$i]} for b in ${bn[@]}; @@ -90,7 +92,12 @@ do # Add new/modified files [ -n "`git status|grep 'Untracked files'`" ] && git add . # Commit, tag & push - git commit -m "${commit_comment}" + git commit -m "$(echo -e ${commit_comment})" + # if the tag already exist, delete it + if [ -n "`git tag|grep ${cm}`" ]; then + git tag -d ${cm} + git push origin :refs/tags/${cm} + fi git tag ${cm} git push --tag -u origin ${b} CREATE_NEW_BRANCH=false -- cgit v1.2.3