summaryrefslogtreecommitdiff
path: root/src/tools/controller/controller.cpp
Commit message (Collapse)AuthorAgeFilesLines
* appman-controller: detect broken D-Bus connections and quit with errorRobert Griebl2023-03-031-39/+107
| | | | | | | | | | | | | | | | | | | | | In case the AM crashed or the bus died during an install-package command, the appman-controller would have waited for a taskFail / taskFinished signal infinitely. We now detect a D-Bus service owner change (the AM crashed) and a disconnected D-Bus (the bus died). Even though the D-Bus daemon dying sounds unlikely, it is the norm when running the AM with --dbus=auto (the default). If the AM crashes (or gets terminated by an IDE), the private dbus-daemon just quits. This makes the controller much more suitable for scripting. Also fixed a bunch of clang/clazy warnings in this file. Change-Id: I01a3772fd8773d707984a07d38cbce1d7ab36c94 Reviewed-by: Dominik Holland <dominik.holland@qt.io> (cherry picked from commit ff5f0d9c4d14042eb020a8ba5cb9ee7e51195a65) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Cleanup the D-Bus interfacesRobert Griebl2023-02-151-2/+2
| | | | | | | | | | | - most of the newer PackageManager signals were not exposed at all - some properties were not exposed consistently or used the wrong type - clarified the D-Bus policy settings in regards to properties Change-Id: I6875c0a0613a0a63af2386d311a1a6c7c0031b7b Reviewed-by: Dominik Holland <dominik.holland@qt.io> (cherry picked from commit 4a14abf206c548b80f2942c4d42e23b0e97ddeb1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Port from qAsConst to std::as_constMarc Mutz2023-01-151-1/+1
| | | | | | | | | QT_NO_AS_CONST is now globally enabled in qtbase. Change-Id: Ifc2eab1c902e75f5dbfc38ef9a62b29b5c91bc61 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 1544f245bb22194a22c6eeb75d3b99b82cee15c1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix a template compile error with Debian's gcc 12.1Robert Griebl2022-10-111-2/+2
| | | | | | Change-Id: I29142dccb62f4f9689a13f0dd5d9b1d4f9f81e05 Pick-to: 6.4 6.3 6.2 5.15 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Intents: allow intent injection via DBus when in developmentModeRobert Griebl2022-09-161-0/+60
| | | | | | | | This makes testing and debugging Intents a lot easier, especially since you can even fake the requesting application id. Change-Id: Ie5d46bd2e3a9962ca533bf75d7262c20f95d42b6 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Add support for managing multiple instances from appman-controllerRobert Griebl2022-06-301-4/+45
| | | | | | | | | | | | Added an optional instance-id, which can be set via command line option or via am-config.yaml in the appman process. appman-controller also gained a new option --instance-id to address the given instance, instead of the default, unnamed one. Change-Id: I582d0ea69ed0697ee9ac7353725f93c50df05e34 Pick-to: 6.4 5.15 Fixes: AUTOSUITE-1678 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Use SPDX license identifiersDominik Holland2022-06-151-29/+4
| | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I09660e42dea769d720ff30e652485d9861cea965 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* Clazy: fix srcRobert Griebl2021-08-201-5/+5
| | | | | Change-Id: I043882780fac7bed5d9dd75424ede46b54caa187 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Update copyright headers to 2021 an finally switch to the GPLRobert Griebl2021-06-011-8/+9
| | | | | | | | | Also removed all the SPDX tags and -QTAS license extensions. Change-Id: Ibd10fe37afcbba832831d027cf2f1891ca0226c0 Fixes: AUTOSUITE-1648 Fixes: AUTOSUITE-1646 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Qt 6 port, part 1 .. without cmakeRobert Griebl2020-11-281-1/+1
| | | | | | | | | All C++ and QML unit-tests pass. The QML "windowitem" test is very unstable though and often crashes in the RHI layer. Change-Id: Ia42fc71ad69d2ba74b8b631ded7569b48cf458ee Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* Correct tools command line optionsBernd Weimer2020-09-171-1/+1
| | | | | | | Updated documentation and bash completion. Change-Id: Ie87c60cadfb46866b5cbfe9e8fdf8a646d28aa94 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* Spelling fixes all over the placeRobert Griebl2020-07-171-4/+4
| | | | | Change-Id: Ic0018eddb8fcfbd22136fbf62d3e15e0e1c4c0b3 Reviewed-by: Bernd Weimer <bernd.weimer@pelagicore.com>
* appman-controller: Improve option and help usageDominik Holland2020-03-201-7/+7
| | | | | | | | | | | | | | | | The controller accepts the options for the command now also before the actual command e.g. -ioe debug-application This makes it easier for the user, as this is also the format printed by QCommandLineParser::showHelp() Showing the full help for all commands also when only the specific help for a command should be provided, makes it very hard to see what the correct usage for the command actually is. We now show only a short help when a command is provided and the full help in all other cases. Change-Id: I6927cf465ba1dd46cfbf361af04a3bfc8d089b67 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* Really fix the installation problem via the appman-controllerRobert Griebl2020-02-111-7/+7
| | | | | | | | | | | | | | The bug was trickier than anticipated, because I thought that only the appman side would check the meta-data. Turns out the controller tries to verify the packageId as well, but the meta-data was just not sent over DBus. Why? Because the Package object may not have been in model yet (on first installation), so calling PackageManager::get(<id>) led to an empty (error) repsonse. Also fixed a few left missing s/application/package/ replacements. Change-Id: I6fc436270ad193203fca94e66e739ffd4baeae27 Fixes: AUTOSUITE-1461 Reviewed-by: Egor Nemtsev <enemtsev@luxoft.com>
* Rename from Luxoft AM to Qt AMRobert Griebl2019-08-051-3/+3
| | | | | | Change-Id: I84bbd9e7f735ed1864804a9887d3a02b7c925e53 Reviewed-by: Vladimir Minenko <vladimir.minenko@pelagicore.com> Reviewed-by: Bernd Weimer <bernd.weimer@pelagicore.com>
* Remove support for multiple installation locationsRobert Griebl2019-08-021-27/+19
| | | | | | | | | | | We had removed support for SD-Card (removable location) installations in a previous patch. Supporting multiple non-removable locations adds a lot of complexity to the AM's installer that isn't really needed, since modern Linux kernels can support these niche use-cases much more transparently through the device mapper/lvm infrastructure. Change-Id: Iaf10d2eb28b9d61e54c5268bcbdd623005b8508d Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
* Add new package abstraction, which allows multiple executables per packageRobert Griebl2019-08-011-33/+87
| | | | | | | | This is part 1 which is missing doc updates and missing the update-builtin- applications functionality. Both will be added in a follow-up commit. Change-Id: I2b493cfb7585143962067674690b02cc132ef78b Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
* Fix application naming for --help and --versionRobert Griebl2019-06-251-8/+10
| | | | | Change-Id: I861bd4167d8676c36e8f40c9acd35b17436ac6ff Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
* Update copyright statementsRobert Griebl2018-12-181-4/+5
| | | | | | | | - added 2019 - everything is (c) Luxoft instead of Pelagicore from now on Change-Id: I82f874f0b0601deae1bb39347821edaf3c4cc6d8 Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
* Add support for canceling installations to the appman-controllerRobert Griebl2018-11-161-43/+125
| | | | | | | | | | | | | Installations are now canceled automatically, if the appman-controller is interrupted by Ctrl+C while the installation is running. They can however also be explicitly canceled by means of the new commands 'list-installation-tasks' and 'cancel-installation-task'. Task-number: AUTOSUITE-643 Task-number: AUTOSUITE-644 Change-Id: I7b48df3472273156332d5894289834efeb8785be Reviewed-by: Nikolay Zamotaev <nzamotaev@luxoft.com> Reviewed-by: Daniel d'Andrada <daniel.dandrada@luxoft.com>
* Fix blank line output in controller's list-* commandsRobert Griebl2018-11-151-2/+6
| | | | | | | The controller would output a new-line even if no result was available. Change-Id: Ibeb9408639ada9a004da50a1f1f68bde967064a2 Reviewed-by: Daniel d'Andrada <daniel.dandrada@luxoft.com>
* Get rid of all 0-timeout single-shot timersRobert Griebl2018-10-261-2/+2
| | | | | | | | and replace them with the much more meaningful QMetaObject::invokeMethod, now that we can use this with the C++11 connect syntax. Change-Id: Ib16d214fc41d6994a3badab81094c32457dacd3a Reviewed-by: Daniel d'Andrada <daniel.dandrada@luxoft.com>
* Fix race condition in appman-controller start-application --restartRobert Griebl2018-05-171-176/+206
| | | | | | | | | | Also replaced all the weird singleShot-timer lambdas (needed to run the actual code only after the event loop is up, because QtDBus needs one) with a central runLater() function Change-Id: I79814c65105e48b51f30b9f761a04ed799457963 Task-number: AUTOSUITE-184 Reviewed-by: Bernd Weimer <bernd.weimer@pelagicore.com>
* Clang code model fixesRobert Griebl2018-04-171-3/+3
| | | | | Change-Id: I46bb240aa843c297e83278a4f1b29f95be093c83 Reviewed-by: Thomas Senyk <thomas.senyk@pelagicore.com>
* Make the acknowledge part of appman-controller's install-package optionalRobert Griebl2018-03-061-13/+16
| | | | | | | | | | | | Acknowledging package installations by default could interfere with System-UI logic, so we shouldn't do it by default. There is now a new switch -a/--acknowledge however which will activate the old behavior and forces installation even on minimal System-UIs that do not implement the package acknowledge callback. Change-Id: If7e4faa328a98a231eccf36515bc0e568004d41d Task-number: QTAUTO-835 Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
* Update Pelagicore copyright headers to 2018Robert Griebl2018-02-071-1/+1
| | | | | Change-Id: I8d9278053ccdef5a57e51753aa6157941ebcee52 Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
* Add bash command completion fileBernd Weimer2018-01-231-0/+2
| | | | | | | It provides command completion for appman-controller and appman-packager. Change-Id: Ic8853c55c8a484fa7fb498f822727f167ad4b2e9 Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
* Replace debug-wrapper specifications with more powerful syntaxRobert Griebl2017-07-051-1/+1
| | | | | | | | | | | | Pre-defining the wrappers in a config file turned out to be too inflexible for everyday use, so wrapper specifications are now direct shell commands with placeholders (e.g. "valgrind --tool=helgrind %program%"). In addition, these command also support specifying environment variable, just as you would do on the command line (e.g. "QT_DEBUG_PLUGINS=1 strace") Change-Id: I1509a9fefd01c778e2fb6c5b87f811ec9571a946 Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
* Refactor the src/manager dir into a sub-moduleRobert Griebl2017-06-021-0/+727
* the appman binary is now built from src/tools/appman * renamed all the main.cpp files to the names of their containing directories (avoids a lot of confusion) * all dependencies between the src modules and the tools are now handled centrally in src.pro * removed the Android deployment, since it doesn't work as-is on newer Android version anymore - we have to come up with a new plan on how to package up the AM plus a system-ui in one APK Change-Id: Ieb4536a7ab2a301488de09db61844da092620859 Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>