Mark,

On 9/29/23 10:13, Mark Thomas wrote:
On 29/09/2023 13:43, Christopher Schultz wrote:
All,

On 9/29/23 08:40, schu...@apache.org wrote:
This is an automated email from the ASF dual-hosted git repository.

schultz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
      new 5ffb9fb712 Perform a simple gpg test at the beginning of the build to ensure that GPG will work later.

I added this after being reminded by michael-o that failing a release build as early as possible is helpful, especially to RMs.

All this does is sign the build.xml file up-front and then delete the signed file, to ensure that signing is going to work.

I modified the gpg-init-2 target to add a newline after the "Enter GPG passphrase" prompt.

If there are o=no objections, I will back-port to the other supported branches.

No objections. Just a query as to whether there is any other operation that can be used to confirm the passphrase is correct that doesn't have any side-effects. Not a big issue, just a nice to have.

I couldn't really think of one. I might be able to write a test-sign process that dumps the result to a bit-bucket instead of writing the file to the disk. Is the production of the file what you are (mindly) objecting to? It's being deleted immediately.

-chris

5ffb9fb712 is described below

commit 5ffb9fb712691bfb7f79f2d6a5181ff3dec3946a
Author: Christopher Schultz <ch...@christopherschultz.net>
AuthorDate: Fri Sep 29 08:39:15 2023 -0400

     Perform a simple gpg test at the beginning of the build to ensure that GPG will work later.
---
  build.xml | 20 ++++++++++++++++----
  1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/build.xml b/build.xml
index 41b65ab191..f3d9d845a0 100644
--- a/build.xml
+++ b/build.xml
@@ -2768,7 +2768,7 @@ asf.ldap.username=${release.asfusername}
    </target>
    <!-- Sets properties only required for releases -->
-  <target name="release-init" depends="gpg-init-1,gpg-init-2,compile" >
+  <target name="release-init" depends="gpg-init-1,gpg-init-2,gpg-init-3,compile" >
      <taskdef name="forceUtcTimeZone"
               classname="org.apache.tomcat.buildutil.ForceUtcTimeZone"
               classpath="${tomcat.classes}" />
@@ -2780,9 +2780,21 @@ asf.ldap.username=${release.asfusername}
    </target>
    <target name="gpg-init-2" if="${gpg.exec.available}">
-    <input message="Enter GPG pass-phrase" addproperty="gpg.passphrase" >
-      <handler type="secure"/>
-    </input>
+<echo>gpg.exec.available=${gpg.exec.available}</echo>
+<echo>gpg.exec=${gpg.exec}</echo>
+    <input addproperty="gpg.passphrase"><handler type="secure"/>Enter GPG passphrase
+</input>
+  </target>
+
+  <!-- Test GPG by signing build.xml as a sample file. -->
+  <target name="gpg-init-3" if="gpg.passphrase">
+    <delete file="build.xml.asc" quiet="true" />
+    <antcall target="sign">
+      <param name="file" value="build.xml" />
+    </antcall>
+    <uptodate srcfile="build.xml" targetfile="build.xml.asc" property="gpg.success" />
+    <delete file="build.xml.asc" quiet="true" />
+    <fail unless="gpg.success" />
    </target>
    <!-- Packages the core zip distro -->


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to