XFix gbs full build error: binary not found 56/255156/3
authorbiao716.wang <biao716.wang@samsung.com>
Fri, 12 Mar 2021 12:43:46 +0000 (21:43 +0900)
committerbiao716.wang <biao716.wang@samsung.com>
Wed, 17 Mar 2021 03:09:20 +0000 (12:09 +0900)
During gbs full build with multiple threads, If there are several packages downloading the same dependency package.
It will have such issue very rarely.

Change-Id: Ief2f35e32f12c3a3a6dac8783ee57c2d60177f52
Signed-off-by: biao716.wang <biao716.wang@samsung.com>
init_buildsystem

index 68be1b6..187f944 100755 (executable)
@@ -445,7 +445,9 @@ downloadpkg() {
        rm -f "$destfile.v"
        ;;
     esac
-    mv "$destfile" "$SRC" || cleanup_and_exit 1
+    # if there is such package, didn't mv.
+    mv -n "$destfile" "$SRC" || cleanup_and_exit 1
+    rm -rf $destdir
 }
 
 getcachedir() {
@@ -1199,7 +1201,6 @@ rm -f "$BUILD_ROOT"/.rpmmacros "$BUILD_ROOT"/root/.rpmmacros
 rm -rf "$BUILD_ROOT/.init_b_cache"
 rm -f $BUILD_IS_RUNNING
 rm -f $TMPFILE
-rm -rf "$cachedir/tmp_$$"
 
 cleanup_and_exit 0