From 811a45aa128bcb0bc93ffe790c1d540d7fcc00f9 Mon Sep 17 00:00:00 2001 From: chrfranke <chrfranke@4ea69e1a-61f1-4043-bf83-b5c94c648137> Date: Tue, 1 Mar 2022 20:01:25 +0000 Subject: [PATCH] configure.ac: Comment out release timestamp. Set related environment vars only if timestamp is set. utility.cpp: Add "pre-" or "pre-release" if release timestamp is not set. Don't print empty timestamp. git-svn-id: https://svn.code.sf.net/p/smartmontools/code/trunk@5341 4ea69e1a-61f1-4043-bf83-b5c94c648137 --- smartmontools/ChangeLog | 7 +++++++ smartmontools/configure.ac | 14 +++++++++----- smartmontools/utility.cpp | 12 ++++++++++-- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/smartmontools/ChangeLog b/smartmontools/ChangeLog index 7f6ea2fcb..06fdcbf9d 100644 --- a/smartmontools/ChangeLog +++ b/smartmontools/ChangeLog @@ -1,5 +1,12 @@ $Id$ +2022-02-29 Christian Franke <franke@computer.org> + + configure.ac: Comment out release timestamp. + Set related environment vars only if timestamp is set. + utility.cpp: Add "pre-" or "pre-release" if release + timestamp is not set. Don't print empty timestamp. + 2022-02-28 Douglas Gilbert <dgilbert@interlog.com> utility.cpp: the previous patch bumped the version number diff --git a/smartmontools/configure.ac b/smartmontools/configure.ac index c1bc8528e..d8f539536 100644 --- a/smartmontools/configure.ac +++ b/smartmontools/configure.ac @@ -9,13 +9,17 @@ AM_INIT_AUTOMAKE([1.10 foreign]) # Version of drive database branch smartmontools_drivedb_version=7.3 -smartmontools_cvs_tag=`echo '$Id$'` -smartmontools_release_date=2022-02-28 -smartmontools_release_time="16:33:40 UTC" +# Set by 'do_release' script, commented out when release number is bumped. +smartmontools_release_date= # 2022-02-28 +smartmontools_release_time= # "16:33:40 UTC" + +if test -n "$smartmontools_release_date"; then + AC_DEFINE_UNQUOTED(SMARTMONTOOLS_RELEASE_DATE, "$smartmontools_release_date", [smartmontools Release Date]) + AC_DEFINE_UNQUOTED(SMARTMONTOOLS_RELEASE_TIME, "$smartmontools_release_time", [smartmontools Release Time]) +fi +smartmontools_cvs_tag=`echo '$Id$'` AC_DEFINE_UNQUOTED(SMARTMONTOOLS_CONFIGURE_ARGS, "$ac_configure_args", [smartmontools Configure Arguments]) -AC_DEFINE_UNQUOTED(SMARTMONTOOLS_RELEASE_DATE, "$smartmontools_release_date", [smartmontools Release Date]) -AC_DEFINE_UNQUOTED(SMARTMONTOOLS_RELEASE_TIME, "$smartmontools_release_time", [smartmontools Release Time]) AC_DEFINE_UNQUOTED(CONFIG_H_CVSID, "$smartmontools_cvs_tag", [smartmontools CVS Tag]) AC_DEFINE_UNQUOTED(PACKAGE_HOMEPAGE, "https://www.smartmontools.org/", [smartmontools Home Page]) diff --git a/smartmontools/utility.cpp b/smartmontools/utility.cpp index 791d8287f..1e2e4c96c 100644 --- a/smartmontools/utility.cpp +++ b/smartmontools/utility.cpp @@ -86,7 +86,11 @@ const char * packet_types[] = { std::string format_version_info(const char * prog_name, bool full /*= false*/) { std::string info = strprintf( - "%s pre-release " PACKAGE_VERSION " " + "%s " +#ifndef SMARTMONTOOLS_RELEASE_DATE + "pre-" +#endif + PACKAGE_VERSION " " #ifdef SMARTMONTOOLS_SVN_REV SMARTMONTOOLS_SVN_DATE " r" SMARTMONTOOLS_SVN_REV #else @@ -107,8 +111,12 @@ std::string format_version_info(const char * prog_name, bool full /*= false*/) "version 2, or (at your option) any later version.\n" "See https://www.gnu.org for further details.\n" "\n" - "smartmontools pre-release " PACKAGE_VERSION +#ifndef SMARTMONTOOLS_RELEASE_DATE + "smartmontools pre-release " PACKAGE_VERSION "\n" +#else + "smartmontools release " PACKAGE_VERSION " dated " SMARTMONTOOLS_RELEASE_DATE " at " SMARTMONTOOLS_RELEASE_TIME "\n" +#endif #ifdef SMARTMONTOOLS_SVN_REV "smartmontools SVN rev " SMARTMONTOOLS_SVN_REV " dated " SMARTMONTOOLS_SVN_DATE " at " SMARTMONTOOLS_SVN_TIME "\n" -- GitLab