Use and implement getAPISMYoctoVersion() and

getAPISMYoctoInstallationSTatus().
This commit is contained in:
Gerhard Hoffmann 2023-10-30 15:22:59 +01:00
parent fc587456d5
commit fc264689b1

View File

@ -157,9 +157,7 @@ Worker::Worker(int customerNr,
this->setObjectName("worker-object"); this->setObjectName("worker-object");
QDir::setCurrent(m_workingDirectory); QDir::setCurrent(m_workingDirectory);
if (std::optional<QString> v = getApismVersion()) { m_apismVersion = getAPISMYoctoVersion();
m_apismVersion = v.value();
}
this->moveToThread(&m_workerThread); this->moveToThread(&m_workerThread);
m_workerThread.start(); m_workerThread.start();
@ -1045,6 +1043,17 @@ QString Worker::getATBUpdateToolYoctoVersion() {
return "N/A"; return "N/A";
} }
QString Worker::getAPISMYoctoVersion() {
if (QFile::exists("/var/lib/opkg/status")) {
QString const cmd = QString("echo -n $(cat /var/lib/opkg/status | grep -A1 apism | tail -n 1 | cut -d':' -f2 | cut -d' ' -f2)");
Command c("bash");
if (c.execute("/tmp", QStringList() << "-c" << cmd)) {
return c.getCommandResult(); // 1.4.1.0-r4
}
}
return "N/A";
}
QString Worker::getATBUpdateToolYoctoInstallationStatus() { QString Worker::getATBUpdateToolYoctoInstallationStatus() {
if (QFile::exists("/var/lib/opkg/status")) { if (QFile::exists("/var/lib/opkg/status")) {
QString const cmd = QString("echo -n $(cat /var/lib/opkg/status | grep -A3 atbupdatetool | tail -n 1 | cut -d':' -f2 | cut -d' ' -f2,3,4)"); QString const cmd = QString("echo -n $(cat /var/lib/opkg/status | grep -A3 atbupdatetool | tail -n 1 | cut -d':' -f2 | cut -d' ' -f2,3,4)");
@ -1056,6 +1065,16 @@ QString Worker::getATBUpdateToolYoctoInstallationStatus() {
return "N/A"; return "N/A";
} }
QString Worker::getAPISMYoctoInstallationStatus() {
if (QFile::exists("/var/lib/opkg/status")) {
QString const cmd = QString("echo -n $(cat /var/lib/opkg/status | grep -A3 apism | tail -n 1 | cut -d':' -f2 | cut -d' ' -f2,3,4)");
Command c("bash");
if (c.execute("/tmp", QStringList() << "-c" << cmd)) {
return c.getCommandResult(); // 1.3.9+git0+226553a8ab-r0
}
}
return "N/A";
}
QString Worker::getATBQTVersion() const { QString Worker::getATBQTVersion() const {