Hello community, here is the log from the commit of package karchive for openSUSE:Factory checked in at 2016-08-29 14:55:52 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/karchive (Old) and /work/SRC/openSUSE:Factory/.karchive.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "karchive" Changes: -------- --- /work/SRC/openSUSE:Factory/karchive/karchive.changes 2016-07-15 12:31:51.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.karchive.new/karchive.changes 2016-08-29 14:56:15.000000000 +0200 @@ -1,0 +2,11 @@ +Sun Aug 7 21:50:22 UTC 2016 - hrvoje.sen...@gmail.com + +- Update to 5.25.0 + * Qt >= 5.5 is now required + * Handle multiple gzip streams (kde#232843) + * Assume a directory is a directory, even if the permission bit + is set wrong (kde#364071) + * For more details please see: + https://www.kde.org/announcements/kde-frameworks-5.25.0.php + +------------------------------------------------------------------- Old: ---- karchive-5.24.0.tar.xz New: ---- karchive-5.25.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ karchive.spec ++++++ --- /var/tmp/diff_new_pack.YTZNE7/_old 2016-08-29 14:56:17.000000000 +0200 +++ /var/tmp/diff_new_pack.YTZNE7/_new 2016-08-29 14:56:17.000000000 +0200 @@ -17,15 +17,15 @@ %define lname libKF5Archive5 -%define _tar_path 5.24 +%define _tar_path 5.25 Name: karchive -Version: 5.24.0 +Version: 5.25.0 Release: 0 BuildRequires: cmake >= 2.8.12 BuildRequires: extra-cmake-modules >= %{_tar_path} BuildRequires: fdupes BuildRequires: kf5-filesystem -BuildRequires: cmake(Qt5Core) >= 5.4.0 +BuildRequires: cmake(Qt5Core) >= 5.5.0 BuildRequires: pkgconfig(bzip2) BuildRequires: pkgconfig(liblzma) BuildRequires: pkgconfig(zlib) @@ -61,7 +61,7 @@ Group: Development/Libraries/KDE Requires: %lname = %{version} Requires: extra-cmake-modules -Requires: cmake(Qt5Core) >= 5.4.0 +Requires: cmake(Qt5Core) >= 5.5.0 %description devel KArchive provides classes for easy reading, creation and manipulation of ++++++ karchive-5.24.0.tar.xz -> karchive-5.25.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.24.0/CMakeLists.txt new/karchive-5.25.0/CMakeLists.txt --- old/karchive-5.24.0/CMakeLists.txt 2016-07-02 10:40:42.000000000 +0200 +++ new/karchive-5.25.0/CMakeLists.txt 2016-08-06 10:26:31.000000000 +0200 @@ -3,7 +3,7 @@ project(KArchive) include(FeatureSummary) -find_package(ECM 5.24.0 NO_MODULE) +find_package(ECM 5.25.0 NO_MODULE) set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules") feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) @@ -17,7 +17,7 @@ include(GenerateExportHeader) -set(REQUIRED_QT_VERSION 5.4.0) +set(REQUIRED_QT_VERSION 5.5.0) find_package(Qt5Core ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE) find_package(ZLIB) @@ -49,7 +49,7 @@ include(ECMSetupVersion) include(ECMGenerateHeaders) -set(KF5_VERSION "5.24.0") # handled by release scripts +set(KF5_VERSION "5.25.0") # handled by release scripts ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX KARCHIVE Files old/karchive-5.24.0/autotests/data/dirpermissions.zip and new/karchive-5.25.0/autotests/data/dirpermissions.zip differ Files old/karchive-5.24.0/autotests/data/threefiles.gz and new/karchive-5.25.0/autotests/data/threefiles.gz differ Files old/karchive-5.24.0/autotests/data/twofiles.gz and new/karchive-5.25.0/autotests/data/twofiles.gz differ Files old/karchive-5.24.0/autotests/data/unusual_but_valid_364071.zip and new/karchive-5.25.0/autotests/data/unusual_but_valid_364071.zip differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.24.0/autotests/karchivetest.cpp new/karchive-5.25.0/autotests/karchivetest.cpp --- old/karchive-5.24.0/autotests/karchivetest.cpp 2016-07-02 10:40:42.000000000 +0200 +++ new/karchive-5.25.0/autotests/karchivetest.cpp 2016-08-06 10:26:31.000000000 +0200 @@ -763,6 +763,7 @@ void KArchiveTest::testTarIgnoreRelativePathOutsideArchive() { +#if HAVE_BZIP2_SUPPORT // This test extracts a Tar archive that contains a relative path "../foo" pointing // outside of the archive directory. For security reasons extractions should only // be allowed within the extracted directory as long as not specifically asked. @@ -777,6 +778,9 @@ QVERIFY(dir->copyTo(dirName)); QVERIFY(!QFile::exists(dirName + "../foo")); QVERIFY(QFile::exists(dirName + "/foo")); +#else + QSKIP("Test data is in bz2 format and karchive is built without bzip2 format"); +#endif } /// @@ -1103,6 +1107,32 @@ QCOMPARE(fileEntry->data(), fileData); } +void KArchiveTest::testZipDirectoryPermissions() +{ + QString fileName = QFINDTESTDATA("data/dirpermissions.zip"); + QVERIFY(!fileName.isEmpty()); + + KZip zip(fileName); + + QVERIFY(zip.open(QIODevice::ReadOnly)); + const KArchiveDirectory *dir = zip.directory(); + const QStringList listing = recursiveListEntries(dir, QString(), 0); + QCOMPARE(listing.join(' '), QString::fromUtf8("mode=40700 path=700 type=dir mode=40750 path=750 type=dir mode=40755 path=755 type=dir")); +} + +void KArchiveTest::testZipUnusualButValid() +{ + QString fileName = QFINDTESTDATA("data/unusual_but_valid_364071.zip"); + QVERIFY(!fileName.isEmpty()); + + KZip zip(fileName); + + QVERIFY(zip.open(QIODevice::ReadOnly)); + const KArchiveDirectory *dir = zip.directory(); + const QStringList listing = recursiveListEntries(dir, QString(), 0); + QCOMPARE(listing.join(' '), QLatin1String("mode=40744 path=test type=dir mode=744 path=test/os-release type=file size=199")); +} + void KArchiveTest::testRcc() { const QString rccFile = QFINDTESTDATA("runtime_resource.rcc"); // was copied from qtbase/tests/auto/corelib/io/qresourceengine diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.24.0/autotests/karchivetest.h new/karchive-5.25.0/autotests/karchivetest.h --- old/karchive-5.24.0/autotests/karchivetest.h 2016-07-02 10:40:42.000000000 +0200 +++ new/karchive-5.25.0/autotests/karchivetest.h 2016-08-06 10:26:31.000000000 +0200 @@ -90,6 +90,8 @@ void testZipAddLocalDirectory(); void testZipReadRedundantDataDescriptor_data(); void testZipReadRedundantDataDescriptor(); + void testZipDirectoryPermissions(); + void testZipUnusualButValid(); void testRcc(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.24.0/autotests/kfiltertest.cpp new/karchive-5.25.0/autotests/kfiltertest.cpp --- old/karchive-5.24.0/autotests/kfiltertest.cpp 2016-07-02 10:40:42.000000000 +0200 +++ new/karchive-5.25.0/autotests/kfiltertest.cpp 2016-08-06 10:26:31.000000000 +0200 @@ -428,3 +428,29 @@ QCOMPARE(QString::fromLatin1(otherReader.readAll()), expectedFullData); QVERIFY(otherReader.atEnd()); } + +void KFilterTest::test_twofilesgztogether() +{ + // Reported as 232843 + // twofiles generated with + // echo foo > foo; echo bar > bar ; gzip -c foo > twofiles.gz; gzip -c bar >> twofiles.gz + // as documented in the gzip manpage + QString data = QFINDTESTDATA("data/twofiles.gz"); + KFilterDev dev(data); + QVERIFY(dev.open(QIODevice::ReadOnly)); + QByteArray extractedData = dev.readAll(); + QByteArray expectedData{"foo\nbar\n"}; + QCOMPARE(extractedData, expectedData); +} + +void KFilterTest::test_threefilesgztogether() +{ + // Generated similarly to the one above + // This catches the case where there's more than two streams available in the same buffer fed to KGzipFilter + QString data = QFINDTESTDATA("data/threefiles.gz"); + KFilterDev dev(data); + QVERIFY(dev.open(QIODevice::ReadOnly)); + QByteArray extractedData = dev.readAll(); + QByteArray expectedData{"foo\nbar\nbaz\n"}; + QCOMPARE(extractedData, expectedData); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.24.0/autotests/kfiltertest.h new/karchive-5.25.0/autotests/kfiltertest.h --- old/karchive-5.24.0/autotests/kfiltertest.h 2016-07-02 10:40:42.000000000 +0200 +++ new/karchive-5.25.0/autotests/kfiltertest.h 2016-08-06 10:26:31.000000000 +0200 @@ -39,6 +39,8 @@ void test_pushData(); void test_saveFile_data(); void test_saveFile(); + void test_twofilesgztogether(); + void test_threefilesgztogether(); private: void test_block_write(const QString &fileName, const QByteArray &data); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.24.0/src/kcompressiondevice.cpp new/karchive-5.25.0/src/kcompressiondevice.cpp --- old/karchive-5.24.0/src/kcompressiondevice.cpp 2016-07-02 10:40:42.000000000 +0200 +++ new/karchive-5.25.0/src/kcompressiondevice.cpp 2016-08-06 10:26:31.000000000 +0200 @@ -292,8 +292,13 @@ availOut = maxlen - dataReceived; } if (d->result == KFilterBase::End) { - //qDebug() << "got END. dataReceived=" << dataReceived; - break; // Finished. + // We're actually at the end, no more data to check + if (filter->device()->atEnd()) { + break; + } + + // Still not done, re-init and try again + filter->init(filter->mode()); } filter->setOutBuffer(data, availOut); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.24.0/src/kgzipfilter.cpp new/karchive-5.25.0/src/kgzipfilter.cpp --- old/karchive-5.24.0/src/kgzipfilter.cpp 2016-07-02 10:40:42.000000000 +0200 +++ new/karchive-5.25.0/src/kgzipfilter.cpp 2016-08-06 10:26:31.000000000 +0200 @@ -297,25 +297,53 @@ Q_ASSERT(d->mode == QIODevice::ReadOnly); #endif - if (d->compressed) { + if (!d->compressed) { + return uncompress_noop(); + } + #ifdef DEBUG_GZIP - qDebug() << "Calling inflate with avail_in=" << inBufferAvailable() << " avail_out=" << outBufferAvailable(); - qDebug() << " next_in=" << d->zStream.next_in; + qDebug() << "Calling inflate with avail_in=" << inBufferAvailable() << " avail_out=" << outBufferAvailable(); + qDebug() << " next_in=" << d->zStream.next_in; #endif + + while (d->zStream.avail_in > 0) { int result = inflate(&d->zStream, Z_SYNC_FLUSH); + #ifdef DEBUG_GZIP qDebug() << " -> inflate returned " << result; qDebug() << " now avail_in=" << inBufferAvailable() << " avail_out=" << outBufferAvailable(); qDebug() << " next_in=" << d->zStream.next_in; -#else - if (result != Z_OK && result != Z_STREAM_END) { - //qDebug() << "Warning: inflate() returned " << result; - } #endif - return (result == Z_OK ? KFilterBase::Ok : (result == Z_STREAM_END ? KFilterBase::End : KFilterBase::Error)); - } else { - return uncompress_noop(); + + if (result == Z_OK) { + return KFilterBase::Ok; + } + + // We can't handle any other results + if (result != Z_STREAM_END) { + return KFilterBase::Error; + } + + // It really was the end + if (d->zStream.avail_in == 0) { + return KFilterBase::End; + } + + // Store before resetting + Bytef *data = d->zStream.next_in; // This is increased appropriately by zlib beforehand + uInt size = d->zStream.avail_in; + + // Reset the stream, if that fails we assume we're at the end + if (!init(d->mode)) { + return KFilterBase::End; + } + + // Reset the data to where we left off + d->zStream.next_in = data; + d->zStream.avail_in = size; } + + return KFilterBase::End; } KGzipFilter::Result KGzipFilter::compress(bool finish) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.24.0/src/kzip.cpp new/karchive-5.25.0/src/kzip.cpp --- old/karchive-5.24.0/src/kzip.cpp 2016-07-02 10:40:42.000000000 +0200 +++ new/karchive-5.25.0/src/kzip.cpp 2016-08-06 10:26:31.000000000 +0200 @@ -699,7 +699,7 @@ if (os_madeby != 3) { access = S_IFDIR | 0755; } else { - Q_ASSERT(access & S_IFDIR); + access |= S_IFDIR | 0700; } }