Modify mkrelease.pl to have a different announce text for premium releases
authorRichard Levitte <levitte@openssl.org>
Fri, 29 Jul 2022 11:38:13 +0000 (13:38 +0200)
committerRichard Levitte <levitte@openssl.org>
Mon, 15 Aug 2022 14:26:31 +0000 (16:26 +0200)
^CT-142 Closed

release-tools/mkrelease.pl

index 48f18d7efc14ad6e964599ab372b2d6c273df489..86ee2f3cac67fa186b3599b6a128eb13e91f73d4 100755 (executable)
@@ -22,6 +22,9 @@ require "release-git.pl";
 require "release-update.pl";
 require "release-version.pl";
 
+my @public_bversions = qw( 1.1.1 );
+my @premium_bversions = qw( 1.0.2 );
+
 our $debug   = 0;
 our $verbose = 0;
 my @reviewers;
@@ -37,6 +40,7 @@ my $no_upload;
 my $bversion;
 my $ok;
 my $label;
+my $premium_password;
 
 #Determine include path
 our $includepath;
@@ -100,6 +104,8 @@ foreach (@ARGV) {
         $pre = 0;
     } elsif (/^--enter-pre/) {
         $pre = 1;
+    } elsif (/^--premium-password=(.*)$/) {
+        $premium_password = $1;
     } elsif (/^--debug/) {
         $debug   = 1;
         $verbose = 1;
@@ -121,8 +127,11 @@ foreach (@ARGV) {
     }
 }
 
+$_ = openssl_git_current_branch();
+die "The OpenSSL branch $_ isn't supported by this script, try dev/release.sh instead\n"
+    unless /OpenSSL_[0-9]+_[0-9]+_[0-9]+-stable/;
+
 if ($revert) {
-    $_ = openssl_git_current_branch();
     print "Reverting to repository version for $_\n";
     system("git reset --hard origin/$_");
     die "Error reverting!!" if $?;
@@ -143,6 +152,8 @@ if ($branch_info_only) {
 }
 
 die "No reviewer set!" unless @reviewers;
+die "No premium password given!"
+    if ((grep { $_ eq $bversion } @premium_bversions) && !$premium_password);
 
 print "Current branch version is $bversion\n";
 
@@ -344,14 +355,19 @@ if ( !$no_release ) {
    The OpenSSL Project Team.
 
 EOF
-    } else {
+    } elsif (grep { $bversion eq $_ } @public_bversions) {
+        ###### PUBLIC RELEASE TEMPLATE ######
+
         # Using $avers so its length is similar to a real version
         # length so it's easier to make the announcement look pretty.
         my $avers = $expected_version;
+
+        my $title = "OpenSSL version $avers released";
+        my $underline = "=" x length($title);
         print OUT <<EOF;
 
-   OpenSSL version $avers released
-   ===============================
+   $title
+   $underline
 
    OpenSSL - The Open Source toolkit for SSL/TLS
    https://www.openssl.org/
@@ -385,6 +401,51 @@ EOF
 
    The OpenSSL Project Team.
 
+EOF
+
+    } else {
+        ###### PREMIUM RELEASE TEMPLATE ######
+
+        # Using $avers so its length is similar to a real version
+        # length so it's easier to make the announcement look pretty.
+        my $avers = $expected_version;
+
+        my $title = "OpenSSL version $avers released";
+        my $underline = "=" x length($title);
+        print OUT <<EOF;
+
+   $title
+   $underline
+
+   OpenSSL - The Open Source toolkit for SSL/TLS
+   https://www.openssl.org/
+
+   The OpenSSL project team is pleased to announce the release of
+   version $avers of our open source toolkit for SSL/TLS.
+
+   OpenSSL $avers is available for download via SFTP from the
+   following location:
+
+     * Server: ftp.openssl.org
+     * Username: premium
+     * Password: $premium_password
+
+   The distribution file name is:
+
+    o $tarfile
+      Size: $length
+      SHA1 checksum: $sha1hash
+      SHA256 checksum: $sha256hash
+
+   The checksums were calculated using the following commands:
+
+    openssl sha1 $tarfile
+    openssl sha256 $tarfile
+
+   Yours,
+
+   The OpenSSL Project Team.
+
 EOF
 
     }