Workaround mock --resultdir:
authorJan Kratochvil <jan.kratochvil@redhat.com>
Sun, 2 Aug 2020 19:48:28 +0000 (21:48 +0200)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Sun, 2 Aug 2020 19:48:28 +0000 (21:48 +0200)
  --addrepo does not work with --rebuild && --resultdir should warn for --chain mode
  https://bugzilla.redhat.com/show_bug.cgi?id=1857918

runone

diff --git a/runone b/runone
index 28d2c23..022d0e5 100755 (executable)
--- a/runone
+++ b/runone
@@ -57,23 +57,23 @@ for pkg in "$@";do
     set +e
     # --chain instead of --rebuild as otherwise -a does not work
     $mock --resultdir=$resultdir --nocheck $(: -a https://people.redhat.com/jkratoch/dwzrepo/ ) --chain $srcrpm$ext &>$srcrpm$ext.mocklog
-    rc=$?
+    mockrc=$?
     set -e
     test -e $resultdir
     #rm -f $srcrpm$ext
-    if [ $rc -ne 0 ];then
-      touch $srcrpm$ext.mockfail
-      break
-    fi
     # --chain ignores --resultdir
     resultdirsrc="$(sed -n 's/^INFO: Results out to: //p' $srcrpm$ext.mocklog)"
     if [ ! -e $resultdirsrc/*/root.log ];then
-      touch $srcrpm$ext.mockrfail
+      touch $srcrpm$ext.mockfail
       break
     fi
     # With --chain $resultdir contains just some small *.log files.
     rm -rf $resultdir
     mv `dirname $resultdirsrc/*/root.log` $resultdir
+    if [ $mockrc -ne 0 ];then
+      touch $srcrpm$ext.mockfail
+      break
+    fi
     echo >$srcrpm$ext.rpmsize $(du -sbc /dev/null $resultdir/*-debuginfo*.rpm|tail -n1|awk '{print $1}')
     size=0
     for i in $resultdir/*-debuginfo*.rpm;do