release-tools/stage-release.sh: Add a run of 'do-copyright-year'
authorRichard Levitte <levitte@openssl.org>
Fri, 19 May 2023 09:33:59 +0000 (11:33 +0200)
committerRichard Levitte <levitte@openssl.org>
Fri, 19 May 2023 10:58:01 +0000 (12:58 +0200)
We did this as a manual step when the release staging script was in another
repository.

Now that they are in the same repository (in the same directory, even!),
there's no reason not to run 'do-copyright-year' automatically.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/tools/pull/144)

release-tools/stage-release.sh

index 437587f28cc732010437aff67ca56ea0c71b03d3..caea9f5c1048e23856d04102f501e90654969db4 100755 (executable)
@@ -264,8 +264,22 @@ trap "exec 42>&-; rm $VERBOSITY_FIFO" 0 2
 
 # Setup ##############################################################
 
+RELEASE_TOOLS=$(dirname $(realpath $(type -p $0)))
+RELEASE_AUX="$RELEASE_TOOLS/release-aux"
+
+# Check that we have external scripts that we use
+found=true
+for fn in "$RELEASE_TOOLS/do-copyright-year"; do
+    if ! [ -f "$fn" ]; then
+        echo >&2 "'$fn' is missing"
+        found=false
+    fi
+done
+if ! $found; then
+    exit 1
+fi
+
 # Check that we have the scripts that define functions we use
-RELEASE_AUX=$(dirname $(realpath $(type -p $0)))/release-aux
 found=true
 for fn in "$RELEASE_AUX/release-version-fn.sh" \
           "$RELEASE_AUX/release-state-fn.sh" \
@@ -539,6 +553,16 @@ $ECHO "== Configuring OpenSSL for update and release.  This may take a bit of ti
 
 $VERBOSE "== Checking source file updates and fips checksums"
 
+$RELEASE_TOOLS/do-copyright-year
+if [ -n "$(git status --porcelain --untracked-files=no --ignore-submodules=all)" ]; then
+    $VERBOSE "== Committing copyright year updates"
+    git add -u
+    git commit $git_quiet -m $'Copyright year updates\n\nRelease: yes'
+    if [ -n "$reviewers" ]; then
+        addrev --release --nopr $reviewers
+    fi
+fi
+
 make update >&42
 # As long as we're doing an alpha release, we can have symbols without specific
 # numbers assigned. In a beta or final release, all symbols MUST have an