Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package karchive for openSUSE:Factory checked in at 2022-06-17 21:18:55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/karchive (Old) and /work/SRC/openSUSE:Factory/.karchive.new.1548 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "karchive" Fri Jun 17 21:18:55 2022 rev:103 rq:982241 version:5.95.0 Changes: -------- --- /work/SRC/openSUSE:Factory/karchive/karchive.changes 2022-05-16 18:08:10.853254968 +0200 +++ /work/SRC/openSUSE:Factory/.karchive.new.1548/karchive.changes 2022-06-17 21:20:41.322714019 +0200 @@ -1,0 +2,13 @@ +Fri Jun 10 14:12:16 UTC 2022 - Christophe Giboudeaux <[email protected]> + +- Update to 5.95.0 + * New feature release + * For more details please see: + * https://kde.org/announcements/frameworks/5/5.95.0 +- Changes since 5.94.0: + * KArchive::addLocalDirectory: preserve empty directories + * Fix zstd KCompressionDevice not compressing as much as it could (kde#451816) + * Always delete device if we created it (kde#432726) + * port to standard C++ smart pointers where possible + +------------------------------------------------------------------- Old: ---- karchive-5.94.0.tar.xz karchive-5.94.0.tar.xz.sig New: ---- karchive-5.95.0.tar.xz karchive-5.95.0.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ karchive.spec ++++++ --- /var/tmp/diff_new_pack.3XnOTP/_old 2022-06-17 21:20:41.722714236 +0200 +++ /var/tmp/diff_new_pack.3XnOTP/_new 2022-06-17 21:20:41.726714238 +0200 @@ -17,7 +17,7 @@ %define lname libKF5Archive5 -%define _tar_path 5.94 +%define _tar_path 5.95 # Full KF5 version (e.g. 5.33.0) %{!?_kf5_version: %global _kf5_version %{version}} # Last major and minor KF5 version (e.g. 5.33) @@ -25,7 +25,7 @@ # Only needed for the package signature condition %bcond_without released Name: karchive -Version: 5.94.0 +Version: 5.95.0 Release: 0 Summary: Qt 5 addon providing access to numerous types of archives License: LGPL-2.0-or-later ++++++ karchive-5.94.0.tar.xz -> karchive-5.95.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.94.0/CMakeLists.txt new/karchive-5.95.0/CMakeLists.txt --- old/karchive-5.94.0/CMakeLists.txt 2022-04-10 00:06:47.000000000 +0200 +++ new/karchive-5.95.0/CMakeLists.txt 2022-06-05 16:43:20.000000000 +0200 @@ -1,10 +1,10 @@ cmake_minimum_required(VERSION 3.16) -set(KF_VERSION "5.94.0") # handled by release scripts +set(KF_VERSION "5.95.0") # handled by release scripts project(KArchive VERSION ${KF_VERSION}) include(FeatureSummary) -find_package(ECM 5.93.0 NO_MODULE) +find_package(ECM 5.95.0 NO_MODULE) set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules") feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.94.0/autotests/karchivetest.cpp new/karchive-5.95.0/autotests/karchivetest.cpp --- old/karchive-5.94.0/autotests/karchivetest.cpp 2022-04-10 00:06:47.000000000 +0200 +++ new/karchive-5.95.0/autotests/karchivetest.cpp 2022-06-05 16:43:20.000000000 +0200 @@ -1160,6 +1160,9 @@ const QString file1 = QStringLiteral("file1"); QVERIFY(writeFile(dirName, file1, file1Data)); + const QString emptyDir = QStringLiteral("emptyDir"); + QDir(dirName).mkdir(emptyDir); + { KZip zip(s_zipFileName); @@ -1177,8 +1180,11 @@ const KArchiveEntry *e = dir->entry(file1); QVERIFY(e && e->isFile()); - const KArchiveFile *f = (KArchiveFile *)e; + const KArchiveFile *f = static_cast<const KArchiveFile *>(e); QCOMPARE(f->data(), file1Data); + + const KArchiveEntry *empty = dir->entry(emptyDir); + QVERIFY(empty && empty->isDirectory()); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.94.0/autotests/kcompressiondevicetest.h new/karchive-5.95.0/autotests/kcompressiondevicetest.h --- old/karchive-5.94.0/autotests/kcompressiondevicetest.h 2022-04-10 00:06:47.000000000 +0200 +++ new/karchive-5.95.0/autotests/kcompressiondevicetest.h 2022-06-05 16:43:20.000000000 +0200 @@ -7,10 +7,9 @@ #ifndef KCOMPRESSIONDEVICETEST_H #define KCOMPRESSIONDEVICETEST_H -#include <QObject> - #include <QNetworkAccessManager> -#include <QScopedPointer> +#include <QObject> +#include <memory> #include <KCompressionDevice> #include <KTar> @@ -31,8 +30,8 @@ void testExtraction(); QNetworkAccessManager qnam; - QScopedPointer<KCompressionDevice> device; - QScopedPointer<KTar> archive; + std::unique_ptr<KCompressionDevice> device; + std::unique_ptr<KTar> archive; private Q_SLOTS: void regularKTarUsage(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.94.0/autotests/kfiltertest.cpp new/karchive-5.95.0/autotests/kfiltertest.cpp --- old/karchive-5.94.0/autotests/kfiltertest.cpp 2022-04-10 00:06:47.000000000 +0200 +++ new/karchive-5.95.0/autotests/kfiltertest.cpp 2022-06-05 16:43:20.000000000 +0200 @@ -45,14 +45,16 @@ testData = "hello world\n"; } -void KFilterTest::test_block_write(const QString &fileName, const QByteArray &data) +void KFilterTest::test_block_write(const QString &fileName, const QByteArray &data, int nTimes) { KCompressionDevice dev(fileName); bool ok = dev.open(QIODevice::WriteOnly); QVERIFY(ok); - const int ret = dev.write(data); - QCOMPARE(ret, data.size()); + for (int i = 0; i < nTimes; ++i) { + const int ret = dev.write(data); + QCOMPARE(ret, data.size()); + } dev.close(); @@ -61,6 +63,37 @@ void KFilterTest::test_block_write() { + // First we do it 50 times, to make sure the compressor + // can "reuse" existing data, i.e. zstd used to have a bug + // that made this use 513 bytes instead of 28 + qDebug() << " -- test_block_write gzip -- "; + test_block_write(pathgz, testData, 50); + QCOMPARE(QFileInfo(pathgz).size(), 40LL); // size of test.gz + +#if HAVE_BZIP2_SUPPORT + qDebug() << " -- test_block_write bzip2 -- "; + test_block_write(pathbz2, testData, 50); + QCOMPARE(QFileInfo(pathbz2).size(), 64LL); // size of test.bz2 +#endif + +#if HAVE_XZ_SUPPORT + qDebug() << " -- test_block_write xz -- "; + test_block_write(pathxz, testData, 50); + QCOMPARE(QFileInfo(pathxz).size(), 84LL); // size of test.lzma +#endif + + qDebug() << " -- test_block_write none -- "; + test_block_write(pathnone, testData, 50); + QCOMPARE(QFileInfo(pathnone).size(), 600LL); // size of test.txt + +#if HAVE_ZSTD_SUPPORT + qDebug() << " -- test_block_write zstd -- "; + test_block_write(pathzstd, testData, 50); + QCOMPARE(QFileInfo(pathzstd).size(), 28LL); // size of test.zst +#endif + + // Then do the write data just once because test_block_read + // depends on this qDebug() << " -- test_block_write gzip -- "; test_block_write(pathgz, testData); QCOMPARE(QFileInfo(pathgz).size(), 33LL); // size of test.gz @@ -84,7 +117,7 @@ #if HAVE_ZSTD_SUPPORT qDebug() << " -- test_block_write zstd -- "; test_block_write(pathzstd, testData); - QCOMPARE(QFileInfo(pathzstd).size(), 24LL); // size of test.zst + QCOMPARE(QFileInfo(pathzstd).size(), 21LL); // size of test.zst #endif } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.94.0/autotests/kfiltertest.h new/karchive-5.95.0/autotests/kfiltertest.h --- old/karchive-5.94.0/autotests/kfiltertest.h 2022-04-10 00:06:47.000000000 +0200 +++ new/karchive-5.95.0/autotests/kfiltertest.h 2022-06-05 16:43:20.000000000 +0200 @@ -31,7 +31,7 @@ void test_threefilesgztogether(); private: - void test_block_write(const QString &fileName, const QByteArray &data); + void test_block_write(const QString &fileName, const QByteArray &data, int nTimes = 1); void test_block_read(const QString &fileName); void test_getch(const QString &fileName); void test_textstream(const QString &fileName); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.94.0/src/karchive.cpp new/karchive-5.95.0/src/karchive.cpp --- old/karchive-5.94.0/src/karchive.cpp 2022-04-10 00:06:47.000000000 +0200 +++ new/karchive-5.95.0/src/karchive.cpp 2022-06-05 16:43:20.000000000 +0200 @@ -36,6 +36,12 @@ #include <windows.h> // DWORD, GetUserNameW #endif // Q_OS_WIN +#if defined(Q_OS_UNIX) +#define STAT_METHOD QT_LSTAT +#else +#define STAT_METHOD QT_STAT +#endif + //////////////////////////////////////////////////////////////////////// /////////////////// KArchiveDirectoryPrivate /////////////////////////// //////////////////////////////////////////////////////////////////////// @@ -263,11 +269,6 @@ return false; } -#if defined(Q_OS_UNIX) -#define STAT_METHOD QT_LSTAT -#else -#define STAT_METHOD QT_STAT -#endif QT_STATBUF fi; if (STAT_METHOD(QFile::encodeName(fileName).constData(), &fi) == -1) { setErrorString(tr("Failed accessing the file %1 for adding to the archive. The error was: %2").arg(fileName).arg(QLatin1String{strerror(errno)})); @@ -355,16 +356,24 @@ } dir.setFilter(dir.filter() | QDir::Hidden); const QStringList files = dir.entryList(); - for (QStringList::ConstIterator it = files.begin(); it != files.end(); ++it) { - if (*it != QLatin1String(".") && *it != QLatin1String("..")) { - QString fileName = path + QLatin1Char('/') + *it; + for (const QString &file : files) { + if (file != QLatin1String(".") && file != QLatin1String("..")) { + const QString fileName = path + QLatin1Char('/') + file; // qCDebug(KArchiveLog) << "storing " << fileName; - QString dest = destName.isEmpty() ? *it : (destName + QLatin1Char('/') + *it); + const QString dest = destName.isEmpty() ? file : (destName + QLatin1Char('/') + file); QFileInfo fileInfo(fileName); if (fileInfo.isFile() || fileInfo.isSymLink()) { addLocalFile(fileName, dest); } else if (fileInfo.isDir()) { + // Write directory, so that empty dirs are preserved (and permissions written out, etc.) + int perms = 0; + QT_STATBUF fi; + if (STAT_METHOD(QFile::encodeName(fileName).constData(), &fi) != -1) { + perms = fi.st_mode; + } + writeDir(file, fileInfo.owner(), fileInfo.group(), perms, fileInfo.lastRead(), fileInfo.lastModified(), fileInfo.birthTime()); + // Recurse addLocalDirectory(fileName, dest); } // We omit sockets diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.94.0/src/karchive_p.h new/karchive-5.95.0/src/karchive_p.h --- old/karchive-5.94.0/src/karchive_p.h 2022-04-10 00:06:47.000000000 +0200 +++ new/karchive-5.95.0/src/karchive_p.h 2022-06-05 16:43:20.000000000 +0200 @@ -19,16 +19,15 @@ public: KArchivePrivate(KArchive *parent) : q(parent) - , rootDir(nullptr) - , saveFile(nullptr) - , dev(nullptr) - , fileName() - , mode(QIODevice::NotOpen) - , deviceOwned(false) { } ~KArchivePrivate() { + if (deviceOwned) { + delete dev; // we created it ourselves in open() + dev = nullptr; + } + delete saveFile; delete rootDir; } @@ -47,13 +46,13 @@ KArchiveDirectory *findOrCreate(const QString &path, int recursionCounter); - KArchive *q; - KArchiveDirectory *rootDir; - QSaveFile *saveFile; - QIODevice *dev; + KArchive *q = nullptr; + KArchiveDirectory *rootDir = nullptr; + QSaveFile *saveFile = nullptr; + QIODevice *dev = nullptr; QString fileName; - QIODevice::OpenMode mode; - bool deviceOwned; // if true, we (KArchive) own dev and must delete it + QIODevice::OpenMode mode = QIODevice::NotOpen; + bool deviceOwned = false; // if true, we (KArchive) own dev and must delete it QString errorStr{tr("Unknown error")}; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.94.0/src/kzstdfilter.cpp new/karchive-5.95.0/src/kzstdfilter.cpp --- old/karchive-5.94.0/src/kzstdfilter.cpp 2022-04-10 00:06:47.000000000 +0200 +++ new/karchive-5.95.0/src/kzstdfilter.cpp 2022-06-05 16:43:20.000000000 +0200 @@ -123,7 +123,7 @@ KZstdFilter::Result KZstdFilter::compress(bool finish) { // qCDebug(KArchiveLog) << "Calling ZSTD_compressStream2 with avail_in=" << inBufferAvailable() << " avail_out=" << outBufferAvailable(); - const size_t result = ZSTD_compressStream2(d->cStream, &d->outBuffer, &d->inBuffer, finish ? ZSTD_e_end : ZSTD_e_flush); + const size_t result = ZSTD_compressStream2(d->cStream, &d->outBuffer, &d->inBuffer, finish ? ZSTD_e_end : ZSTD_e_continue); if (ZSTD_isError(result)) { return KFilterBase::Error; }
