summaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-11-16 10:14:53 +0200
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-12-09 13:48:37 +0200
commit9677cdf762cc2a4d9d99e4f129fca512cf52c0ed (patch)
tree47632f4e67c272f1de72011c6f8732dacb56751f /src/libs
parent8487987c0c32c06fb6dfc225a1ba347894215fb1 (diff)
Libarchive: enable support for uncompressed tar archives
Task-number: QTIFW-2404 Change-Id: I4c62d283d54a1f180f9c3525da0728a1c75ef50e Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/installer/archivefactory.cpp2
-rw-r--r--src/libs/installer/libarchivearchive.cpp13
2 files changed, 6 insertions, 9 deletions
diff --git a/src/libs/installer/archivefactory.cpp b/src/libs/installer/archivefactory.cpp
index a7e55bd44..e6582cbcd 100644
--- a/src/libs/installer/archivefactory.cpp
+++ b/src/libs/installer/archivefactory.cpp
@@ -141,7 +141,7 @@ ArchiveFactory::ArchiveFactory()
{
#ifdef IFW_LIBARCHIVE
registerArchive<LibArchiveWrapper>(QLatin1String("LibArchive"), QStringList()
- << QLatin1String("tar.gz") << QLatin1String("tar.bz2")
+ << QLatin1String("tar") << QLatin1String("tar.gz") << QLatin1String("tar.bz2")
<< QLatin1String("tar.xz") << QLatin1String("zip") << QLatin1String("7z"));
#else
registerArchive<Lib7zArchive>(QLatin1String("Lib7z"), QStringList()
diff --git a/src/libs/installer/libarchivearchive.cpp b/src/libs/installer/libarchivearchive.cpp
index cf6e11e32..0f5b21a29 100644
--- a/src/libs/installer/libarchivearchive.cpp
+++ b/src/libs/installer/libarchivearchive.cpp
@@ -713,14 +713,11 @@ void LibArchiveArchive::configureReader(archive *archive)
*/
void LibArchiveArchive::configureWriter(archive *archive)
{
- if (QFileInfo(m_data->file.fileName()).suffix() == QLatin1String("zip")) {
- archive_write_set_format_zip(archive);
- } else if (QFileInfo(m_data->file.fileName()).suffix() == QLatin1String("7z")) {
- archive_write_set_format_7zip(archive);
- } else {
- archive_write_set_format_pax_restricted(archive);
- archive_write_set_format_filter_by_ext(archive, m_data->file.fileName().toLatin1());
- }
+ archive_write_set_format_filter_by_ext(archive, m_data->file.fileName().toLatin1());
+
+ if (compressionLevel() == CompressionLevel::Normal)
+ return;
+
const QByteArray options = "compression-level=" + QString::number(compressionLevel()).toLatin1();
if (archive_write_set_options(archive, options.constData())) { // not fatal
qCWarning(QInstaller::lcInstallerInstallLog) << "Could not set options" << options