gnucash unstable: Multiple changes pushed

Geert Janssens gjanssens at code.gnucash.org
Thu Oct 26 16:49:14 EDT 2017


Updated	 via  https://github.com/Gnucash/gnucash/commit/1a8cf021 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/67ae2410 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/998f1185 (commit)
	from  https://github.com/Gnucash/gnucash/commit/4be82605 (commit)



commit 1a8cf021d27eb52f59856fbf7f49e0c73c8be6f1
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Thu Oct 26 13:30:29 2017 +0200

    Add GNUCASH_BUILD_ID cmake/configure variable which allows packagers to define their own
    
    For example distros may want to set the version of their package source (rpm, dpkg,...) rather than
    our git id.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f6f7139..5f6be6f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -72,6 +72,7 @@ OPTION (AUTOTOOLS_IN_DIST "Add autotools support to distribution tarballs." ON)
 
 # These are also settable from the command line in a similar way.
 
+SET(GNUCASH_BUILD_ID "" CACHE STRING "Overrides the GnuCash build identification (Build ID) which defaults to a description of the vcs commit from which gnucash is built. Distributions may want to insert a package management based version number instead")
 SET(BINDIR ${CMAKE_INSTALL_PREFIX}/bin CACHE STRING "user executables")
 SET(SYSCONFDIR ${CMAKE_INSTALL_PREFIX}/etc CACHE STRING "read-only single-machine data")
 SET(DATAROOTDIR ${CMAKE_INSTALL_PREFIX}/share CACHE STRING "read-only arch.-independent data root")
diff --git a/common/config.h.cmake.in b/common/config.h.cmake.in
index fe6ecc9..34e7e9c 100644
--- a/common/config.h.cmake.in
+++ b/common/config.h.cmake.in
@@ -49,6 +49,11 @@
 /* Don't use deprecated gnome functions */
 #cmakedefine GNOME_DISABLE_DEPRECATED
 
+/* GnuCash build identification, which defaults to a description of the vcs
+   commit from which gnucash is built. Distributions may want to insert a
+   package management based version string instead. */
+#define GNUCASH_BUILD_ID "@GNUCASH_BUILD_ID@"
+
 /* Most recent stable GnuCash series */
 #define GNUCASH_LATEST_STABLE_SERIES "@GNUCASH_LATEST_STABLE_SERIES@"
 
diff --git a/configure.ac b/configure.ac
index fcf0a37..6592592 100644
--- a/configure.ac
+++ b/configure.ac
@@ -96,6 +96,14 @@ AC_DEFINE_UNQUOTED(GNUCASH_RESAVE_VERSION, $GNUCASH_RESAVE_VERSION,
 AC_DEFINE_UNQUOTED(GNUCASH_LATEST_STABLE_SERIES, "$GNUCASH_LATEST_STABLE_SERIES",
     [Most recent stable GnuCash series])
 
+AC_ARG_VAR([GNUCASH_BUILD_ID],[Overrides the GnuCash build identification (Build ID) which defaults
+to a description of the vcs commit from which gnucash is built. Distributions may want to insert a package
+management based version number instead])
+AC_DEFINE_UNQUOTED(GNUCASH_BUILD_ID, "$GNUCASH_BUILD_ID",
+                   [GnuCash build identification, which defaults
+                   to a description of the vcs commit from which gnucash is built. Distributions may want
+                   to insert a package management based version string instead.])
+
 dnl Set of available languages:
 dnl managed at the Translation Project:
 TP_LINGUAS="az ca cs da eu fa ja nl rw sk sr sv tr uk zh_CN"
diff --git a/gnucash/gnome-utils/gnc-main-window.c b/gnucash/gnome-utils/gnc-main-window.c
index 6944fcd..ea67b82 100644
--- a/gnucash/gnome-utils/gnc-main-window.c
+++ b/gnucash/gnome-utils/gnc-main-window.c
@@ -4476,14 +4476,20 @@ gnc_main_window_cmd_help_about (GtkAction *action, GncMainWindow *window)
                                                     GTK_ICON_LOOKUP_USE_BUILTIN,
                                                     NULL);
 
