Skip to content

Commit 9f94cfd

Browse files
author
Chris Price
committed
Vendor check to succeed even if copyright information is not found
The documentation for validate_vendor_used in hack/validate/vendor states that a warning will be emitted if license information cannot be found in a vendored package. However, because the script is run with pipefail set (owing to the inclusion of the common validation script .validate) and `grep -c` is used, the entire script will fail whenever license information cannot be found in a vendored package. Signed-off-by: Chris Price <[email protected]>
1 parent 400c1ba commit 9f94cfd

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

hack/validate/vendor

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ validate_vendor_diff(){
4040
validate_vendor_used() {
4141
for f in $(mawk '/^[a-zA-Z0-9]/ { print $1 }' vendor.conf); do
4242
if [ -d "vendor/$f" ]; then
43-
found=$(echo "vendor/$f/"* | grep -iEc '/(LICENSE|COPYING)')
44-
if [ "$found" -eq 0 ]; then
43+
if ! echo "vendor/$f"/* | grep -qiEc '/(LICENSE|COPYING)'; then
4544
echo "WARNING: could not find copyright information for $f"
4645
fi
4746
else

0 commit comments

Comments
 (0)