summaryrefslogtreecommitdiffstats
path: root/scripts/lib/ptxd_make_world_patchin.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/ptxd_make_world_patchin.sh')
-rw-r--r--scripts/lib/ptxd_make_world_patchin.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/lib/ptxd_make_world_patchin.sh b/scripts/lib/ptxd_make_world_patchin.sh
index 1cdd96c88..2f22fe573 100644
--- a/scripts/lib/ptxd_make_world_patchin.sh
+++ b/scripts/lib/ptxd_make_world_patchin.sh
@@ -154,6 +154,17 @@ ptxd_make_world_patchin_apply_git()
git quiltimport \
--patches "${pkg_patchin_dir}/.ptxdist/git-patches" \
--author "unknown author <unknown.author@example.com>"
+
+ # skip patches generated by other tools with '# <tool>-end' as end marker
+ if tail -n1 "${pkg_patchin_dir}/.ptxdist/series" | grep -q '# [^ ]*-end$'; then
+ local last="$(sed -n 's/^\([0-9][0-9]*\)-.*/\1/p' "${pkg_patchin_dir}/.ptxdist/series" | tail -n1)"
+ git tag -f base
+ local next=1000
+ if [ -n "${last}" ]; then
+ next="$[(1+${last}/1000)*1000]"
+ fi
+ echo "#tag:base --start-number ${next}" >> ${pkg_patchin_dir}/.ptxdist/series.append
+ fi
}
export -f ptxd_make_world_patchin_apply_git