Blame SOURCES/0001-Use-external-command-mv-to-rename-old-output-directo.patch

794737
From 6579cf5f72d5de345ae1cc97d0344dfa1771460a Mon Sep 17 00:00:00 2001
794737
From: "Richard W.M. Jones" <rjones@redhat.com>
794737
Date: Mon, 28 Jan 2019 22:20:33 +0000
794737
Subject: [PATCH] Use external command mv to rename old output directory
794737
 (RHBZ#1670191).
794737
794737
See https://bugzilla.redhat.com/show_bug.cgi?id=1670191#c0
794737
for explanation.
794737
794737
Thanks: Sam Eiderman
794737
---
794737
 src/supermin.ml | 10 ++++------
794737
 1 file changed, 4 insertions(+), 6 deletions(-)
794737
794737
diff --git a/src/supermin.ml b/src/supermin.ml
794737
index 71d8b64..7c7135b3 100644
794737
--- a/src/supermin.ml
794737
+++ b/src/supermin.ml
794737
@@ -264,12 +264,10 @@ appliance automatically.
794737
 
794737
   (* Delete the old output directory if it exists. *)
794737
   let old_outputdir =
794737
-    try
794737
-      let old_outputdir = outputdir ^ "." ^ string_random8 () in
794737
-      rename outputdir old_outputdir;
794737
-      Some old_outputdir
794737
-    with
794737
-      Unix_error _ -> None in
794737
+    let old_outputdir = outputdir ^ "." ^ string_random8 () in
794737
+    let cmd = sprintf "mv %s %s 2>/dev/null"
794737
+                      (quote outputdir) (quote old_outputdir) in
794737
+    if Sys.command cmd == 0 then Some old_outputdir else None in
794737
 
794737
   if debug >= 1 then
794737
     printf "supermin: renaming %s to %s\n%!" new_outputdir outputdir;
794737
-- 
794737
2.22.0
794737