HADOOP-12233. if CHANGED_FILES is corrupt, find_changed_modules never returns (Kengo Seki via aw)
Project: http://git-wip-us.apache.org/repos/asf/yetus/repo Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/90b8e664 Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/90b8e664 Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/90b8e664 Branch: refs/heads/master Commit: 90b8e664f0755c540629135976e8dea079b47ade Parents: 2340c55 Author: Allen Wittenauer <[email protected]> Authored: Tue Aug 25 09:15:22 2015 -0700 Committer: Allen Wittenauer <[email protected]> Committed: Tue Aug 25 09:15:22 2015 -0700 ---------------------------------------------------------------------- dev-support/test-patch.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/yetus/blob/90b8e664/dev-support/test-patch.sh ---------------------------------------------------------------------- diff --git a/dev-support/test-patch.sh b/dev-support/test-patch.sh index 4d4b63f..9f08ad3 100755 --- a/dev-support/test-patch.sh +++ b/dev-support/test-patch.sh @@ -1107,6 +1107,7 @@ function find_buildfile_dir { local buildfile=$1 local dir=$2 + local d yetus_debug "Find ${buildfile} dir for: ${dir}" @@ -1119,6 +1120,12 @@ function find_buildfile_dir yetus_debug "ERROR: ${buildfile} is not found." return 1 else + d=$(cd -P -- "$(dirname -- "${dir}")" >/dev/null && pwd -P) + relative_dir "${d}" >/dev/null + if [[ $? == 1 ]]; then + yetus_debug "ERROR: ${dir} is not in ${BASEDIR}." + return 1 + fi dir=$(dirname "${dir}") fi done @@ -1151,6 +1158,7 @@ function find_changed_files function module_skipdir { local dir=${1} + local d local i yetus_debug "Checking skipdirs for ${dir}" @@ -1170,6 +1178,12 @@ function module_skipdir if [[ ${dir} == "." ]]; then return 0 else + d=$(cd -P -- "$(dirname -- "${dir}")" >/dev/null && pwd -P) + relative_dir "${d}" >/dev/null + if [[ $? == 1 ]]; then + yetus_debug "ERROR: ${dir} is not in ${BASEDIR}." + return 1 + fi dir=$(dirname "${dir}") yetus_debug "Trying to skip: ${dir}" fi
