about summary refs log tree commit diff
path: root/qemu_mode/build_qemu_support.sh
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2022-01-30 14:50:15 +0100
committervanhauser-thc <vh@thc.org>2022-01-30 14:50:15 +0100
commit43a7c0d601526654bb47f138b63a93d925a6e832 (patch)
tree728ed0a0825fc695074c414f11b707da546ea694 /qemu_mode/build_qemu_support.sh
parent311649f4581ff54f32bf6fe85fea357c329b0b68 (diff)
downloadafl++-43a7c0d601526654bb47f138b63a93d925a6e832.tar.gz
make build_... scripts work without afl++ git checkout
Diffstat (limited to 'qemu_mode/build_qemu_support.sh')
-rwxr-xr-xqemu_mode/build_qemu_support.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/qemu_mode/build_qemu_support.sh b/qemu_mode/build_qemu_support.sh
index 86ebb4d4..8822770c 100755
--- a/qemu_mode/build_qemu_support.sh
+++ b/qemu_mode/build_qemu_support.sh
@@ -77,9 +77,9 @@ if [ $? -eq 0 ]; then
   git submodule update ./qemuafl 2>/dev/null # ignore errors
 else
   echo "[*] cloning qemuafl"
-  test -d qemuafl || {
+  test -d qemuafl/.git || {
     CNT=1
-    while [ '!' -d qemuafl -a "$CNT" -lt 4 ]; do
+    while [ '!' -d qemuafl/.git -a "$CNT" -lt 4 ]; do
       echo "Trying to clone qemuafl (attempt $CNT/3)"
       git clone --depth 1 https://github.com/AFLplusplus/qemuafl
       CNT=`expr "$CNT" + 1`
@@ -87,7 +87,7 @@ else
   }
 fi
 
-test -d qemuafl || { echo "[-] Not checked out, please install git or check your internet connection." ; exit 1 ; }
+test -d qemuafl/.git || { echo "[-] Not checked out, please install git or check your internet connection." ; exit 1 ; }
 echo "[+] Got qemuafl."
 
 cd "qemuafl" || exit 1
@@ -96,6 +96,7 @@ if [ -n "$NO_CHECKOUT" ]; then
 else
   echo "[*] Checking out $QEMUAFL_VERSION"
   sh -c 'git stash' 1>/dev/null 2>/dev/null
+  git pull
   git checkout "$QEMUAFL_VERSION" || echo Warning: could not check out to commit $QEMUAFL_VERSION
 fi