A few fixes for release-tools/stage-release.sh
authorRichard Levitte <levitte@openssl.org>
Mon, 29 May 2023 09:38:05 +0000 (11:38 +0200)
committerRichard Levitte <levitte@openssl.org>
Mon, 29 May 2023 12:13:07 +0000 (14:13 +0200)
Correcting these issues:

- The update branch and release branch were created each on different sides
  of a 'next_release_state' call, which made them differ even though there
  shouldn't be any difference (i.e. --branch was given or implied).
- Running 'do-copyright-year' was done after configuration, and may change
  Configure, which means that the following 'make' call may reconfigure and
  intentionally fail, causing release staging failure.
- In the metadata, the 'staging_update_branch' entry was set to the original
  update branch.

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

release-tools/stage-release.sh

index caea9f5c1048e23856d04102f501e90654969db4..d1b2948db25c2f1fca1ea8a00aabc1a5a7fffde4 100755 (executable)
@@ -521,16 +521,16 @@ EOF
     exit 1
 fi
 
+# Update the version information.  This won't save anything anywhere, yet,
+# but does check for possible next_method errors before we do bigger work.
+next_release_state "$next_method"
+
 # Make the update branch name according to our current data
 update_branch=$(format_string "$branch_fmt" \
                               "b=$orig_update_branch" \
                               "t=" \
                               "v=$FULL_VERSION")
     
-# Update the version information.  This won't save anything anywhere, yet,
-# but does check for possible next_method errors before we do bigger work.
-next_release_state "$next_method"
-
 # Make the release tag and branch name according to our current data
 tag=$(format_string "$tag_fmt" \
                     "b=$orig_release_branch" \
@@ -547,11 +547,7 @@ if [ "$update_branch" != "$orig_update_branch" ]; then
     git checkout $git_quiet -b "$update_branch"
 fi
 
-$ECHO "== Configuring OpenSSL for update and release.  This may take a bit of time"
-
-./Configure cc >&42
-
-$VERBOSE "== Checking source file updates and fips checksums"
+$VERBOSE "== Checking source file copyright year updates"
 
 $RELEASE_TOOLS/do-copyright-year
 if [ -n "$(git status --porcelain --untracked-files=no --ignore-submodules=all)" ]; then
@@ -563,6 +559,12 @@ if [ -n "$(git status --porcelain --untracked-files=no --ignore-submodules=all)"
     fi
 fi
 
+$ECHO "== Configuring OpenSSL for update and release.  This may take a bit of time"
+
+./Configure cc >&42
+
+$VERBOSE "== Checking source file updates and fips checksums"
+
 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
@@ -694,8 +696,9 @@ fi
 $VERBOSE "== Generating metadata file: $metadata"
 
 (
+    set -x
     if [ "$update_branch" != "$orig_update_branch" ]; then
-        echo "staging_update_branch='$orig_update_branch'"
+        echo "staging_update_branch='$update_branch'"
     fi
     echo "update_branch='$orig_update_branch'"
     if [ "$release_branch" != "$update_branch" ]; then