[neon/kde/kio/Neon/release] debian/patches: refresh patches and add mimetype patches recommended by maintainer

Jonathan Riddell null at kde.org
Fri May 14 15:55:49 BST 2021


Git commit ae59c7b2408c60a48b02414c4eee875cabc0a210 by Jonathan Riddell.
Committed on 14/05/2021 at 14:54.
Pushed by jriddell into branch 'Neon/release'.

refresh patches and add mimetype patches recommended by maintainer

M  +4    -4    debian/patches/Disable-flaky-test.patch
R  +1    -23   debian/patches/c19876052ecec18a87a82f5950e8909e22e895ba.diff [from: debian/patches/mimetype.diff - 053% similarity]
A  +40   -0    debian/patches/c748d6987252fafc296cde9351b289ef734cf861.diff
A  +56   -0    debian/patches/e79da836c34fce66231e396c7215314d0eba51b4.diff
M  +8    -8    debian/patches/fix_hurd_build.patch
M  +7    -7    debian/patches/fix_kfreebsd_build
M  +9    -9    debian/patches/report_error_removing_dirs
M  +3    -1    debian/patches/series
M  +4    -4    debian/patches/wait_for_a_bit_longer

https://invent.kde.org/neon/kde/kio/commit/ae59c7b2408c60a48b02414c4eee875cabc0a210

diff --git a/debian/patches/Disable-flaky-test.patch b/debian/patches/Disable-flaky-test.patch
index 55883db..2b30fd3 100644
--- a/debian/patches/Disable-flaky-test.patch
+++ b/debian/patches/Disable-flaky-test.patch
@@ -6,11 +6,11 @@ Subject: Disable flaky test
  autotests/kdirlistertest.cpp | 12 ++++++------
  1 file changed, 6 insertions(+), 6 deletions(-)
 
-Index: kio/autotests/kdirlistertest.cpp
+Index: kio-5.82.0/autotests/kdirlistertest.cpp
 ===================================================================
---- kio.orig/autotests/kdirlistertest.cpp
-+++ kio/autotests/kdirlistertest.cpp
-@@ -1312,12 +1312,12 @@ void KDirListerTest::testRemoveWatchedDi
+--- kio-5.82.0.orig/autotests/kdirlistertest.cpp
++++ kio-5.82.0/autotests/kdirlistertest.cpp
+@@ -1337,12 +1337,12 @@ void KDirListerTest::testRemoveWatchedDi
      QVERIFY(QDir().rmdir(path + "abc"));
  
      // This should trigger an update.
diff --git a/debian/patches/mimetype.diff b/debian/patches/c19876052ecec18a87a82f5950e8909e22e895ba.diff
similarity index 53%
rename from debian/patches/mimetype.diff
rename to debian/patches/c19876052ecec18a87a82f5950e8909e22e895ba.diff
index 9c83b54..bb11421 100644
--- a/debian/patches/mimetype.diff
+++ b/debian/patches/c19876052ecec18a87a82f5950e8909e22e895ba.diff
@@ -1,27 +1,5 @@
-commit c19876052ecec18a87a82f5950e8909e22e895ba
-Author: Ahmad Samir <a.samirh78 at gmail.com>
-Date:   Thu May 13 17:02:52 2021 +0200
-
-    MimeTypeFinderJob: the StatJob details should include the mimetype
-    
-    Apparently we forgot to specify that we want the UDS_MIME_TYPE field in
-    the statFile() method (both when it lived in OpenUrlJob and when it was moved
-    to MimeTypeFinderJob). And now there is a dedicated StatJob flag, StatMimeType,
-    that we can use.
-    
-    Not passing KIO::StatMimeType when creating the StatJob meant the code always
-    used a get job to determine the mime type, which mean that e.g. opening an
-    ISO file from Dolphin, which supposedly just needs to launch Ark, had the
-    whole file read into memory, which means that opening a couple of ISO's and
-    you're out of memory...
-    
-    Thanks to sitter for doing a big chunk of the investigative work in the bug
-    report.
-    
-    CCBUG: 398908
-
 diff --git a/src/core/mimetypefinderjob.cpp b/src/core/mimetypefinderjob.cpp
