kaiwangleo commented on code in PR #996:
URL: https://github.com/apache/flink-agents/pull/996#discussion_r3793453810
##########
tools/check-license.sh:
##########
@@ -20,41 +20,84 @@
# NOTE: This script is adapted from the Apache Spark project.
-acquire_rat_jar () {
+validate_rat_jar() {
+ local jar_cmd
+
+ if command -v unzip >/dev/null 2>&1; then
+ unzip -tq "$JAR" >/dev/null 2>&1
+ return $?
Review Comment:
Implemented and validated locally. Both validator paths now use an explicit
internal status contract instead of passing through tool-specific exit codes:
```bash
if validator_command; then
return 0
fi
return 1
```
`return 2` is now reserved for the branch where neither `unzip` nor `jar` is
available. As a result, exit status 2 from `unzip` or the `jar` fallback is
treated as an invalid JAR, so a cached corrupt JAR is removed and the
acquisition fails instead of warning and continuing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]