You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2021/11/30 17:25:54 UTC

[incubator-ponymail-foal] branch master updated (d1b9612 -> 5c823f2)

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git.


    from d1b9612  Update version
     new d623d01  Include endpoints and main.py in version
     new 5c823f2  Include endpoints and main.py in version

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 server/main.py           |  7 +++----
 server/server_version.py |  2 ++
 server/update_version.sh | 17 ++++++++++++-----
 3 files changed, 17 insertions(+), 9 deletions(-)
 create mode 100644 server/server_version.py

[incubator-ponymail-foal] 01/02: Include endpoints and main.py in version

Posted by se...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git

commit d623d016ae2258e77a15f3d68f266b36f5a85c68
Author: Sebb <se...@apache.org>
AuthorDate: Tue Nov 30 17:24:40 2021 +0000

    Include endpoints and main.py in version
---
 server/main.py           |  7 +++----
 server/server_version.py |  2 ++
 server/update_version.sh | 17 ++++++++++++-----
 3 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/server/main.py b/server/main.py
index 05a1aa0..96d5a4d 100644
--- a/server/main.py
+++ b/server/main.py
@@ -39,8 +39,7 @@ import plugins.server
 import plugins.session
 
 PONYMAIL_FOAL_VERSION = "0.1.0"
-# The following version is generated by update_version.sh
-PONYMAIL_PLUGIN_VERSION = '2732886' # Must use single quotes
+from server_version import PONYMAIL_SERVER_VERSION
 
 
 # Certain environments such as MinGW-w64 will not register as a TTY and uses buffered output.
@@ -55,7 +54,7 @@ class Server(plugins.server.BaseServer):
 
     def __init__(self, args: argparse.Namespace):
         print(
-            "==== Apache Pony Mail (Foal v/%s ~%s) starting... ====" % (PONYMAIL_FOAL_VERSION, PONYMAIL_PLUGIN_VERSION)
+            "==== Apache Pony Mail (Foal v/%s ~%s) starting... ====" % (PONYMAIL_FOAL_VERSION, PONYMAIL_SERVER_VERSION)
         )
         # Load configuration
         yml = yaml.safe_load(open(args.config))
@@ -111,7 +110,7 @@ class Server(plugins.server.BaseServer):
 
         # Define response headers first...
         headers = {
-            "Server": "Apache Pony Mail (Foal/%s ~%s)" % (PONYMAIL_FOAL_VERSION, PONYMAIL_PLUGIN_VERSION),
+            "Server": "Apache Pony Mail (Foal/%s ~%s)" % (PONYMAIL_FOAL_VERSION, PONYMAIL_SERVER_VERSION),
         }
 
         # Figure out who is going to handle this request, if any
diff --git a/server/server_version.py b/server/server_version.py
new file mode 100644
index 0000000..b94c0fc
--- /dev/null
+++ b/server/server_version.py
@@ -0,0 +1,2 @@
+# This file is generated by server/update_version.sh
+PONYMAIL_SERVER_VERSION = 'd1b9612'
diff --git a/server/update_version.sh b/server/update_version.sh
index 71b1dca..afde850 100755
--- a/server/update_version.sh
+++ b/server/update_version.sh
@@ -7,10 +7,17 @@ FILE=main.py
 
 test -r $FILE || { echo "Must be run from the directory containing $FILE!"; exit 1; }
 
-# plugin revision (for updating HTML)
-PLUGINS_REV=$(git log -1 --pretty=%h -- plugins)
+# Find latest of plugin, endpoint and main.py revisions
+SERVER_REV=$({
+  git log -1 --pretty='%ct %h' -- endpoints
+  git log -1 --pretty='%ct %h' -- plugins
+  git log -1 --pretty='%ct %h' -- main.py
+} | sort -r | head -1 | cut -d' ' -f 2)
 
-echo $PLUGINS_REV
+cat <<EOD >server_version.py
+# This file is generated by server/update_version.sh
+PONYMAIL_SERVER_VERSION = '$SERVER_REV'
+EOD
 
-perl -0pe "s/^PONYMAIL_PLUGIN_VERSION = '[^']*'/PONYMAIL_PLUGIN_VERSION = '$PLUGINS_REV'/smg" \
-  ${FILE} > ${FILE}.tmp && mv ${FILE}.tmp ${FILE}
+# Has it changed?
+git diff --exit-code -- server_version.py

[incubator-ponymail-foal] 02/02: Include endpoints and main.py in version

Posted by se...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git

commit 5c823f2fc75673060febeb0b0100e3ea357d8f23
Author: Sebb <se...@apache.org>
AuthorDate: Tue Nov 30 17:25:11 2021 +0000

    Include endpoints and main.py in version
---
 server/server_version.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/server_version.py b/server/server_version.py
index b94c0fc..f8b7480 100644
--- a/server/server_version.py
+++ b/server/server_version.py
@@ -1,2 +1,2 @@
 # This file is generated by server/update_version.sh
-PONYMAIL_SERVER_VERSION = 'd1b9612'
+PONYMAIL_SERVER_VERSION = 'd623d01'