-index 48fc8c28..baca5869 100644
+index 48fc8c289cc7b3cad3c0b85af3592a2fa01aa8c9..baca58695ec2f680ccce65c240fd6fc70b2e5d26 100644
 --- a/src/core/mimetypefinderjob.cpp
 +++ b/src/core/mimetypefinderjob.cpp
 @@ -122,7 +122,9 @@ void KIO::MimeTypeFinderJobPrivate::statFile()
diff --git a/debian/patches/c748d6987252fafc296cde9351b289ef734cf861.diff b/debian/patches/c748d6987252fafc296cde9351b289ef734cf861.diff
new file mode 100644
index 0000000..44a05a4
--- /dev/null
+++ b/debian/patches/c748d6987252fafc296cde9351b289ef734cf861.diff
@@ -0,0 +1,40 @@
+diff --git a/src/ioslaves/file/file_unix.cpp b/src/ioslaves/file/file_unix.cpp
+index 99d46c8f114a253458d1e622b5e81ed50ad6d121..940e3cbc40b77a475561a21223bb0621d97924df 100644
+--- a/src/ioslaves/file/file_unix.cpp
++++ b/src/ioslaves/file/file_unix.cpp
+@@ -364,7 +364,7 @@ inline static time_t stat_mtime(QT_STATBUF &buf)
+ }
+ #endif
+ 
+-static bool createUDSEntry(const QString &filename, const QByteArray &path, UDSEntry &entry, KIO::StatDetails details)
++static bool createUDSEntry(const QString &filename, const QByteArray &path, UDSEntry &entry, KIO::StatDetails details, const QUrl &url)
+ {
+     assert(entry.count() == 0); // by contract :-)
+     int entries = 0;
+@@ -539,7 +539,7 @@ static bool createUDSEntry(const QString &filename, const QByteArray &path, UDSE
+ 
+     if (details & KIO::StatMimeType) {
+         QMimeDatabase db;
+-        entry.fastInsert(KIO::UDSEntry::UDS_MIME_TYPE, db.mimeTypeForFile(filename).name());
++        entry.fastInsert(KIO::UDSEntry::UDS_MIME_TYPE, db.mimeTypeForFile(url.toLocalFile()).name());
+     }
+ 
+     return true;
+@@ -1186,7 +1186,7 @@ void FileProtocol::listDir(const QUrl &url)
+             listEntry(entry);
+ 
+         } else {
+-            if (createUDSEntry(filename, QByteArray(ep->d_name), entry, details)) {
++            if (createUDSEntry(filename, QByteArray(ep->d_name), entry, details, url)) {
+ #if HAVE_SYS_XATTR_H
+                 if (isNtfsHidden(filename)) {
+                     bool ntfsHidden = true;
+@@ -1476,7 +1476,7 @@ void FileProtocol::stat(const QUrl &url)
+     const KIO::StatDetails details = getStatDetails();
+ 
+     UDSEntry entry;
+-    if (!createUDSEntry(url.fileName(), _path, entry, details)) {
++    if (!createUDSEntry(url.fileName(), _path, entry, details, url)) {
+         error(KIO::ERR_DOES_NOT_EXIST, path);
+         return;
+     }
diff --git a/debian/patches/e79da836c34fce66231e396c7215314d0eba51b4.diff b/debian/patches/e79da836c34fce66231e396c7215314d0eba51b4.diff
new file mode 100644
index 0000000..eb11808
--- /dev/null
+++ b/debian/patches/e79da836c34fce66231e396c7215314d0eba51b4.diff
@@ -0,0 +1,56 @@
+diff --git a/autotests/mimetypefinderjobtest.cpp b/autotests/mimetypefinderjobtest.cpp
+index 72296b9b84cd593b18477db865c09ba7a1be8cdc..f494ff3b6bd7425d80bc41b1aad2f63e817c1aa0 100644
+--- a/autotests/mimetypefinderjobtest.cpp
++++ b/autotests/mimetypefinderjobtest.cpp
+@@ -48,6 +48,7 @@ void MimeTypeFinderJobTest::determineMimeType_data()
+     QTest::newRow("text_file_no_extension") << "text/plain" << "srcfile";
+     QTest::newRow("desktop_file") << "application/x-desktop" << "foo.desktop";
+     QTest::newRow("script") << "application/x-shellscript" << "srcfile.sh";
++    QTest::newRow("directory") << "inode/directory" << "srcdir";
+     /* clang-format on */
+ }
+ 
+@@ -60,7 +61,12 @@ void MimeTypeFinderJobTest::determineMimeType()
+     QTemporaryDir tempDir;
+     const QString srcDir = tempDir.path();
+     const QString srcFile = srcDir + QLatin1Char('/') + fileName;
+-    createSrcFile(srcFile);
++    if (mimeType == "inode/directory") {
++        QVERIFY(QDir(srcDir).mkdir(fileName));
++    } else {
++        createSrcFile(srcFile);
++    }
++
+     QVERIFY(QFile::exists(srcFile));
+     const QUrl url = QUrl::fromLocalFile(srcFile);
+ 
+@@ -68,6 +74,16 @@ void MimeTypeFinderJobTest::determineMimeType()
+     KIO::MimeTypeFinderJob *job = new KIO::MimeTypeFinderJob(url, this);
+     QVERIFY2(job->exec(), qPrintable(job->errorString()));
+     QCOMPARE(job->mimeType(), mimeType);
++
++    // Check that the result is the same when accessing the source
++    // file through a symbolic link (bug #436708)
++    const QString srcLink = srcDir + QLatin1String("/link_") + fileName;
++    QVERIFY(QFile::link(srcFile, srcLink));
++    const QUrl linkUrl = QUrl::fromLocalFile(srcLink);
++
++    job = new KIO::MimeTypeFinderJob(linkUrl, this);
++    QVERIFY2(job->exec(), qPrintable(job->errorString()));
++    QCOMPARE(job->mimeType(), mimeType);
+ }
+ 
+ void MimeTypeFinderJobTest::invalidUrl()
+diff --git a/src/core/mimetypefinderjob.cpp b/src/core/mimetypefinderjob.cpp
+index f5e50cdc48ebca82a5dd17b20236ccce1be6c8ee..48fc8c289cc7b3cad3c0b85af3592a2fa01aa8c9 100644
+--- a/src/core/mimetypefinderjob.cpp
++++ b/src/core/mimetypefinderjob.cpp
+@@ -122,7 +122,7 @@ void KIO::MimeTypeFinderJobPrivate::statFile()
+ {
+     Q_ASSERT(m_mimeTypeName.isEmpty());
+ 
+-    KIO::StatJob *job = KIO::statDetails(m_url, KIO::StatJob::SourceSide, KIO::StatBasic, KIO::HideProgressInfo);
++    KIO::StatJob *job = KIO::statDetails(m_url, KIO::StatJob::SourceSide, KIO::StatBasic | KIO::StatResolveSymlink, KIO::HideProgressInfo);
+     if (!m_authPrompts) {
+         job->addMetaData(QStringLiteral("no-auth-prompt"), QStringLiteral("true"));
+     }
diff --git a/debian/patches/fix_hurd_build.patch b/debian/patches/fix_hurd_build.patch
index d2c39ee..8fa82b9 100644
--- a/debian/patches/fix_hurd_build.patch
+++ b/debian/patches/fix_hurd_build.patch
@@ -12,10 +12,10 @@ Forwarded: no
  src/ioslaves/file/file_unix.cpp | 4 ++--
  2 files changed, 3 insertions(+), 3 deletions(-)
 
-Index: kio/src/ioslaves/file/file.cpp
+Index: kio-5.82.0/src/ioslaves/file/file.cpp
 ===================================================================
---- kio.orig/src/ioslaves/file/file.cpp
-+++ kio/src/ioslaves/file/file.cpp
+--- kio-5.82.0.orig/src/ioslaves/file/file.cpp
++++ kio-5.82.0/src/ioslaves/file/file.cpp
 @@ -308,7 +308,7 @@ void FileProtocol::get(const QUrl &url)
          }
      }
@@ -25,11 +25,11 @@ Index: kio/src/ioslaves/file/file.cpp
      // TODO check return code
      posix_fadvise(f.handle(), 0, 0, POSIX_FADV_SEQUENTIAL);
  #endif
-Index: kio/src/ioslaves/file/file_unix.cpp
+Index: kio-5.82.0/src/ioslaves/file/file_unix.cpp
 ===================================================================
---- kio.orig/src/ioslaves/file/file_unix.cpp
-+++ kio/src/ioslaves/file/file_unix.cpp
-@@ -773,7 +773,7 @@ void FileProtocol::copy(const QUrl &srcU
+--- kio-5.82.0.orig/src/ioslaves/file/file_unix.cpp
++++ kio-5.82.0/src/ioslaves/file/file_unix.cpp
+@@ -793,7 +793,7 @@ void FileProtocol::copy(const QUrl &srcU
          }
      }
  
@@ -38,7 +38,7 @@ Index: kio/src/ioslaves/file/file_unix.cpp
      posix_fadvise(src_file.handle(), 0, 0, POSIX_FADV_SEQUENTIAL);
  #endif
  
-@@ -797,7 +797,7 @@ void FileProtocol::copy(const QUrl &srcU
+@@ -817,7 +817,7 @@ void FileProtocol::copy(const QUrl &srcU
      // Note that error handling is omitted for this call, we don't want to error on e.g. VFAT
      dest_file.setPermissions(QFileDevice::ReadOwner | QFileDevice::WriteOwner);
  
diff --git a/debian/patches/fix_kfreebsd_build b/debian/patches/fix_kfreebsd_build
index 3831ed8..2d66993 100644
--- a/debian/patches/fix_kfreebsd_build
+++ b/debian/patches/fix_kfreebsd_build
@@ -7,22 +7,22 @@ Subject: fix_kfreebsd_build
  src/widgets/kpropertiesdialog.cpp | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)
 
-Index: kio/src/widgets/kpropertiesdialog.cpp
+Index: kio-5.82.0/src/widgets/kpropertiesdialog.cpp
 ===================================================================
---- kio.orig/src/widgets/kpropertiesdialog.cpp
-+++ kio/src/widgets/kpropertiesdialog.cpp
-@@ -69,6 +69,10 @@
+--- kio-5.82.0.orig/src/widgets/kpropertiesdialog.cpp
++++ kio-5.82.0/src/widgets/kpropertiesdialog.cpp
+@@ -120,6 +120,10 @@
+ #if HAVE_POSIX_ACL
  extern "C" {
- #include <errno.h>
  #include <sys/xattr.h>
 +#if defined(Q_OS_FREEBSD) || defined(__FreeBSD_kernel__)
 +#     include <sys/vfs.h>
 +#     include <sys/mount.h>
 +#endif
  }
+ #include "kacleditwidget.h"
  #endif
- 
-@@ -2017,7 +2021,7 @@ KFilePermissionsPropsPlugin::KFilePermis
+@@ -2054,7 +2058,7 @@ KFilePermissionsPropsPlugin::KFilePermis
  static bool fileSystemSupportsACL(const QByteArray &path)
  {
      bool fileSystemSupportsACLs = false;
diff --git a/debian/patches/report_error_removing_dirs b/debian/patches/report_error_removing_dirs
index 134246d..a5ab2fe 100644
--- a/debian/patches/report_error_removing_dirs
+++ b/debian/patches/report_error_removing_dirs
@@ -7,28 +7,28 @@ Subject: report_error_removing_dirs
  src/core/copyjob.cpp | 17 +++++++++++++----
  1 file changed, 13 insertions(+), 4 deletions(-)
 
-Index: kio/src/core/copyjob.cpp
+Index: kio-5.82.0/src/core/copyjob.cpp
 ===================================================================
---- kio.orig/src/core/copyjob.cpp
-+++ kio/src/core/copyjob.cpp
-@@ -158,6 +158,7 @@ public:
-         , m_bOverwriteAllFiles(false)
+--- kio-5.82.0.orig/src/core/copyjob.cpp
++++ kio-5.82.0/src/core/copyjob.cpp
+@@ -161,6 +161,7 @@ public:
          , m_bOverwriteAllDirs(false)
+         , m_bOverwriteWhenOlder(false)
          , m_conflictError(0)
 +        , m_dirsFailedError(0)
          , m_reportTimer(nullptr)
      {
      }
-@@ -212,6 +213,8 @@ public:
-     bool m_bOverwriteAllFiles;
+@@ -217,6 +218,8 @@ public:
      bool m_bOverwriteAllDirs;
+     bool m_bOverwriteWhenOlder;
      int m_conflictError;
 +    int m_dirsFailedError;
 +    QString m_dirsFailedErrorText;
  
      QTimer *m_reportTimer;
  
-@@ -1822,6 +1825,10 @@ void CopyJobPrivate::setNextDirAttribute
+@@ -1882,6 +1885,10 @@ void CopyJobPrivate::setNextDirAttribute
              m_reportTimer->stop();
          }
  
@@ -39,7 +39,7 @@ Index: kio/src/core/copyjob.cpp
          q->emitResult();
      }
  }
-@@ -1889,12 +1896,14 @@ void CopyJobPrivate::slotTotalSize(KJob
+@@ -1949,12 +1956,14 @@ void CopyJobPrivate::slotTotalSize(KJob
  void CopyJobPrivate::slotResultDeletingDirs(KJob *job)
  {
      Q_Q(CopyJob);
diff --git a/debian/patches/series b/debian/patches/series
index 7790801..ae288d2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,4 +6,6 @@ Disable-flaky-test.patch
 Disable-baloo-dependant-tests.patch
 #Disable-flaky-test-1.patch
 libexec_from_env.patch
-mimetype.diff
+e79da836c34fce66231e396c7215314d0eba51b4.diff
+c19876052ecec18a87a82f5950e8909e22e895ba.diff
+c748d6987252fafc296cde9351b289ef734cf861.diff
diff --git a/debian/patches/wait_for_a_bit_longer b/debian/patches/wait_for_a_bit_longer
index c4c36c0..f7e60ef 100644
--- a/debian/patches/wait_for_a_bit_longer
+++ b/debian/patches/wait_for_a_bit_longer
@@ -7,11 +7,11 @@ Subject: wait_for_a_bit_longer
  autotests/kdirlistertest.cpp | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-Index: kio/autotests/kdirlistertest.cpp
+Index: kio-5.82.0/autotests/kdirlistertest.cpp
 ===================================================================
---- kio.orig/autotests/kdirlistertest.cpp
-+++ kio/autotests/kdirlistertest.cpp
-@@ -1205,7 +1205,7 @@ void KDirListerTest::testRemoveWatchedDi
+--- kio-5.82.0.orig/autotests/kdirlistertest.cpp
++++ kio-5.82.0/autotests/kdirlistertest.cpp
+@@ -1337,7 +1337,7 @@ void KDirListerTest::testRemoveWatchedDi
      QVERIFY(QDir().rmdir(path + "abc"));
  
      // This should trigger an update.


More information about the Neon-commits mailing list