summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/libarchivearchive.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Libarchive: Fix extracting hard links pointing to files in archiveArttu Tarkiainen2021-11-031-0/+12
| | | | | | | | | | | Since we already adjust the output path for archive entries, libarchive would fail with the error string "Hard-link target '...' does not exist" for hard links referring to extracted files. Fix by also adjusting the hard link target paths. Task-number: QTIFW-2403 Change-Id: I8f78117c5b0707a70c76433ca1c1483ea49b432b Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix creating archives containing Windows shortcutsArttu Tarkiainen2021-10-291-1/+1
| | | | | | | | | | | | | On Windows, QFileInfo::isSymLink() returns true for *.lnk files, which unlike symlinks contain data - when creating an archive the writing was incorrectly skipped. Also add test case for creating and extracting archives containing either symlinks or shortcuts. Change-Id: I3ebbd28e889ffa17ece7378c3812244a55df20d5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix symlink handling when packaging Zip archivesArttu Tarkiainen2021-10-271-1/+1
| | | | | | | | | | | | archive_write_header() will write the complete symlink to the archive, the client application should not try to write any data for symlinks or if archive_entry_size() is zero. The tar.* archives were not affected by this. Task-number: QTIFW-2382 Change-Id: I6a5e62ef4c7e650ad806f183556e39ac8ae8cdc3 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add support for seeking files handled with libarchiveArttu Tarkiainen2021-10-261-5/+111
| | | | | | | | | | | | | | | | | | | This fixes losing executable bits of files in Zip archives when extracted. Zip archives store file metadata in two ways, partial metadata per-entry and full metadata at the end of archive. IFW's read implementation previously did only streaming without support for seeking archives, which is required to obtain full metadata - meaning the partial metadata was used instead by libarchive's Zip reader. The extracted entries between the two metadata types are not consistent. This change also enables usage of archive formats that cannot be accurately handled with a streaming model, like 7zip which needs to read key data from the end of the file before reading file data from the beginning. Task-number: QTIFW-2372 Change-Id: Ie4ed33040fc52de073546e46d9da726816f47a81 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add support for handling archive files with libarchiveArttu Tarkiainen2021-09-141-0/+819
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>