Compare commits

...

3 Commits

4 changed files with 14 additions and 9 deletions

View File

@ -25,6 +25,11 @@ DEFINES += QT_DEPRECATED_WARNINGS
# a command.
# 1.3.8 : Remove accessing opkg_commands under file-system-path /etc/psa_update.
# Activate download of json-configuration files.
# 1.3.9 : Fix sendLastVersion: use configured branch and not master branch in
# git show origin/master -s --format="c=%h m=%s d=%cI" ==>
# git show origin/zg1/zone1 -s --format="c=%h m=%s d=%cI"
# Use dynamic values for os-release and apism-version when sending
# last version info.
win32 {
BUILD_DATE=$$system("date /t")

View File

@ -114,16 +114,14 @@ bool GitClient::gitCloneAndCheckoutBranch() {
return false;
}
QStringList GitClient::gitShowReason() {
QStringList GitClient::gitShowReason(QString branchName) {
QStringList lst;
if (QDir(m_customerRepository).exists()) {
// %h: commit (short form)
// %s: commit message
// %cI: commit date, strict ISO 8601 format
// Note: use master branch. By convention, there is a ChangeLog file
// in the root of the repository, which has to be always the last file
// to be checked in when the customer repository somehow changed.
Command c("git show origin/master -s --format=\"c=%h m=%s d=%cI\"");
// Note: branch with branchName has to exist: format zg1/zone1
Command c(QString("git show origin/%1 -s --format=\"c=%h m=%s d=%cI\"").arg(branchName));
if (c.execute(m_customerRepository)) {
QString const s = c.getCommandResult().trimmed();
int const c = s.indexOf("c=");

View File

@ -50,7 +50,7 @@ class GitClient : public QObject {
std::optional<QStringList> gitMerge();
QString gitLastCommit(QString fileName);
QStringList gitShowReason();
QStringList gitShowReason(QString branchName);
static QString gitBlob(QString fileName);
QString gitCommitForBlob(QString blob);
bool gitIsFileTracked(QString file2name);

View File

@ -1089,7 +1089,7 @@ PSAInstalled Worker::getPSAInstalled() {
psaInstalled.versionInfo.reason = "";
psaInstalled.versionInfo.created = "";
QStringList versionInfo = m_gc.gitShowReason();
QStringList versionInfo = m_gc.gitShowReason(m_branchName);
if (versionInfo.size() == 3) {
psaInstalled.versionInfo.lastCommit = versionInfo.at(0);
psaInstalled.versionInfo.reason = versionInfo.at(1);
@ -1111,7 +1111,7 @@ PSAInstalled Worker::getPSAInstalled() {
psaInstalled.tariff.info = "N/A";
psaInstalled.tariff.version = "N/A";
psaInstalled.hw.linuxVersion = m_osVersion;
psaInstalled.hw.linuxVersion = getOsVersion();
psaInstalled.hw.cpuSerial = m_cpuSerial;
psaInstalled.opkg.blob = m_gc.gitBlob(absPathNameRepositoryOpkg);
@ -1125,7 +1125,9 @@ PSAInstalled Worker::getPSAInstalled() {
psaInstalled.dc.gitLastCommit = "N/A";
psaInstalled.dc.size = -1;
psaInstalled.sw.apismVersion = m_apismVersion;
if (std::optional<QString> v = getApismVersion()) {
psaInstalled.sw.apismVersion = v.value();
}
psaInstalled.sw.atbQTVersion = m_atbqtVersion;
psaInstalled.pluginVersion.deviceController = m_pluginVersionATBDeciceController;