Compare commits
No commits in common. "11524b838902833fd62fbd348412e2bdd052f5fb" and "9b6f5db8fe4858e35e7a54259e0426c6061df9bd" have entirely different histories.
11524b8389
...
9b6f5db8fe
@ -80,7 +80,6 @@ SOURCES += \
|
||||
mainwindow.cpp \
|
||||
../common/src/message_handler.cpp \
|
||||
../UpdatePTUDevCtrl/commandline_parser.cpp \
|
||||
../UpdatePTUDevCtrl/process/command.cpp \
|
||||
update.cpp \
|
||||
dc_download.cpp \
|
||||
../common/src/System.cpp
|
||||
@ -90,7 +89,6 @@ HEADERS += \
|
||||
mainwindow.h \
|
||||
../common/include/message_handler.h \
|
||||
../UpdatePTUDevCtrl/commandline_parser.h \
|
||||
../UpdatePTUDevCtrl/process/command.h \
|
||||
update.h \
|
||||
dc_download.h \
|
||||
../common/include/System.h
|
||||
|
@ -114,28 +114,21 @@ int main(int argc, char **argv) {
|
||||
qInfo() << "readDCVersion ............" << readDCVersion;
|
||||
qInfo() << "dcDir ...................." << dcDir;
|
||||
|
||||
if (readDCVersion) {
|
||||
qInfo() << "dc-version ..............." << Update::dcVersion(
|
||||
QDir::cleanPath(rtPath + QDir::separator()
|
||||
+ QString("customer_%1").arg(customerNr) + QDir::separator()
|
||||
+ dcDir + QDir::separator() + "dc2c.bin"));
|
||||
}
|
||||
|
||||
if (showExtendedVersion) {
|
||||
printf(APP_EXTENDED_VERSION"\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// QString const &customerRepo = QDir::cleanPath(workingDir + QDir::separator() + QString("customer_%1").arg(customerNr));
|
||||
// QStringList filesToUpdate;
|
||||
QString const &customerRepo = QDir::cleanPath(workingDir + QDir::separator() + QString("customer_%1").arg(customerNr));
|
||||
QStringList filesToUpdate;
|
||||
|
||||
QThread::currentThread()->setObjectName("main thread");
|
||||
qInfo() << "Main thread" << QThread::currentThreadId();
|
||||
|
||||
// MainWindow mw;
|
||||
MainWindow mw;
|
||||
|
||||
// mw.setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
|
||||
mw.setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
|
||||
// mw.showFullScreen();
|
||||
|
||||
// qCritical() << "SHOW";
|
||||
|
@ -1,5 +1,4 @@
|
||||
#include "update.h"
|
||||
#include "process/command.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QFile>
|
||||
@ -22,8 +21,6 @@
|
||||
#include <QDateTime>
|
||||
#include <QPluginLoader>
|
||||
#include <QMap>
|
||||
#include <QStringList>
|
||||
#include <QString>
|
||||
|
||||
#define UPDATE_OPKG (1)
|
||||
#define UPDATE_DC (0)
|
||||
@ -95,20 +92,6 @@ bool Update::unloadDCPlugin() {
|
||||
return false;
|
||||
}
|
||||
|
||||
QString Update::dcVersion(QString const &dcBinFile) {
|
||||
Command c("bash");
|
||||
QStringList param;
|
||||
|
||||
param << "-c" << QString(R"(strings %1 | grep DC2c.\[0-9\] | uniq)").arg(dcBinFile);
|
||||
|
||||
if (c.execute("/tmp", param)) {
|
||||
return c.getCommandResult().trimmed().split(QRegularExpression("\\s")).first();
|
||||
// qInfo() << "(" << __func__ << ":" << __LINE__ << ")" << v;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
class hwapi;
|
||||
Update::Update(QString customerRepository,
|
||||
QString customerNrStr,
|
||||
|
@ -59,7 +59,6 @@ public:
|
||||
virtual ~Update() override;
|
||||
|
||||
bool doUpdate();
|
||||
static QString dcVersion(QString const &dcBinFile);
|
||||
|
||||
private:
|
||||
DownloadResult sendStatus(int ret) const;
|
||||
|
@ -161,8 +161,8 @@ void CommandLineParser::readSettings() {
|
||||
QString const iniFileName = m_parser.value(m_iniFileNameOption);
|
||||
m_iniFileName = QDir::cleanPath(iniFileDir + QDir::separator() + iniFileName);
|
||||
|
||||
//qCritical() << __PRETTY_FUNCTION__ << " iniFileDir" << iniFileDir;
|
||||
//qCritical() << __PRETTY_FUNCTION__ << "iniFileName" << m_iniFileName;
|
||||
qCritical() << __PRETTY_FUNCTION__ << " iniFileDir" << iniFileDir;
|
||||
qCritical() << __PRETTY_FUNCTION__ << "iniFileName" << m_iniFileName;
|
||||
|
||||
if (!m_iniFileName.isEmpty()) {
|
||||
if (QFile(m_iniFileName).exists()) {
|
||||
@ -171,8 +171,8 @@ void CommandLineParser::readSettings() {
|
||||
for (QString const &key: keys) {
|
||||
QVariant v = settings.value(key);
|
||||
|
||||
//qCritical() << "(" << __func__ << ":" << __LINE__ << ")"
|
||||
// << key << " -> " << v.toString();
|
||||
qCritical() << "(" << __func__ << ":" << __LINE__ << ")"
|
||||
<< key << " -> " << v.toString();
|
||||
|
||||
if (key.contains("repository-url")) {
|
||||
m_repositoryUrl = v.toString();
|
||||
@ -273,9 +273,15 @@ QString CommandLineParser::dcDir() {
|
||||
}
|
||||
|
||||
bool CommandLineParser::readDCVersion() {
|
||||
|
||||
qCritical() << __func__ << __LINE__;
|
||||
|
||||
if (m_parser.isSet(m_readDCVersionOption)) {
|
||||
qCritical() << __func__ << __LINE__ << m_readDCVersion;
|
||||
m_readDCVersion = m_parser.value(m_readDCVersionOption);
|
||||
qCritical() << __func__ << __LINE__ << m_readDCVersion;
|
||||
}
|
||||
qCritical() << __func__ << __LINE__ << m_readDCVersion;
|
||||
return m_readDCVersion == "false" ? false : true;
|
||||
}
|
||||
|
||||
|
@ -11,8 +11,8 @@ class CommandLineParser : public QCommandLineParser {
|
||||
QString m_plugInDir;
|
||||
QString m_plugInName;
|
||||
QString m_workingDir;
|
||||
QString m_psaConfigDir{"etc/psa_config"};
|
||||
QString m_psaTariffDir{"etc/psa_tariff"};
|
||||
QString m_psaConfigDir;
|
||||
QString m_psaTariffDir;
|
||||
QString m_dryRun;
|
||||
QString m_noUpdatePsaHardware;
|
||||
QString m_showYoctoVersion;
|
||||
@ -21,8 +21,8 @@ class CommandLineParser : public QCommandLineParser {
|
||||
QString m_iniFileName;
|
||||
QString m_alwaysDownloadConfig;
|
||||
QString m_alwaysDownloadDC;
|
||||
QString m_readDCVersion{"false"};
|
||||
QString m_dcDir{"etc/dc/"};
|
||||
QString m_readDCVersion;
|
||||
QString m_dcDir;
|
||||
|
||||
QCommandLineOption m_repositoryUrlOption;
|
||||
QCommandLineOption m_iniFileDirectoryOption;
|
||||
|
Loading…
Reference in New Issue
Block a user