[tor-commits] [tor-browser-build/master] Bug 25143: avoid error if output file already exists

gk at torproject.org gk at torproject.org
Thu Nov 22 14:34:02 UTC 2018


commit a334a1a59175e3e75b2a49fb02bc9206b838b727
Author: Nicolas Vigier <boklm at torproject.org>
Date:   Mon Nov 19 19:29:52 2018 +0100

    Bug 25143: avoid error if output file already exists
    
    If output file or directory already exists, remove it before moving it.
    This avoids an error when rebuilding a project that was already built.
---
 rbm.conf | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/rbm.conf b/rbm.conf
index 5e981ac..87fe179 100644
--- a/rbm.conf
+++ b/rbm.conf
@@ -401,7 +401,12 @@ runc:
     sudo chown -R $(whoami) "$srcdir"
     if [ $(ls -1 "$srcdir"/* 2> /dev/null | wc -l) -gt 0 ]
     then
-      mv -f "$srcdir"/* [% dst %]/
+      for file in "$srcdir"/*
+      do
+        bname="$(basename "$file")"
+        test -e [% dst %]/"$bname" && rm -Rf [% dst %]/"$bname"
+        mv -f "$file" [% dst %]/
+      done
     fi
 
   remote_finish: |





More information about the tor-commits mailing list