Fixed known defaults for starting ATBUpdateTool.

This commit is contained in:
Gerhard Hoffmann 2023-08-14 15:08:00 +02:00
parent 8d528f0f55
commit 259da8200e

View File

@ -65,7 +65,7 @@ int main(int argc, char *argv[]) {
QCommandLineOption pluginDirectoryOption(QStringList() << "plugin-directory" << "plugin-directory", QCommandLineOption pluginDirectoryOption(QStringList() << "plugin-directory" << "plugin-directory",
QCoreApplication::translate("main", "Where to find dc-plugin."), QCoreApplication::translate("main", "Where to find dc-plugin."),
QCoreApplication::translate("main", "directory")); QCoreApplication::translate("main", "directory"));
QString const pluginDefault = "./plugins"; QString const pluginDefault = "/usr/lib";
pluginDirectoryOption.setDefaultValue(pluginDefault); pluginDirectoryOption.setDefaultValue(pluginDefault);
parser.addOption(pluginDirectoryOption); parser.addOption(pluginDirectoryOption);
@ -79,7 +79,7 @@ int main(int argc, char *argv[]) {
QCommandLineOption workingDirectoryOption(QStringList() << "working-directory" << "working-directory", QCommandLineOption workingDirectoryOption(QStringList() << "working-directory" << "working-directory",
QCoreApplication::translate("main", "working directory of update-script."), QCoreApplication::translate("main", "working directory of update-script."),
QCoreApplication::translate("main", "directory")); QCoreApplication::translate("main", "directory"));
QString const workingDirectoryDefault = "."; QString const workingDirectoryDefault = "/opt/app/tools/atbupdate";
workingDirectoryOption.setDefaultValue(workingDirectoryDefault); workingDirectoryOption.setDefaultValue(workingDirectoryDefault);
parser.addOption(workingDirectoryOption); parser.addOption(workingDirectoryOption);
@ -87,14 +87,6 @@ int main(int argc, char *argv[]) {
QCoreApplication::translate("main", "Start ATBUpdateTool in dry-run-mode. No actual actions.")); QCoreApplication::translate("main", "Start ATBUpdateTool in dry-run-mode. No actual actions."));
parser.addOption(dryRunOption); parser.addOption(dryRunOption);
// TODO:
// add some additional parameters
// --dry-run
// -d: only update device-controller firmware
// -j: only update json-files
// -o: only execute opkg-commnds
// -f: force. update_psa shall always perform a 'git pull'
// Process the actual command line arguments given by the user // Process the actual command line arguments given by the user
parser.process(a); parser.process(a);
QString plugInDir = parser.value(pluginDirectoryOption); QString plugInDir = parser.value(pluginDirectoryOption);
@ -103,9 +95,6 @@ int main(int argc, char *argv[]) {
bool dryRun = parser.isSet(dryRunOption); bool dryRun = parser.isSet(dryRunOption);
QString const rtPath = QCoreApplication::applicationDirPath(); QString const rtPath = QCoreApplication::applicationDirPath();
if (plugInDir == pluginDefault) {
plugInDir = (rtPath + "/" + pluginDefault);
}
if (!QDir(plugInDir).exists()) { if (!QDir(plugInDir).exists()) {
qCritical() << plugInDir qCritical() << plugInDir
<< "does not exists, but has to contain dc-library"; << "does not exists, but has to contain dc-library";