Implemented getATBUpdateToolYoctoVersion() and getATBUpdateToolYoctoInstallationStatus()

This commit is contained in:
Gerhard Hoffmann 2023-10-18 11:31:15 +02:00
parent 731cdcbe09
commit 504e242d42

View File

@ -981,6 +981,30 @@ QString Worker::getOsVersion() const {
return "N/A"; return "N/A";
} }
QString Worker::getATBUpdateToolYoctoVersion() {
if (QFile::exists("/var/lib/opkg/status")) {
QString const cmd = QString("echo -n $(cat /var/lib/opkg/status | grep -A1 atbupdatetool | tail -n 1 | cut -d':' -f2 | cut -d' ' -f2)");
Command c("bash");
if (c.execute("/tmp", QStringList() << "-c" << cmd)) {
return c.getCommandResult(); // 1.3.9+git0+226553a8ab-r0
}
}
return "N/A";
}
QString Worker::getATBUpdateToolYoctoInstallationStatus() {
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)");
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 {
QString const cmd = QString("echo -n $(/opt/app/ATBAPP/ATBQT -v | head -n 2 | cut -d':' -f2)"); QString const cmd = QString("echo -n $(/opt/app/ATBAPP/ATBQT -v | head -n 2 | cut -d':' -f2)");
Command c("bash"); Command c("bash");