From d554f146cc2dfad719c6410764c8a76857a23247 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Tue, 2 Jun 2015 22:12:56 +0200 Subject: git-ptx-patches: play nice with patches managed by other tools Signed-off-by: Michael Olbrich --- scripts/lib/ptxd_make_world_patchin.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'scripts/lib/ptxd_make_world_patchin.sh') 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 " + + # skip patches generated by other tools with '# -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 -- cgit v1.2.3