From 2c412ba24ae013c657128f6ff2256a4e23b181ae Mon Sep 17 00:00:00 2001 From: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Date: Fri, 20 Mar 2026 16:30:03 +0000 Subject: [PATCH] complement.sh: ensure old complement checkout files are deleted; remove -N `wget` flag (#19592) --- changelog.d/19592.misc | 1 + scripts-dev/complement.sh | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 changelog.d/19592.misc diff --git a/changelog.d/19592.misc b/changelog.d/19592.misc new file mode 100644 index 0000000000..e3fa3a5416 --- /dev/null +++ b/changelog.d/19592.misc @@ -0,0 +1 @@ +Ensure old Complement test files are removed when downloading a Complement checkout via `./scripts-dev/complement.sh`. \ No newline at end of file diff --git a/scripts-dev/complement.sh b/scripts-dev/complement.sh index a8a361fd4a..cca87d42a9 100755 --- a/scripts-dev/complement.sh +++ b/scripts-dev/complement.sh @@ -160,8 +160,18 @@ main() { if [[ -z "$COMPLEMENT_DIR" ]]; then COMPLEMENT_REF=${COMPLEMENT_REF:-main} echo "COMPLEMENT_DIR not set. Fetching Complement checkout from ${COMPLEMENT_REF}..." - wget -Nq https://github.com/matrix-org/complement/archive/${COMPLEMENT_REF}.tar.gz + + # Download the Complement checkout at the specified ref. + wget -q https://github.com/matrix-org/complement/archive/${COMPLEMENT_REF}.tar.gz + + # Delete the existing complement checkout. Otherwise we'll end up with stale + # test files after they're deleted server-side, and `tar` will not delete + # old files. + rm -rf complement-${COMPLEMENT_REF} + + # Extract the checkout. tar -xzf ${COMPLEMENT_REF}.tar.gz + COMPLEMENT_DIR=complement-${COMPLEMENT_REF} echo "Checkout available at 'complement-${COMPLEMENT_REF}'" fi