imbajin commented on code in PR #568:
URL: https://github.com/apache/hugegraph-doc/pull/568#discussion_r4653858214
##########
content/en/docs/contribution-guidelines/validate-release.md:
##########
@@ -87,33 +89,25 @@ ensure that it is consistent with the hash value published
on apache/GitHub (Usu
is the same as the last step of 0x02 inspection.
```bash
-execute the following command:
-for i in *.tar.gz; do echo $i; shasum -a 512 --check $i.sha512; done
+(
+ for archive in *.tar.gz; do
+ printf '%s\n' "$archive"
+ grep -E
"([[:space:]]|\*)${archive}$|^SHA512[[:space:]]*\(${archive}\)[[:space:]]*="
"$archive.sha512" | shasum -a 512 --check || exit "$?"
Review Comment:
**Compare the sidecar filename literally**
`$archive` is interpolated into an extended regular expression, so the dots
in a release filename match any character. For example, if the sidecar for
`package-1.8.0.tar.gz` names an existing `package-1X8X0.tar.gz`, this filter
accepts it and `shasum` checks the other file. I reproduced a successful loop
with the intended archive corrupt and the other archive valid. Please compare
the parsed filename literally for both supported checksum formats; the Chinese
example needs the same fix.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]