-
 #ifdef GNC_VCS
         vcs = GNC_VCS " ";
 #else
         vcs = "";
 #endif
-        version = g_strdup_printf ("%s: %s\n%s: %s%s (%s)", _("Version"), VERSION,
-                                   _("Build ID"), vcs, GNC_VCS_REV, GNC_VCS_REV_DATE);
+
+        /* Allow builder to override the build id (eg distributions may want to
+         * print an package source version number (rpm, dpkg,...) instead of our git ref */
+        if (g_strcmp0("", GNUCASH_BUILD_ID) != 0)
+            version = g_strdup_printf ("%s: %s\n%s: %s", _("Version"), VERSION,
+                                       _("Build ID"), GNUCASH_BUILD_ID);
+        else
+            version = g_strdup_printf ("%s: %s\n%s: %s%s (%s)", _("Version"), VERSION,
+                                       _("Build ID"), vcs, GNC_VCS_REV, GNC_VCS_REV_DATE);
 	priv->about_dialog = gtk_about_dialog_new ();
 	g_object_set (priv->about_dialog,
 		      "authors", authors,
diff --git a/gnucash/gnome-utils/gnc-splash.c b/gnucash/gnome-utils/gnc-splash.c
index d8c6378..1cb20b3 100644
--- a/gnucash/gnome-utils/gnc-splash.c
+++ b/gnucash/gnome-utils/gnc-splash.c
@@ -93,14 +93,22 @@ gnc_show_splash_screen (void)
     gtk_box_set_homogeneous (GTK_BOX (vbox), FALSE);
     hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3);
     gtk_box_set_homogeneous (GTK_BOX (hbox), FALSE);
+
 #ifdef GNC_VCS
     vcs = GNC_VCS " ";
 #else
     vcs = "";
 #endif
-    ver_string = g_strdup_printf("%s: %s, %s: %s%s (%s)", _("Version"),
-                                 VERSION, _("Build ID"), vcs, GNC_VCS_REV,
-                                 GNC_VCS_REV_DATE);
+
+    /* Allow builder to override the build id (eg distributions may want to
+     * print an package source version number (rpm, dpkg,...) instead of our git ref */
+    if (g_strcmp0("", GNUCASH_BUILD_ID) != 0)
+        ver_string = g_strdup_printf("%s: %s, %s: %s", _("Version"),
+                                     VERSION, _("Build ID"), GNUCASH_BUILD_ID);
+    else
+        ver_string = g_strdup_printf("%s: %s, %s: %s%s (%s)", _("Version"),
+                                     VERSION, _("Build ID"), vcs, GNC_VCS_REV,
+                                     GNC_VCS_REV_DATE);
 
     version = gtk_label_new(NULL);
     markup = g_markup_printf_escaped(MARKUP_STRING, ver_string);
diff --git a/gnucash/gnucash-bin.c b/gnucash/gnucash-bin.c
index fb3094a..1569a41 100644
--- a/gnucash/gnucash-bin.c
+++ b/gnucash/gnucash-bin.c
@@ -452,8 +452,15 @@ gnc_parse_command_line(int *argc, char ***argv)
 #else
         vcs = "";
 #endif
-        g_print ("\n%s: %s%s (%s)\n",
-                 _("Build ID"), vcs, GNC_VCS_REV, GNC_VCS_REV_DATE);
+
+        /* Allow builder to override the build id (eg distributions may want to
+         * print an package source version number (rpm, dpkg,...) instead of our git ref */
+        if (g_strcmp0("", GNUCASH_BUILD_ID) != 0)
+            g_print ("\n%s: %s\n",
+                     _("Build ID"), GNUCASH_BUILD_ID);
+        else
+            g_print ("\n%s: %s%s (%s)\n",
+                     _("Build ID"), vcs, GNC_VCS_REV, GNC_VCS_REV_DATE);
         exit(0);
     }
 

commit 67ae241075aa28bb7547bb8cc547fc7242d823fd
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Thu Oct 26 18:13:17 2017 +0200

    Use alternative revision retrieval if git describe is failing
    
    This happens primarily on Travis. It looks like the shallow clone it makes is missing
    tags. So if git describe fails, fall back to only the short commit hash (as we used to do
    previously everywhere).

