Ports: Handle generating a ReadMe for an empty patch directory

This commit is contained in:
Tim Schumacher 2022-09-17 00:32:05 +02:00 committed by Ali Mohammad Pur
parent f6005764d7
commit c1dc8c9ccb
Notes: sideshowbarker 2024-07-17 08:13:43 +09:00

View file

@ -624,6 +624,14 @@ do_generate_patch_readme() {
fi
fi
# An existing patches directory but no actual patches presumably means that we just deleted all patches,
# so remove the ReadMe file accordingly.
if [ -z "$(find -L "${PORT_META_DIR}/patches" -maxdepth 1 -name '*.patch' -print -quit)" ]; then
>&2 echo "Port $port does not have any patches, deleting ReadMe..."
rm -f "${PORT_META_DIR}/patches/ReadMe.md"
exit 0
fi
local tempdir="$(pwd)/.patches.tmp"
rm -fr "$tempdir"
mkdir "$tempdir"