-
Notifications
You must be signed in to change notification settings - Fork 27
Add copyright #391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add copyright #391
Changes from all commits
58a5a20
92fd1ed
0e3e80c
3b7bb41
bda219c
0ee7bf8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,17 +29,14 @@ KEYS_DIST=https://dist.apache.org/repos/dist/release/openwhisk | |
# the artifact being released | ||
NAME=${1?"missing artifact name e.g., openwhisk-client-js"} | ||
|
||
# the name of the project (to match what is in the NOTICE file) | ||
DESCRIPTION=${2?"missing project description e.g., 'OpenWhisk JavaScript Client Library'"} | ||
|
||
# the version of the release artifact | ||
V=${3?"missing version e.g., '3.19.0'"} | ||
V=${2?"missing version e.g., '3.19.0'"} | ||
|
||
# the release candidate, usually 'rc1' | ||
RC=${4:-rc1} | ||
RC=${3:-rc1} | ||
|
||
# the last argument is optional and if set to 'cleanup', the script deletes the scratch space at completion | ||
REMOVE_DIR=${5:-cleanup} | ||
REMOVE_DIR=${4:-cleanup} | ||
|
||
# set to non-zero to download the artifacts to verify, this is the default | ||
DL=${DL:-1} | ||
|
@@ -67,14 +64,11 @@ TGZ=$NAME-$V-sources.tar.gz | |
# this is a constructed name for the keys file | ||
KEYS=$RC-$V-KEYS | ||
|
||
NOTICE=$(cat << END | ||
Apache $DESCRIPTION | ||
Copyright 2016-2021 The Apache Software Foundation | ||
NOTICE_REGEX='^Apache .+ | ||
Copyright [0-9]{4}-2021 The Apache Software Foundation | ||
|
||
This product includes software developed at | ||
The Apache Software Foundation (http://www.apache.org/). | ||
END | ||
) | ||
The Apache Software Foundation \(http:\/\/www\.apache\.org\/\)\.$' | ||
|
||
echo "$(basename $0) (script SHA1: $(gpg --print-md SHA1 $0 | cut -d' ' -f2-))" | ||
|
||
|
@@ -183,6 +177,21 @@ function analyzeKeyImport() { | |
fi | ||
} | ||
|
||
function validateNotice() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have tested all Some of them require changes so I opened a couple of corresponding PRs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice! Thank you @style95 |
||
output=$1 | ||
if [[ "$output" =~ $NOTICE_REGEX ]]; then | ||
printf " $(tput setaf 2)passed$(tput sgr0)\n" | ||
else | ||
ERROR=1 | ||
printf " $(tput setaf 1)failed$(tput sgr0)" | ||
if [[ $2 != "" ]]; then | ||
echo " ($2)" | ||
else | ||
printf "\n" | ||
fi | ||
fi | ||
} | ||
|
||
if [ $DL -ne 0 ]; then | ||
SRC=$RC_DIST/$RC | ||
echo fetching tarball and signatures from $SRC | ||
|
@@ -258,8 +267,8 @@ fi | |
validate $STATUS 0 "$CMD" "signed-by: $SIGNER" | ||
|
||
printf "verifying notice..." | ||
NTXT=$(cat "$DIR/$BASE/NOTICE.txt") | ||
validate "$NOTICE" "$NTXT" "cat '$DIR/$BASE/NOTICE.txt'" | ||
NOTICE=$(cat "$DIR/$BASE/NOTICE.txt") | ||
validateNotice "$NOTICE" "cat '$DIR/$BASE/NOTICE.txt'" | ||
|
||
printf "verifying absence of DISCLAIMER.txt" | ||
CMD="test -f '$DIR/$BASE/DISCLAIMER.txt'" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a positive change - thanks for improving the checks.
Removing the component description from the check could lead to an error where someone copies the notice file from one repo and forgets to update the name. Will have to be diligent about this.
It's nice to have one fewer argument to rcverify.