dcavalca / rpms / libdnf

Forked from rpms/libdnf 2 years ago
Clone

Blame SOURCES/0013-Fix-dnf_move_recursive-for-file-in-fallback-mode.patch

885e9e
From dab2ade3727dbf61dbcfd58d7a2a3fdbbb36116e Mon Sep 17 00:00:00 2001
885e9e
From: Jaroslav Rohel <jrohel@redhat.com>
885e9e
Date: Thu, 5 Sep 2019 14:01:26 +0200
885e9e
Subject: [PATCH 13/13] Fix: dnf_move_recursive() for file in fallback mode
885e9e
885e9e
The dnf_move_recursive() had problem with moving a file in the fallback
885e9e
mode. The file was copied but removing of its source failed.
885e9e
The dnf_remove_recursive_v2() is used now to resolve the issue.
885e9e
885e9e
Related to https://bugzilla.redhat.com/show_bug.cgi?id=1700341
885e9e
885e9e
Closes: #789
885e9e
Approved by: m-blaha
885e9e
---
885e9e
 libdnf/hy-iutil.cpp | 4 ++--
885e9e
 1 file changed, 2 insertions(+), 2 deletions(-)
885e9e
885e9e
diff --git a/libdnf/hy-iutil.cpp b/libdnf/hy-iutil.cpp
885e9e
index e1a1906a..0bd0e245 100644
885e9e
--- a/libdnf/hy-iutil.cpp
885e9e
+++ b/libdnf/hy-iutil.cpp
885e9e
@@ -419,7 +419,7 @@ dnf_copy_recursive(const std::string & srcPath, const std::string & dstPath, GEr
885e9e
  * @dst_dir: A destination directory path
885e9e
  * @error: A #GError, or %NULL
885e9e
  *
885e9e
- * Moves a directory and its contents. Native move is preferred,
885e9e
+ * Moves a file or a directory and its contents. Native move is preferred,
885e9e
  * if not supported copy and delete fallback is used.
885e9e
  *
885e9e
  * Returns: %TRUE on successful move, %FALSE otherwise
885e9e
@@ -430,7 +430,7 @@ dnf_move_recursive(const char * srcDir, const char * dstDir, GError ** error)
885e9e
     if (rename(srcDir, dstDir) == -1) {
885e9e
         if (!dnf_copy_recursive(srcDir, dstDir, error))
885e9e
             return FALSE;
885e9e
-        return dnf_remove_recursive(srcDir, error);
885e9e
+        return dnf_remove_recursive_v2(srcDir, error);
885e9e
     }
885e9e
     return TRUE;
885e9e
 }
885e9e
-- 
885e9e
2.21.0
885e9e