diff options
author | Tim Schumacher <timschumi@gmx.de> | 2023-04-19 04:46:42 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-04-19 07:53:18 +0200 |
commit | 6f47c53ff92c48136103b616146bd60ae7740c0b (patch) | |
tree | fe83747873f1676fe44f850a530907bd706e67c2 /Ports | |
parent | fb049d691390d3fcf8181f68e37afd74fbf72dfe (diff) | |
download | serenity-6f47c53ff92c48136103b616146bd60ae7740c0b.zip |
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.
Diffstat (limited to 'Ports')
-rwxr-xr-x | Ports/.port_include.sh | 9 |
1 files 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")" |