HADOOP-11914. test-patch.sh confused by certain patch formats (Kengo Seki via aw)

This commit is contained in:
Allen Wittenauer 2015-06-30 13:07:30 -07:00
parent 1c5ae8a846
commit b4c7aa1126

View File

@ -1060,16 +1060,11 @@ function find_changed_files
{ {
# get a list of all of the files that have been changed, # get a list of all of the files that have been changed,
# except for /dev/null (which would be present for new files). # except for /dev/null (which would be present for new files).
# Additionally, remove any a/ b/ patterns at the front # Additionally, remove any a/ b/ patterns at the front of the patch filenames.
# of the patch filenames and any revision info at the end
# shellcheck disable=SC2016 # shellcheck disable=SC2016
CHANGED_FILES=$(${GREP} -E '^(\+\+\+|---) ' "${PATCH_DIR}/patch" \ CHANGED_FILES=$(${AWK} 'function p(s){sub("^[ab]/","",s); if(s!~"^/dev/null"){print s}}
| ${SED} \ /^diff --git / { p($3); p($4) }
-e 's,^....,,' \ /^(\+\+\+|---) / { p($2) }' "${PATCH_DIR}/patch" | sort -u)
-e 's,^[ab]/,,' \
| ${GREP} -v /dev/null \
| ${AWK} '{print $1}' \
| sort -u)
} }
## @description Find the modules of the build that ${PATCH_DIR}/patch modifies ## @description Find the modules of the build that ${PATCH_DIR}/patch modifies
@ -1453,7 +1448,7 @@ function determine_needed_tests
local i local i
for i in ${CHANGED_FILES}; do for i in ${CHANGED_FILES}; do
yetus_debug "Determining needed tests for ${i}"
personality_file_tests "${i}" personality_file_tests "${i}"
for plugin in ${PLUGINS}; do for plugin in ${PLUGINS}; do