Blob Blame History Raw
From dab2ade3727dbf61dbcfd58d7a2a3fdbbb36116e Mon Sep 17 00:00:00 2001
From: Jaroslav Rohel <jrohel@redhat.com>
Date: Thu, 5 Sep 2019 14:01:26 +0200
Subject: [PATCH 13/13] Fix: dnf_move_recursive() for file in fallback mode

The dnf_move_recursive() had problem with moving a file in the fallback
mode. The file was copied but removing of its source failed.
The dnf_remove_recursive_v2() is used now to resolve the issue.

Related to https://bugzilla.redhat.com/show_bug.cgi?id=1700341

Closes: #789
Approved by: m-blaha
---
 libdnf/hy-iutil.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libdnf/hy-iutil.cpp b/libdnf/hy-iutil.cpp
index e1a1906a..0bd0e245 100644
--- a/libdnf/hy-iutil.cpp
+++ b/libdnf/hy-iutil.cpp
@@ -419,7 +419,7 @@ dnf_copy_recursive(const std::string & srcPath, const std::string & dstPath, GEr
  * @dst_dir: A destination directory path
  * @error: A #GError, or %NULL
  *
- * Moves a directory and its contents. Native move is preferred,
+ * Moves a file or a directory and its contents. Native move is preferred,
  * if not supported copy and delete fallback is used.
  *
  * Returns: %TRUE on successful move, %FALSE otherwise
@@ -430,7 +430,7 @@ dnf_move_recursive(const char * srcDir, const char * dstDir, GError ** error)
     if (rename(srcDir, dstDir) == -1) {
         if (!dnf_copy_recursive(srcDir, dstDir, error))
             return FALSE;
-        return dnf_remove_recursive(srcDir, error);
+        return dnf_remove_recursive_v2(srcDir, error);
     }
     return TRUE;
 }
-- 
2.21.0