diff --git a/util/gnc-vcs-info b/util/gnc-vcs-info
index abc8e98..793fc24 100755
--- a/util/gnc-vcs-info
+++ b/util/gnc-vcs-info
@@ -125,8 +125,15 @@ then
     exit 0
   fi
 
-  githead=$("$GIT_CMD" --git-dir "${real_gitdir}" describe)
-  if test $? = 0 ; then
+  githead=$("$GIT_CMD" --git-dir "${real_gitdir}" describe 2>/dev/null)
+  rc=$?
+  if [ $rc != 0 ]; then
+    # On travis describe seems to fail due to missing tags in the git clone the system takes
+    # So specifically to catch those errors, use only the short commit hash as a backup
+    githead=$("$GIT_CMD" --git-dir "${real_gitdir}" log -1 --pretty=format:"%h" HEAD 2>/dev/null)
+    rc=$?
+  fi
+  if [ $rc = 0 ]; then
     /bin/echo -n $githead
     # Add a "+" to the hash if there deleted or modified files (not excluded by .gitignore and friends)
     # "Ignores" untracked files

commit 998f1185c1fc2f74c2bd297c776284a0e94be51e
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Thu Oct 26 13:29:16 2017 +0200

    Improve about dialog layout and contents
    
    The main changes are
    - group version and build information together
    - increase size of application icon and name
    - A more complete copyright notice (including 'Copyright' and 'GnuCash')
    
    The default gtk provided about dialog widget won't allow for much more customization than that...
    
    Note the build info has been condensed and is now based on 'git describe' which
    returns a very concise, yet complete description of a commit starting from
    the last tag that precedes it. This info will also be used anywhere else the build info
    was displayed from now on, simplifying translations as well.

diff --git a/gnucash/gnome-utils/gnc-main-window.c b/gnucash/gnome-utils/gnc-main-window.c
index d008e22..6944fcd 100644
--- a/gnucash/gnome-utils/gnc-main-window.c
+++ b/gnucash/gnome-utils/gnc-main-window.c
@@ -4461,44 +4461,34 @@ gnc_main_window_cmd_help_about (GtkAction *action, GncMainWindow *window)
 
     if (priv->about_dialog == NULL)
     {
-	const gchar *fixed_message = _("The GnuCash personal finance manager. "
-                                   "The GNU way to manage your money!");
-	gchar *copyright = g_strdup_printf(_("© 1997-%s Contributors"),
+        /* Translators: %s will be replaced with the current year */
+	gchar *copyright = g_strdup_printf(_("Copyright © 1997-%s The GnuCash contributors."),
                                            GNC_VCS_REV_YEAR);
 	gchar **authors = get_file_strsplit("AUTHORS");
 	gchar **documenters = get_file_strsplit("DOCUMENTERS");
 	gchar *license = get_file("LICENSE");
-	gchar *message;
+        gchar *version = NULL;
+        gchar *vcs = NULL;
         GtkIconTheme *icon_theme = gtk_icon_theme_get_default ();
 	GdkPixbuf *logo = gtk_icon_theme_load_icon (icon_theme,
                                                     GNC_ICON_APP,
-                                                    48,
+                                                    128,
                                                     GTK_ICON_LOOKUP_USE_BUILTIN,
                                                     NULL);
 
 
 #ifdef GNC_VCS
-    /* Development version */
-    /* Translators: 1st %s is a fixed message, which is translated independently;
-                    2nd %s is the scm type (svn/svk/git/bzr);
-                    3rd %s is the scm revision number;
-                    4th %s is the build date */
-	message = g_strdup_printf(_("%s\nThis copy was built from %s rev %s (commit date %s)."),
-                                  fixed_message, GNC_VCS, GNC_VCS_REV,
-                                  GNC_VCS_REV_DATE);
+        vcs = GNC_VCS " ";
 #else
-    /* Translators: 1st %s is a fixed message, which is translated independently;
-                    2nd %s is the scm (svn/svk/git/bzr) revision number;
-                    3rd %s is the build date */
-	message = g_strdup_printf(_("%s\nThis copy was built from rev %s (commit date %s)."),
-                                  fixed_message, GNC_VCS_REV,
-                                  GNC_VCS_REV_DATE);
+        vcs = "";
 #endif
+        version = g_strdup_printf ("%s: %s\n%s: %s%s (%s)", _("Version"), VERSION,
+                                   _("Build ID"), vcs, GNC_VCS_REV, GNC_VCS_REV_DATE);
 	priv->about_dialog = gtk_about_dialog_new ();
 	g_object_set (priv->about_dialog,
 		      "authors", authors,
 		      "documenters", documenters,
-		      "comments", message,
+		      "comments", _("Accounting for personal and small business finance."),
 		      "copyright", copyright,
 		      "license", license,
 		      "logo", logo,
@@ -4508,11 +4498,12 @@ gnc_main_window_cmd_help_about (GtkAction *action, GncMainWindow *window)
       * The string can have multiple rows, so you can also add a list of
       * contributors. */
 		      "translator-credits", _("translator_credits"),
-		      "version", VERSION,
+		      "version", version,
 		      "website", "http://www.gnucash.org",
+		      "website_label", _("Visit the GnuCash website."),
 		      NULL);
 
-	g_free(message);
+        g_free(version);
 	g_free(copyright);
 	if (license)     g_free(license);
 	if (documenters) g_strfreev(documenters);
diff --git a/gnucash/gnome-utils/gnc-splash.c b/gnucash/gnome-utils/gnc-splash.c
index 449a72d..d8c6378 100644
--- a/gnucash/gnome-utils/gnc-splash.c
+++ b/gnucash/gnome-utils/gnc-splash.c
@@ -60,7 +60,7 @@ gnc_show_splash_screen (void)
     GtkWidget *hbox;
     GtkWidget *version;
     GtkWidget *separator;
-    gchar *ver_string, *markup;
+    gchar *ver_string, *markup, *vcs;
 
     if (splash) return;
     if (!gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_SHOW_SPLASH)) return;
@@ -94,22 +94,13 @@ gnc_show_splash_screen (void)
     hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3);
     gtk_box_set_homogeneous (GTK_BOX (hbox), FALSE);
 #ifdef GNC_VCS
-    /* Development version */
-    /* Translators: 1st %s is the GnuCash version (eg 2.4.11);
-                    2nd %s is the scm type (svn/svk/git/bzr);
-                    3rd %s is the scm revision number;
-                    4th %s is the build date */
-    ver_string = g_strdup_printf(_("Version: GnuCash-%s %s (rev %s, commit date %s)"),
-                                 VERSION, GNC_VCS, GNC_VCS_REV,
-                                 GNC_VCS_REV_DATE);
+    vcs = GNC_VCS " ";
 #else
-    /* Dist Tarball */
-    /* Translators: 1st %s is the GnuCash version (eg 2.4.11);
-                    2nd %s is the scm (svn/svk/git/bzr) revision number;
-                    3rd %s is the build date */
-    ver_string = g_strdup_printf(_("Version: GnuCash-%s (rev %s, commit date %s)"),
-                                 VERSION, GNC_VCS_REV, GNC_VCS_REV_DATE);
+    vcs = "";
 #endif
+    ver_string = g_strdup_printf("%s: %s, %s: %s%s (%s)", _("Version"),
+                                 VERSION, _("Build ID"), vcs, GNC_VCS_REV,
+                                 GNC_VCS_REV_DATE);
 
     version = gtk_label_new(NULL);
     markup = g_markup_printf_escaped(MARKUP_STRING, ver_string);
diff --git a/gnucash/gnome-utils/ui/gnucash.css b/gnucash/gnome-utils/ui/gnucash.css
index 7ed35d1..812d063 100644
--- a/gnucash/gnome-utils/ui/gnucash.css
+++ b/gnucash/gnome-utils/ui/gnucash.css
@@ -64,3 +64,8 @@ cursor button {
   background-color: mix (@register_cursor_bg_color, grey, 0.2);
 }
 
+/* Some tweaks for the about dialog */
+dialog#GnuCash > box > box > label
+{
+    font-size: 24px;
+}
diff --git a/gnucash/gnucash-bin.c b/gnucash/gnucash-bin.c
index d92b7ed..fb3094a 100644
--- a/gnucash/gnucash-bin.c
+++ b/gnucash/gnucash-bin.c
@@ -425,9 +425,8 @@ load_user_config(void)
 static void
 gnc_parse_command_line(int *argc, char ***argv)
 {
-
     GError *error = NULL;
-    GOptionContext *context = g_option_context_new (_("- GnuCash personal and small business finance management"));
+    GOptionContext *context = g_option_context_new (_("- GnuCash, accounting for personal and small business finance"));
 
     g_option_context_add_main_entries (context, options, GETTEXT_PACKAGE);
     g_option_context_add_group (context, gtk_get_option_group(FALSE));
@@ -439,35 +438,22 @@ gnc_parse_command_line(int *argc, char ***argv)
         exit (1);
     }
     g_option_context_free (context);
-
     if (gnucash_show_version)
     {
-        gchar *fixed_message;
+        gchar *vcs;
 
         if (is_development_version)
-        {
-            fixed_message = g_strdup_printf(_("GnuCash %s development version"), VERSION);
-
-            /* Translators: 1st %s is a fixed message, which is translated independently;
-                            2nd %s is the scm type (svn/svk/git/bzr);
-                            3rd %s is the scm revision number;
-                            4th %s is the build date */
-            g_print ( _("%s\nThis copy was built from %s rev %s (commit date %s)."),
-                      fixed_message, GNC_VCS, GNC_VCS_REV,
-                      GNC_VCS_REV_DATE );
-        }
+            g_print (_("GnuCash %s development version"), VERSION);
         else
-        {
-            fixed_message = g_strdup_printf(_("GnuCash %s"), VERSION);
+            g_print (_("GnuCash %s"), VERSION);
 
-            /* Translators: 1st %s is a fixed message, which is translated independently;
-                            2nd %s is the scm (svn/svk/git/bzr) revision number;
-                            3rd %s is the build date */
-            g_print ( _("%s\nThis copy was built from rev %s (commit date %s)."),
-                      fixed_message, GNC_VCS_REV, GNC_VCS_REV_DATE );
-        }
-        g_print("\n");
-        g_free (fixed_message);
+#ifdef GNC_VCS
+        vcs = GNC_VCS " ";
+#else
+        vcs = "";
+#endif
+        g_print ("\n%s: %s%s (%s)\n",
+                 _("Build ID"), vcs, GNC_VCS_REV, GNC_VCS_REV_DATE);
         exit(0);
     }
 
diff --git a/util/gnc-vcs-info b/util/gnc-vcs-info
index 8f2c9dc..abc8e98 100755
--- a/util/gnc-vcs-info
+++ b/util/gnc-vcs-info
@@ -104,7 +104,6 @@ then
 fi
 
 # If we get here then this is NOT an svn checkout.
-
 # Maybe it's git?
 real_gitdir="${real_srcdir}"/.git
 if test -d "${real_gitdir}"
@@ -126,7 +125,7 @@ then
     exit 0
   fi
 
-  githead=`"$GIT_CMD" --git-dir "${real_gitdir}" log -1 --pretty=format:"%h" HEAD 2>/dev/null`  # short hash only
+  githead=$("$GIT_CMD" --git-dir "${real_gitdir}" describe)
   if test $? = 0 ; then
     /bin/echo -n $githead
     # Add a "+" to the hash if there deleted or modified files (not excluded by .gitignore and friends)



Summary of changes:
 CMakeLists.txt                        |  1 +
 common/config.h.cmake.in              |  5 ++++
 configure.ac                          |  8 +++++++
 gnucash/gnome-utils/gnc-main-window.c | 43 ++++++++++++++++-------------------
 gnucash/gnome-utils/gnc-splash.c      | 29 ++++++++++++-----------
 gnucash/gnome-utils/ui/gnucash.css    |  5 ++++
 gnucash/gnucash-bin.c                 | 43 +++++++++++++++--------------------
 util/gnc-vcs-info                     | 12 +++++++---
 8 files changed, 80 insertions(+), 66 deletions(-)



More information about the gnucash-changes mailing list