diff options
| author | hibby <d@vehibberd.com> | 2026-10-06 21:24:40 +0100 |
|---|---|---|
| committer | hibby <d@vehibberd.com> | 2026-10-06 21:24:40 +0100 |
| commit | c25cbdf6fb6d946175f4335fab77bfea601b56db (patch) | |
| tree | 6f7a94b7b81f999e434f61b73d47e337dfd26bf2 /revision_utils_wsjtx.cpp | |
| parent | 71f5689252c9f13e70e1c24856904475b2307809 (diff) | |
| parent | 0685fcada9f95fe90f70b387cd7d757da8209624 (diff) | |
Merge tag 'debian/3.2.0_rc1+dfsg-2' into debian/trixie-backportsdebian/trixie-backports
tagging wsjtx 3.2.0~rc1+dfsg-2
Diffstat (limited to 'revision_utils_wsjtx.cpp')
| -rw-r--r-- | revision_utils_wsjtx.cpp | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/revision_utils_wsjtx.cpp b/revision_utils_wsjtx.cpp deleted file mode 100644 index c96e9e95..00000000 --- a/revision_utils_wsjtx.cpp +++ /dev/null @@ -1,85 +0,0 @@ -#include "revision_utils.hpp" - -#include <cstring> - -#include <QCoreApplication> -#include <QRegularExpression> - -#include "scs_version.h" - -namespace -{ - QString revision_extract_number (QString const& s) - { - QString revision; - - // try and match a number (hexadecimal allowed) - QRegularExpression re {R"(^[$:]\w+: (r?[\da-f]+[^$]*)\$$)"}; - auto match = re.match (s); - if (match.hasMatch ()) - { - revision = match.captured (1); - } - return revision; - } -} - -QString revision (QString const& scs_rev_string) -{ - return "251203"; - QString result; - auto revision_from_scs = revision_extract_number (scs_rev_string); - -#if defined (CMAKE_BUILD) - QString scs_info {":Rev: " SCS_VERSION_STR " $"}; - - auto revision_from_scs_info = revision_extract_number (scs_info); - if (!revision_from_scs_info.isEmpty ()) - { - // we managed to get the revision number from svn info etc. - result = revision_from_scs_info; - } - else if (!revision_from_scs.isEmpty ()) - { - // fall back to revision passed in if any - result = revision_from_scs; - } - else - { - // match anything - QRegularExpression re {R"(^[$:]\w+: ([^$]*)\$$)"}; - auto match = re.match (scs_info); - if (match.hasMatch ()) - { - result = match.captured (1); - } - } -#else - if (!revision_from_scs.isEmpty ()) - { - // not CMake build so all we have is revision passed - result = revision_from_scs; - } -#endif - return result.trimmed (); -} - -QString version (bool include_patch) -{ -#if defined (CMAKE_BUILD) - QString v {TO_STRING__ (PROJECT_VERSION_MAJOR) "." TO_STRING__ (PROJECT_VERSION_MINOR)}; - if (include_patch) - { - v += "." TO_STRING__ (PROJECT_VERSION_PATCH) + QString {BUILD_TYPE_REVISION}; - } -#else - QString v {"Not for Release"}; -#endif - return v; -} - -QString program_title (QString const& revision) -{ - QString id {QCoreApplication::applicationName () + " v" + QCoreApplication::applicationVersion ()}; - return id + " " + revision; -} |
