mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-10-31 15:47:10 -04:00
Abandon getting changeset revision number from svn keyword expansion
Subversion keyword expansion of $Rev:$ in a file is hopeless as it is impossible to coordinate with a release. Revert to an empty string when it can't be discovered with svn info etc.. Further changes to the way verion and revision numbers are generated Local builds from source tar balls or the two phase wsjtx-superbuild no longer specify any revision, just the version number. Since these sort of builds are expected to be release candidates or release versions the revision (svn changeset number) is implicit from the svn tag of the version. Merged from wsjtx-1.4 branch. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4986 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
ffb61eb28d
commit
8736e39643
@ -45,7 +45,7 @@ else (Subversion_FOUND AND EXISTS "${SOURCE_DIR}/.svn")
|
|||||||
# write a file with the SVNVERSION define
|
# write a file with the SVNVERSION define
|
||||||
file (WRITE "${OUTPUT_DIR}/svnversion.h.txt" "#define SVNVERSION r${MY_WC_LAST_CHANGED_REV}\n")
|
file (WRITE "${OUTPUT_DIR}/svnversion.h.txt" "#define SVNVERSION r${MY_WC_LAST_CHANGED_REV}\n")
|
||||||
else (Subversion_FOUND AND EXISTS "${SOURCE_DIR}/.svn")
|
else (Subversion_FOUND AND EXISTS "${SOURCE_DIR}/.svn")
|
||||||
file (WRITE "${OUTPUT_DIR}/svnversion.h.txt" "#define SVNVERSION local\n")
|
file (WRITE "${OUTPUT_DIR}/svnversion.h.txt" "#define SVNVERSION\n")
|
||||||
endif (Subversion_FOUND AND EXISTS "${SOURCE_DIR}/.git")
|
endif (Subversion_FOUND AND EXISTS "${SOURCE_DIR}/.git")
|
||||||
endif (Subversion_FOUND AND EXISTS "${SOURCE_DIR}/.svn")
|
endif (Subversion_FOUND AND EXISTS "${SOURCE_DIR}/.svn")
|
||||||
|
|
||||||
|
8
main.cpp
8
main.cpp
@ -44,13 +44,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Override programs executable basename as application name.
|
// Override programs executable basename as application name.
|
||||||
a.setApplicationName ("WSJT-X");
|
a.setApplicationName ("WSJT-X");
|
||||||
#if CMAKE_BUILD
|
a.setApplicationVersion (version ());
|
||||||
a.setApplicationVersion (WSJTX_STRINGIZE (WSJTX_VERSION_MAJOR)
|
|
||||||
"." WSJTX_STRINGIZE (WSJTX_VERSION_MINOR)
|
|
||||||
"." WSJTX_STRINGIZE (WSJTX_VERSION_PATCH) " " + revision ());
|
|
||||||
#else
|
|
||||||
a.setApplicationVersion ("Not for Release");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool multiple {false};
|
bool multiple {false};
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ MainWindow::MainWindow(bool multiple, QSettings * settings, QSharedMemory *shdme
|
|||||||
unsigned downSampleFactor, QWidget *parent) :
|
unsigned downSampleFactor, QWidget *parent) :
|
||||||
QMainWindow(parent),
|
QMainWindow(parent),
|
||||||
m_dataDir {QStandardPaths::writableLocation (QStandardPaths::DataLocation)},
|
m_dataDir {QStandardPaths::writableLocation (QStandardPaths::DataLocation)},
|
||||||
m_revision {revision ("$Rev$")},
|
m_revision {revision ()},
|
||||||
m_multiple {multiple},
|
m_multiple {multiple},
|
||||||
m_settings (settings),
|
m_settings (settings),
|
||||||
ui(new Ui::MainWindow),
|
ui(new Ui::MainWindow),
|
||||||
@ -3134,7 +3134,7 @@ void MainWindow::pskSetLocal ()
|
|||||||
psk_Reporter->setLocalStation(
|
psk_Reporter->setLocalStation(
|
||||||
m_config.my_callsign ()
|
m_config.my_callsign ()
|
||||||
, m_config.my_grid ()
|
, m_config.my_grid ()
|
||||||
, antenna_description, "WSJT-X " + m_revision);
|
, antenna_description, program_title (m_revision));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::transmitDisplay (bool transmitting)
|
void MainWindow::transmitDisplay (bool transmitting)
|
||||||
|
@ -40,12 +40,7 @@ QString revision (QString const& svn_rev_string)
|
|||||||
}
|
}
|
||||||
else if (!revision_from_svn.isEmpty ())
|
else if (!revision_from_svn.isEmpty ())
|
||||||
{
|
{
|
||||||
// fall back to revision in ths file, this is potentially
|
// fall back to revision passed in if any
|
||||||
// wrong because svn only updates the id when this file is
|
|
||||||
// touched
|
|
||||||
//
|
|
||||||
// this case gets us a revision when someone builds from a
|
|
||||||
// source snapshot or copy
|
|
||||||
result = revision_from_svn;
|
result = revision_from_svn;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -61,23 +56,33 @@ QString revision (QString const& svn_rev_string)
|
|||||||
#else
|
#else
|
||||||
if (!revision_from_svn.isEmpty ())
|
if (!revision_from_svn.isEmpty ())
|
||||||
{
|
{
|
||||||
// not CMake build so all we have is svn revision in this file
|
// not CMake build so all we have is revision passed
|
||||||
result = revision_from_svn;
|
result = revision_from_svn;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (result.isEmpty ())
|
|
||||||
{
|
|
||||||
result = "local"; // last resort fall back
|
|
||||||
}
|
|
||||||
return result.trimmed ();
|
return result.trimmed ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString version ()
|
||||||
|
{
|
||||||
|
#if defined (CMAKE_BUILD)
|
||||||
|
QString v {WSJTX_STRINGIZE (WSJTX_VERSION_MAJOR) "." WSJTX_STRINGIZE (WSJTX_VERSION_MINOR) "." WSJTX_STRINGIZE (WSJTX_VERSION_PATCH)};
|
||||||
|
# if defined (WSJTX_RC)
|
||||||
|
v += "-rc" WSJTX_STRINGIZE (WSJTX_RC);
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
QString v {"Not for Release"};
|
||||||
|
#endif
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
QString program_title (QString const& revision)
|
QString program_title (QString const& revision)
|
||||||
{
|
{
|
||||||
|
QString id {QCoreApplication::applicationName ()};
|
||||||
#if defined (CMAKE_BUILD)
|
#if defined (CMAKE_BUILD)
|
||||||
QString id {QCoreApplication::applicationName () + " v" WSJTX_STRINGIZE (WSJTX_VERSION_MAJOR) "." WSJTX_STRINGIZE (WSJTX_VERSION_MINOR) "." WSJTX_STRINGIZE (WSJTX_VERSION_PATCH)};
|
id += " v" + version ();
|
||||||
#else
|
#else
|
||||||
QString id {"WSJT-X Not for Release"};
|
id += " Not for Release";
|
||||||
#endif
|
#endif
|
||||||
return id + " " + revision + " by K1JT";
|
return id + " " + revision + " by K1JT";
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
QString revision (QString const& svn_rev_string = QString {});
|
QString revision (QString const& svn_rev_string = QString {});
|
||||||
|
QString version ();
|
||||||
QString program_title (QString const& revision = QString {});
|
QString program_title (QString const& revision = QString {});
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user