summaryrefslogtreecommitdiffstats
path: root/src/sdk/commandlineinterface.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix selecting target directory when elevated server process is activeArttu Tarkiainen2021-12-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | There is a disparency in the return value of QFileInfo::isFile() on Windows whether QFileInfo uses QFileSystemEngine directly (for local files, returns false) or with another file engine (QFSFileEngine in this case, returns true), when the file does not exist on disk. Installer registers its own file engine handler that handles file engine creation. It creates custom RemoteFileEngine instances suitable for writing into more restrictive locations when the connection to the elevated installer server process is active. When calling RemoteFileEngine::fileFlags() with TypesMask parameter, the returned combination of enum values includes FileFlag::FileType when the given file does not exist, this can be reproduced with both the active remote server connection that forwards the file engine calls to the server process, and when the composed QFSFileEngine object is used directly without the remote connection. Fix by adding a check if the given target directory path exists, if it doesn't we can assume it is a directory to be created by the installer. Also rename function to better match what it does. Task-number: QTIFW-2383 Change-Id: I906b0676802d9d94e70abeb2dea1f71866cbbec8 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Print essential component information with std::coutArttu Tarkiainen2021-10-221-1/+1
| | | | | | | | | | | | | | | | | | Do not use our own message handler for printing XML-formatted component information (from 'list', 'search', 'check-updates') that is expected to be included in output regardless of the current verbosity level or logging rules. Higher verbosity can still add more information to be included in output. Also: - Modify auto-tests to pass and check the output correctly. - Remove now orphaned 'ifw.package.info' logging category. - Rename 'LoggingHandler::printComponentInformation()' to 'printUpdateInformation()' to better match the intended purpose. Task-number: QTIFW-2349 Change-Id: Id1a868f8f824c606825cd6168974a7e3845383e6 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Replace occurrences of "TargetDir" string with 'scTargetDir' constantArttu Tarkiainen2021-10-131-2/+2
| | | | | | | | This makes it easier to grep usage of variable and we shouldn't really use the magic string as there is already a constant. Change-Id: I96a6b3901f79127b7cf71494643e2cd038df6670 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Merge remote-tracking branch 'origin/4.1'Arttu Tarkiainen2021-06-171-0/+7
|\ | | | | | | Change-Id: Iff5a7a99afca53305c7f404a74f210f67728dd54
| * Load control script also when using CLIKatja Marttila2021-06-161-0/+7
| | | | | | | | | | | | Task-number: QTIFW-2268 Change-Id: I61e5f7963a55dcdc25aff171523fe078af309785 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* | CLI: Add support for additional filtering of search resultsArttu Tarkiainen2021-04-091-1/+25
|/ | | | | | | | | | | | | | | | | | Search command results can now be optionally filtered with the '--filter-packages'-option, which takes an unspecified count of key-value pairs that contain the desired package information element and a regular expression used to find matches in the element. Example usage: 'installer --fp "Version=1.0, Description=Some text" search *' Only the packages which match all given filter rules are included in the output print. Task-number: QTIFW-2168 Change-Id: I788b065d95952b988489c36db80b3c859b970f05 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Restructure logging utilitiesArttu Tarkiainen2021-02-041-3/+3
| | | | | | | | | | | | | | Create a singleton-pattern class as an encapsulation unit for holding and altering the state of debug printing attributes. Move related code from various places under a single umbrella header file for logging utilities, with some minor stylistic changes & cleanup. This acts as a preparatory change for providing non-blocking headless CLI runs when there is no TTY attached - that will be fixed in a follow-up change. Change-Id: Ib7f72cf75362c3ea6713058e92eda997d6df55c3 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add support for generating offline installer from onlineArttu Tarkiainen2021-01-151-0/+31
| | | | | | Task-number: QTIFW-1945 Change-Id: Ic8a076a28385e99ad09cfbccd07c7012d6570639 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Print package information in xml formatKatja Marttila2020-11-251-19/+3
| | | | | | | | | Also removed logging categories for package information, the full package information can be printed by increasing the verbosity level. Task-number: QTIFW-1950 Change-Id: I4bce019a63ba1fbf48e3bb0ca45511e42d4974c9 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* CLI: Add possibility to filter installed packages with regexpArttu Tarkiainen2020-11-041-1/+4
| | | | | | Task-number: QTIFW-1953 Change-Id: Ie291e8ae96d46082e342e9bcb152258862813afd Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* CLI: Print package id when running checkupdatesKatja Marttila2020-10-011-0/+1
| | | | | | Task-number: QTIFW-1972 Change-Id: Ia6f75e4b06b17fb9d1b0cf4ae4af47f140f86be4 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* CLI: Give more meaningfull return value for installsKatja Marttila2020-09-251-9/+5
| | | | | | | | | | | | | | Instead of returning just true or false when running installer or maintenancetool, utilize the PackagemanagerCore status message. Added also a new status enum, EssentialUpdated, which is returned when calling command 'update' and only essential components are updated. Also fixed a bug when components could be installed even when there were an essential update available. Task-number: QTIFW-1969 Change-Id: I43826301656573b34e1338b49566d199bdcd7468 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Reintroduce removed --checkupdates and --updater as deprecated optionsArttu Tarkiainen2020-06-101-3/+11
| | | | | | | | | | | These should be only provided for backward compatibility and be hidden from help text. Task-number: QTIFW-1791 Change-Id: Iff92bdf0be425edf724d3bcd3984458eca5f8ff2 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Refactor maintenance tool writing conditionsArttu Tarkiainen2020-06-101-11/+9
| | | | | | | | | This change fixes a bug caused by a blocking runInstaller() call in PerformInstallationPage::entering() and also contains refactoring to related parts of code. Change-Id: Ic3309707c1f975a646937aa96fc407a3e5931359 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add support for disabling CLI features from configuration fileArttu Tarkiainen2020-05-151-0/+5
| | | | | | Task-number: QTIFW-1760 Change-Id: Ibd0668756700eeab68bce12ddce1866893cc08f9 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix installationlog.txt writingKatja Marttila2020-04-271-0/+5
| | | | | | | | | Fixes also remoterepo deletion from tmp folder Task-number: QTIFW-1664 Task-number: QTIFW-1683 Change-Id: I8485eb63c4ec5a30c04f4177922bb60f2176ce37 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Remove existing installation from command lineArttu Tarkiainen2020-04-071-0/+17
| | | | | | | | | | | Add new "purge" command to command line interface. This removes all components and all program directory contents. Add test function to unit tests. Task-number: QTIFW-1574 Change-Id: Iccd4a052c7e2fc8eec0a6ae2b5a93c0c607604cb Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Separate maintenance tool writing for testing purposeKatja Marttila2020-03-201-13/+32
| | | | | | | | | Some unit tests wont work as installer wants to unpack maintenance tool from the installer. As unit tests are not normal installers we need to separate the maintenance unpacking when running tests. Change-Id: I5f2bb60e775a42d1b8dd6ee088ff4f2a694a7a09 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Add short versions of CLI optionsArttu Tarkiainen2020-03-191-2/+2
| | | | | | | | | | | | | | Add single or couple letter short options and two letter short commands. Single letter short options can be passed in a single joined form, for instance '-dg'. Also change CLI options constant string literals type to QLatin1String as we would have to use this as a wrapper anyway wherever the constants would be used, causing quite long and verbose statements. Task-number: QTIFW-1634 Change-Id: I17e80c9a657d934687d2b7e87fcecddffa1b9b21 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Refactor naming and usage of CLI commandsArttu Tarkiainen2020-03-191-47/+27
| | | | | | | | | | | | | | | | | | | | | | | | - Rename and alter the description of some command line options according to validation results from task QTIFW-1635. The suggested additions are not added in this change. - Remove options "framework-version" and "silentUpdate", these should not be needed anymore. - Combine options "installPackages" and "installDefault" into single "install" command. - Change command line syntax from "binary [options]" to "binary [options] command <arguments>". - Re-order & group known option variables and "--help" printing order based on their topic. - Move CommandLineParser class files under src/libs/installer and add private class for future options extension. Short versions of command line options should be added in a follow-up commit. Task-number: QTIFW-1671 Change-Id: Ie0d393368b5275c8ffa1ab8833885b149af3178e Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Improve warning log stringsKatja Marttila2020-03-131-6/+6
| | | | | | Change-Id: Ifdc7a63b9e60807b0d5f6e68758296d417da1d1c Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Perform headless commands without GUI dependencyKatja Marttila2020-03-121-0/+226
Task-number: QTIFW-1633 Change-Id: I207cd152a471fddd51c152223460f8a9873f4382 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>