[Github-comments] [geany/geany] RFC: Include Scintilla version in debug info (Discussion #3108)

Robert Di Pardo notifications at xxxxx
Sat Jan 22 02:52:25 UTC 2022


> But one question that applies to both it and any script is how to know where the digits in the `version.txt` split, past contents have been `3211`. So without human intervention how will a script/program know if it is 3.21.1 (correct) or 3.2.11 (incorrect) or something else?

The "script" I had in mind is just a `sed` one-liner, based on Neil's own suggestion from a while back:

> $ sed -e "s/\(.\)\(.\)\(.\)/\1.\2.\3/" < ~/merc/scintilla/version.txt
<https://groups.google.com/g/scintilla-interest/c/6Ertem36m_M/m/kvKhJQReAQAJ>

Of course this assumes a single-digit major and minor number; the micro version can be any length.
Dealing with double-digit major/minor increments might be unavoidable, but it would most likely be a rare occurrence.

> If it needs human intervention it can't be runtime or makefile or configure, it could only be at update-scintilla.sh time.

I wouldn't suggest changing `update-scintilla.sh` for such a trivial feature. If the preference is to keep `config.h` generation as it is &#x2014; and assuming 5.1.xx doesn't jump to 5.10.xx anytime soon &#x2014; the least intrusive solution might look something like this:

```diff
diff --git a/src/Makefile.am b/src/Makefile.am
index 8acddfb8..cf7abcda 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -20,6 +20,7 @@ AM_CPPFLAGS = \
        -DGTK \
        -DGEANY_PRIVATE \
        -DG_LOG_DOMAIN=\""Geany"\" \
+       -DSCI_VER=\""`sed -e 's/\(.\)\(.\)\(.\)/\1.\2.\3/' < $(top_srcdir)/scintilla/version.txt`"\" \
        @GTK_CFLAGS@ @GTHREAD_CFLAGS@ \
        $(MAC_INTEGRATION_CFLAGS)

diff --git a/src/libmain.c b/src/libmain.c
index d316f440..3d5437f0 100644
--- a/src/libmain.c
+++ b/src/libmain.c
@@ -93,6 +93,10 @@ static gchar *original_cwd = NULL;

 static const gchar geany_lib_versions[] = "GTK %u.%u.%u, GLib %u.%u.%u";

+#ifdef SCI_VER
+static const gchar geany_scintilla_version[] = "Scintilla %s";
+#endif
+
 static gboolean want_plugins;

 /* command-line options */
@@ -1105,6 +1109,10 @@ gint main_lib(gint argc, gchar **argv)
                gtk_major_version, gtk_minor_version, gtk_micro_version,
                glib_major_version, glib_minor_version, glib_micro_version);

+#ifdef SCI_VER
+       geany_debug(geany_scintilla_version, SCI_VER);
+#endif
+
        os_info = utils_get_os_info_string();
        if (os_info != NULL)
        {
```
_Lexilla version left out for brevity_

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/discussions/3108#discussioncomment-2020495
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/repo-discussions/3108/comments/2020495 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20220121/6367acec/attachment.htm>


More information about the Github-comments mailing list