From 6f47c53ff92c48136103b616146bd60ae7740c0b Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Wed, 19 Apr 2023 04:46:42 +0200 Subject: [PATCH] Ports: Force patch regeneration after resolving conflicts Otherwise, the post-conflict state will be used as a reference point, and no changes will be detected. --- Ports/.port_include.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Ports/.port_include.sh b/Ports/.port_include.sh index 15d188c2b2..076b729e38 100755 --- a/Ports/.port_include.sh +++ b/Ports/.port_include.sh @@ -773,7 +773,9 @@ do_dev() { exit 1 fi - [ -d "$workdir" ] || ( + local force_patch_regeneration='false' + + [ -d "$workdir" ] || { do_fetch pushd "$workdir" if [ ! -d ".git" ]; then @@ -840,6 +842,7 @@ do_dev() { >&2 echo "- This patch does not apply, you'll be dropped into a shell to investigate and fix this, quit the shell when the problem is resolved." >&2 echo "Note that the patch needs to be committed into the current repository!" launch_user_shell + force_patch_regeneration='true' fi if ! git diff --quiet >/dev/null 2>&1; then @@ -860,7 +863,7 @@ do_dev() { git tag original popd - ) + } [ -d "$workdir/.git" ] || { >&2 echo "$workdir does not appear to be a git repository." @@ -876,7 +879,7 @@ do_dev() { local current_hash="$(git -C "$workdir" rev-parse HEAD)" # If the hashes are the same, we have no changes, otherwise generate patches - if [ "$original_hash" != "$current_hash" ]; then + if [ "$original_hash" != "$current_hash" ] || [ "${force_patch_regeneration}" = "true" ]; then >&2 echo "Note: Regenerating patches as there are changed commits in the port repo (started at $original_hash, now is $current_hash)" rm -fr "${PORT_META_DIR}"/patches/*.patch git -C "$workdir" format-patch --no-numbered --zero-commit --no-signature --full-index refs/tags/import -o "$(realpath "${PORT_META_DIR}/patches")"