This is an automated email from the ASF dual-hosted git repository.
aw pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/yetus.git
The following commit(s) were added to refs/heads/main by this push:
new 23aaad6 YETUS-1027. checkmake output is incorrect (#161)
23aaad6 is described below
commit 23aaad6fbd5fc9b0484f1763b0aa72b27f22576e
Author: Allen Wittenauer <[email protected]>
AuthorDate: Thu Oct 15 12:59:57 2020 -0700
YETUS-1027. checkmake output is incorrect (#161)
---
precommit/src/main/shell/test-patch.d/checkmake.sh | 13 ++++++++++---
precommit/src/test/resources/Makefile | 22 ++++++++++++++++++++++
2 files changed, 32 insertions(+), 3 deletions(-)
diff --git a/precommit/src/main/shell/test-patch.d/checkmake.sh
b/precommit/src/main/shell/test-patch.d/checkmake.sh
index 9c4316c..2f3d784 100755
--- a/precommit/src/main/shell/test-patch.d/checkmake.sh
+++ b/precommit/src/main/shell/test-patch.d/checkmake.sh
@@ -65,6 +65,7 @@ function checkmake_exec
{
declare i
declare repostatus=$1
+ declare basefn="${PATCH_DIR}/${repostatus}-checkmake-result"
declare -a args
echo "Running checkmake against identified Makefiles."
@@ -80,12 +81,18 @@ function checkmake_exec
if [[ ${i} =~ /Makefile$ ]] || [[ ${i} =~ ^Makefile$ ]]; then
if [[ -f ${i} ]]; then
while read -r; do
- echo "${i}:${REPLY}" >>
"${PATCH_DIR}/${repostatus}-checkmake-result.txt"
+ echo "${i}:${REPLY}" >> "${basefn}.tmp"
done < <("${CHECKMAKE}" "${args[@]}" "${i}")
fi
fi
done
+ if [[ -f "$${basefn}.tmp" ]]; then
+ sort -k1,1 -k2,2n "${basefn}.tmp" \
+ > "${basefn}.text"
+ rm "${basefn}.tmp"
+ fi
+
popd >/dev/null || return 1
return 0
}
@@ -109,7 +116,7 @@ function checkmake_preapply
return 0
}
-## @description Wrapper to call column_calcdiffs
+## @description Wrapper to call error_calcdiffs
## @audience private
## @stability evolving
## @replaceable no
@@ -118,7 +125,7 @@ function checkmake_preapply
## @return differences
function checkmake_calcdiffs
{
- column_calcdiffs "$@"
+ error_calcdiffs "$@"
}
function checkmake_postapply
diff --git a/precommit/src/test/resources/Makefile
b/precommit/src/test/resources/Makefile
new file mode 100644
index 0000000..472fd62
--- /dev/null
+++ b/precommit/src/test/resources/Makefile
@@ -0,0 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+.PHONY: all clean test
+
+all:
+
+clean:
+
+test: