Commit eac6711f authored by Debarshi Ray's avatar Debarshi Ray

Mention the latest commit in the version for non-release builds

Now that we are shipping nightly Flatpaks, it is important to know
the latest commit ID that is part of the build. Otherwise, it will be
hard to separate one nightly Flatpak from another.
parent 0c116b5f
......@@ -20,6 +20,12 @@ AX_IS_RELEASE([git-directory])
AX_CHECK_ENABLE_DEBUG([yes],,, [$ax_is_release])
AX_COMPILER_FLAGS([WARN_CFLAGS], [WARN_LDFLAGS], [$ax_is_release])
AS_IF([test "x$ax_is_release" != "xyes"], [PACKAGE_COMMIT_ID=$(git describe)])
AS_IF([test -n "$PACKAGE_COMMIT_ID"],
[AC_DEFINE_UNQUOTED([PACKAGE_COMMIT_ID],
["$PACKAGE_COMMIT_ID"],
[Define to the description of this package's latest commit.])])
AC_CANONICAL_HOST
AC_PROG_CC
AC_PROG_CC_C_O
......
......@@ -1610,7 +1610,10 @@ photos_application_handle_local_options (GApplication *application, GVariantDict
if (g_variant_dict_contains (options, "version"))
{
g_print ("%s %s\n", PACKAGE_TARNAME, PACKAGE_VERSION);
const gchar *version;
version = photos_utils_get_version ();
g_print ("%s %s\n", PACKAGE_TARNAME, version);
ret_val = EXIT_SUCCESS;
}
......
......@@ -36,6 +36,7 @@
#include "photos-preview-view.h"
#include "photos-search-context.h"
#include "photos-selection-controller.h"
#include "photos-utils.h"
struct _PhotosMainWindow
......@@ -481,10 +482,13 @@ photos_main_window_show_about (PhotosMainWindow *self)
{
GApplication *app;
const gchar *app_id;
const gchar *version;
app = g_application_get_default ();
app_id = g_application_get_application_id (app);
version = photos_utils_get_version ();
gtk_show_about_dialog (GTK_WINDOW (self),
"artists", PHOTOS_ARTISTS,
"authors", PHOTOS_AUTHORS,
......@@ -495,7 +499,7 @@ photos_main_window_show_about (PhotosMainWindow *self)
"license-type", GTK_LICENSE_GPL_2_0,
"logo-icon-name", app_id,
"program-name", _(PACKAGE_NAME),
"version", PACKAGE_VERSION,
"version", version,
"website", PACKAGE_URL,
"wrap-license", TRUE,
/* Translators: Put your names here */
......
......@@ -1139,6 +1139,21 @@ photos_utils_get_urns_from_items (GList *items)
}
const gchar *
photos_utils_get_version (void)
{
const gchar *ret_val = NULL;
#ifdef PACKAGE_COMMIT_ID
ret_val = PACKAGE_COMMIT_ID;
#else
ret_val = PACKAGE_VERSION;
#endif
return ret_val;
}
GIcon *
photos_utils_icon_from_rdf_type (const gchar *type)
{
......
......@@ -147,6 +147,8 @@ gchar *photos_utils_get_thumbnail_path_for_uri (const gchar *uri);
GList *photos_utils_get_urns_from_items (GList *items);
const gchar *photos_utils_get_version (void);
GIcon *photos_utils_icon_from_rdf_type (const gchar *type);
void photos_utils_list_box_header_func (GtkListBoxRow *row,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment