Add commit ID to build info

[email protected] ("Adiel Cristo via phpdoc")
Newsgroups php.doc
Message-ID <CAD2BokRwz=aHKE2Ng0=8dHNnkqgucPgyDn6BaAPEM_jNUiSQKA@mail.gmail.com>
Hi,

I fixed the pt_br doc build, but for some reason the changes did not
seem to work (or even to be applied) on the remote server.

I added some changes on the doc/base/configure.php file to get the
commit ID (patch attached), but I'm not sure if I have permissions to,
or if I should change this file.

Any thoughts?

Adiel
add-commit-id-to-build-info.patch (text/x-patch, 1.1 KB)
From fb4054713aa0c8a3180ed5b4deb360282a88671e Mon Sep 17 00:00:00 2001
From: Adiel Cristo <[email protected]>
Date: Thu, 28 Jan 2021 21:15:35 -0300
Subject: [PATCH] Add commit ID to build info

---
 configure.php | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/configure.php b/configure.php
index 520e8522..2d12f543 100755
--- a/configure.php
+++ b/configure.php
@@ -24,9 +24,8 @@
 */
 
 error_reporting(-1);
-$cvs_id = '$Id$';
 
-echo "configure.php: $cvs_id\n";
+echo "configure.php\n";
 
 function usage() // {{{
 {
@@ -230,6 +229,16 @@ function print_xml_errors($details = true) {
     libxml_clear_errors();
 } // }}}
 
+function get_commit_id() {
+    global $ac;
+
+    if (is_file($file = $ac['LANGDIR'] . '/.git/refs/heads/master')) {
+        return trim(file_get_contents($file));
+    }
+
+    return '$Id$';
+}
+
 $srcdir  = dirname(__FILE__);
 $workdir = $srcdir;
 $basedir = $srcdir;
@@ -506,6 +515,9 @@ if ($ac['LANGDIR'] == 'trunk') {
 }
 checkvalue("yes");
 
+checking("commit ID");
+checkvalue(get_commit_id());
+
 checking("for partial build");
 checkvalue($ac['PARTIAL']);
 
-- 
2.20.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.