summaryrefslogtreecommitdiffstats
path: root/src/libs/ifwtools/repositorygen.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix deprecated QString::count() callKatja Marttila2023-06-151-1/+1
| | | | | | Task-number: QTIFW-3077 Change-Id: I595309e3e354f4eb96b10fd23420ca70f0f6ee9e Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Fix 'unused variable' -warningsKatja Marttila2023-06-061-2/+2
| | | | | | Task-number: QTIFW-1829 Change-Id: I29a7465c854c8a1af7ec5d9af600bfc65dc1950e Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Use qAsConst to avoid containers from detachingKatja Marttila2022-11-071-1/+1
| | | | | Change-Id: I22dba356f434e65cf4db117c42b55f13f07c4e18 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add possibility to post load install scriptsKatja Marttila2022-11-041-33/+46
| | | | | | | | | | | This change adds attribute, postLoad, to existing <Script> -element. Using <Script postLoad="True"> will call the script loading and evaluation only to those components which are selected for install or update right before the components installation start. Task-number: QTIFW-2820 Change-Id: Ic1967d329cbb5de6a0216ff3f76cc2ede178db80 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Replace QRegExp usages by QRegularExpressionChristian Stenger2022-10-211-3/+3
| | | | | | Task-number: QTIFW-1829 Change-Id: I5a48bb5660d6082c1b95247adf84bb3126853aef Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add persistent metadata file cacheArttu Tarkiainen2022-10-141-17/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | Introduce GenericDataCache and Metadata classes for storing the fetched metadata files (Updates.xml and uncompressed files from the meta.7z archives) on local filesystem. The cache uses a checksum based dictionary to keep track of the cached metadata items, with the SHA1 sums of downloaded Updates.xml files being the keys to refer single metadata item. We still need to download all the Updates.xml files on each fetch to check if the cached metadata items are applicable for the current repositories. Update the Updates.xml files in auto-test data to have unique contents, otherwise there could be conflicts with identical test repositories, as the tests will also utilize the cache now. Also omit registering Repository type to the meta-object system in the class contructors, this is expensive as we construct objects from the class frequently, in the worst case hundreds of thousands times. PackageManagerCore already does the registering. Task-number: QTIFW-2621 Change-Id: Iee10ead68befd722ffe7f18ca48483d5a3666658 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix deprecation warnings from building with Qt 5.15.2Arttu Tarkiainen2021-12-211-3/+3
| | | | | | | | Also update build version requirements. Task-number: QTIFW-2388 Change-Id: Iae1949548dda7a3b8d448228e27060efb5abd8eb Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Merge "Merge remote-tracking branch 'origin/4.1' into master"Arttu Tarkiainen2021-09-151-0/+1
|\
| * Merge remote-tracking branch 'origin/4.1' into masterArttu Tarkiainen2021-09-101-0/+1
| |\ | | | | | | | | | Change-Id: I8e2864b3ec81cffa907fe02ff1f2019e155c54e3
| | * Repogen: Fix updating of repository from a partial package set directoryArttu Tarkiainen2021-08-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When collecting information about the paths to be compressed into unified metadata, if the package directory used to update repository was missing replacements for two or more components, it would reveal an issue with the traversing of the existing repository directory. Fix by adding the missing "cd up" after entering a component entry directory. Add new test case. Task-number: QTIFW-2287 Change-Id: Ica1228968398b6e987bdf89336f74f53fcd35d27 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | | repogen: add support for setting compression level for data archivesArttu Tarkiainen2021-09-141-6/+8
| | | | | | | | | | | | | | | | | | Task-number: QTIFW-1587 Change-Id: I86c4b08eb43e3cafbab83e04961c51d6bdbc98ba Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | | Add support for handling archive files with libarchiveArttu Tarkiainen2021-09-141-31/+61
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libarchive is a multi-format archive and compression library written in C and licensed under the new BSD license. Usage of libarchive brings in support for additional archive formats (in addition to 7z) with the installer framework, like zip and tar, with several available compression methods like gzip, bzip2 and xz. libarchive will coexist as a supported archive format handler with the LZMA SDK currently used in the framework, which will continue to be used for handling the 7-Zip file format. This change introduces classes for handling archive operations using both libraries, removes most calls to the old Lib7z facade and migrates the code base to use the new handling methods. Task-number: QTIFW-2255 Change-Id: I8d77110ded503060495a3d6fdfdbc26281df9453 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Offline-generator: Fix duplicate package entries in internal Updates.xmlArttu Tarkiainen2021-04-121-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a somewhat rare case, it is possible that a same package exist in multiple repositories. The latest available package from remotes is used - however if we select that package for inclusion and also implicitly get some other package from the another repository it exists in with an older version (autodependency, etc.), that repository is then also used to parse package information, and we store a duplicate entry of the package to the Updates.xml to-be-written to the offline installer binary. Fix by appending only the package with the latest version to the PackageInfoVector object used to temporarily hold the package information. Task-number: QTIFW-2190 Change-Id: Icdb3dc979153dfada37fdb0aabb3c718bc8aedff Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Cppcheck: Fix local variable shadowing outer variableKatja Marttila2021-03-091-4/+4
| | | | | | | | | | Change-Id: Idff9a40c5089b4de7b8afd1c280603601317beda Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* | Add alternative way to update components from repositoryKatja Marttila2021-03-031-5/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Components can be updated from online repository using version number. Sometimes there is a need to update to an older version which is now possible by using content sha. Content sha can be added to repository with repogen --sha-update <component_id>. If there is a new content sha available in the repository, component is updated although it version number might be smaller. After the content sha is removed from online repository, the normal update with version number is performed. Task-number: QTIFW-1798 Change-Id: Id9e32b0345af5101cccaf6e30c81bd39691d9590 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* | Refactor repogen for easier testingKatja Marttila2021-03-021-1/+63
|/ | | | | | | | Functionality is only moved from repogen.cpp to repositorygen.cpp. This makes the repository testing much easier. Change-Id: I2078e2880955c71b9ffa0ac46501eafbd499c3ba Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add support for generating offline installer from onlineArttu Tarkiainen2021-01-151-2/+9
| | | | | | Task-number: QTIFW-1945 Change-Id: Ic8a076a28385e99ad09cfbccd07c7012d6570639 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Tools: fix binarycreator usage with unified meta-only repositoriesArttu Tarkiainen2020-12-081-12/+26
| | | | | | | | | Also take into account the case of using both split and unified meta repositories for the same binarycreator run. Task-number: QTIFW-2051 Change-Id: I757165f4b53cf301eb0d4bc9dbc94cacc9f3859e Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add option to define operations in component.xmlKatja Marttila2020-12-071-1/+3
| | | | | | | | | | | Operations can from now on be declared also in component.xml. The operations are performed, backuped and rollbacked the same way as they would be when defined from scripting api. Task-number: QTIFW-507 Change-Id: Ia509219b94737136c3de25db0cb0c72076b48380 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Tools: refactor to move general purpose functionality to installer libArttu Tarkiainen2020-12-021-0/+966
This makes it possible to utilize parts of our existing tooling in the offline installer from online installer generation process. Task-number: QTIFW-2048 Change-Id: I7ee605be75541cc83a3b6909089bda45f0835bcf Reviewed-by: Katja Marttila <katja.marttila@qt.io>