You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by st...@apache.org on 2021/06/03 00:41:42 UTC
[openwhisk-release] branch master updated: Add copyright (#391)
This is an automated email from the ASF dual-hosted git repository.
style95 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwhisk-release.git
The following commit(s) were added to refs/heads/master by this push:
new 27769a9 Add copyright (#391)
27769a9 is described below
commit 27769a910e4ca7f549982138fca892563135ee62
Author: Dominic Kim <st...@apache.org>
AuthorDate: Thu Jun 3 09:41:34 2021 +0900
Add copyright (#391)
* Add the copyright year to the configs.
* Add the copyright year to the gen-release-vote.py.
* Make the starting year only configurable.
* Use regex to validate the NOTICE.txt
* Fix regex to match NOTICE.txt
* Remove unnecessary copyright
---
tools/gen-release-vote.py | 2 +-
tools/local_verify.sh | 4 +---
tools/rcverify.sh | 37 +++++++++++++++++++++++--------------
3 files changed, 25 insertions(+), 18 deletions(-)
diff --git a/tools/gen-release-vote.py b/tools/gen-release-vote.py
index f21aa3d..384151e 100755
--- a/tools/gen-release-vote.py
+++ b/tools/gen-release-vote.py
@@ -94,7 +94,7 @@ def gitHashes(components):
return '\n'.join(list(s))
def rcverify(components, version):
- s = map(lambda r: "./rcverify.sh %s '%s' %s %s" % (r.id, r.name, version.v, version.rc), components)
+ s = map(lambda r: "./rcverify.sh %s %s %s" % (r.id, version.v, version.rc), components)
return '\n'.join(list(s))
def releaseVersion(config):
diff --git a/tools/local_verify.sh b/tools/local_verify.sh
index e7f2ae9..b11a550 100755
--- a/tools/local_verify.sh
+++ b/tools/local_verify.sh
@@ -26,7 +26,5 @@ source "$SCRIPTDIR/load_config.sh" "$1"
for repo in $(echo $repos | sed "s/,/ /g")
do
repo_name=$(echo "$repo" | sed -e 's/^"//' -e 's/"$//')
- NAME_KEY=${repo_name//-/_}.name
- NAME=$(json_by_key "$CONFIG" $NAME_KEY)
- LOCAL_DIR="$OPENWHISK_ARTIFACT_DIR" DL=0 "$SCRIPTDIR"/rcverify.sh $repo_name "$NAME" $version $pre_release_version
+ LOCAL_DIR="$OPENWHISK_ARTIFACT_DIR" DL=0 "$SCRIPTDIR"/rcverify.sh $repo_name $version $pre_release_version
done
diff --git a/tools/rcverify.sh b/tools/rcverify.sh
index 4aa423a..1b08d14 100755
--- a/tools/rcverify.sh
+++ b/tools/rcverify.sh
@@ -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() {
+ 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'"